001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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            @Override
050            public Hits search(SearchContext searchContext, Query query) {
051                    throw new UnsupportedOperationException();
052            }
053    
054            @Override
055            public Hits search(
056                    String searchEngineId, long companyId, Query query, Sort[] sort,
057                    int start, int end) {
058    
059                    throw new UnsupportedOperationException();
060            }
061    
062            @Override
063            public String spellCheckKeywords(SearchContext searchContext) {
064                    throw new UnsupportedOperationException();
065            }
066    
067            @Override
068            public Map<String, List<String>> spellCheckKeywords(
069                    SearchContext searchContext, int max) {
070    
071                    throw new UnsupportedOperationException();
072            }
073    
074            @Override
075            public String[] suggestKeywordQueries(
076                    SearchContext searchContext, int max) {
077    
078                    throw new UnsupportedOperationException();
079            }
080    
081    }