001    /**
002     * Copyright (c) 2000-2013 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            @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    }