001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.search;
016    
017    import com.liferay.portal.kernel.messaging.proxy.BaseMultiDestinationProxyBean;
018    import com.liferay.portal.kernel.messaging.proxy.ProxyRequest;
019    
020    import java.util.List;
021    import java.util.Map;
022    
023    /**
024     * @author Bruno Farache
025     * @author Tina Tian
026     * @author Raymond Augé
027     */
028    public class IndexSearcherProxyBean
029            extends BaseMultiDestinationProxyBean implements IndexSearcher {
030    
031            @Override
032            public String getDestinationName(ProxyRequest proxyRequest) {
033                    Object[] arguments = proxyRequest.getArguments();
034    
035                    String searchEngineId = null;
036    
037                    if (arguments[0] instanceof SearchContext) {
038                            SearchContext searchContext = (SearchContext)arguments[0];
039    
040                            searchEngineId = searchContext.getSearchEngineId();
041                    }
042                    else {
043                            searchEngineId = (String)arguments[0];
044                    }
045    
046                    return SearchEngineUtil.getSearchReaderDestinationName(searchEngineId);
047            }
048    
049            public Hits search(SearchContext searchContext, Query query) {
050                    throw new UnsupportedOperationException();
051            }
052    
053            public Hits search(
054                    String searchEngineId, long companyId, Query query, Sort[] sort,
055                    int start, int end) {
056    
057                    throw new UnsupportedOperationException();
058            }
059    
060            public String spellCheckKeywords(SearchContext searchContext) {
061                    throw new UnsupportedOperationException();
062            }
063    
064            public Map<String, List<String>> spellCheckKeywords(
065                    SearchContext searchContext, int max) {
066    
067                    throw new UnsupportedOperationException();
068            }
069    
070            public String[] suggestKeywordQueries(
071                    SearchContext searchContext, int max) {
072    
073                    throw new UnsupportedOperationException();
074            }
075    
076    }