001    /**
002     * Copyright (c) 2000-present 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.Collection;
021    
022    /**
023     * @author Bruno Farache
024     * @author Tina Tian
025     */
026    public class IndexWriterProxyBean
027            extends BaseMultiDestinationProxyBean implements IndexWriter {
028    
029            @Override
030            public void addDocument(SearchContext searchContext, Document document) {
031                    throw new UnsupportedOperationException();
032            }
033    
034            @Override
035            public void addDocuments(
036                    SearchContext searchContext, Collection<Document> documents) {
037    
038                    throw new UnsupportedOperationException();
039            }
040    
041            @Override
042            public void clearQuerySuggestionDictionaryIndexes(
043                    SearchContext searchContext) {
044    
045                    throw new UnsupportedOperationException();
046            }
047    
048            @Override
049            public void clearSpellCheckerDictionaryIndexes(
050                    SearchContext searchContext) {
051    
052                    throw new UnsupportedOperationException();
053            }
054    
055            @Override
056            public void commit(SearchContext searchContext) {
057                    throw new UnsupportedOperationException();
058            }
059    
060            @Override
061            public void deleteDocument(SearchContext searchContext, String uid) {
062                    throw new UnsupportedOperationException();
063            }
064    
065            @Override
066            public void deleteDocuments(
067                    SearchContext searchContext, Collection<String> uids) {
068    
069                    throw new UnsupportedOperationException();
070            }
071    
072            @Override
073            public void deleteEntityDocuments(
074                    SearchContext searchContext, String className) {
075    
076                    throw new UnsupportedOperationException();
077            }
078    
079            @Override
080            public String getDestinationName(ProxyRequest proxyRequest) {
081                    Object[] arguments = proxyRequest.getArguments();
082    
083                    SearchContext searchContext = (SearchContext)arguments[0];
084    
085                    String searchEngineId = searchContext.getSearchEngineId();
086    
087                    return SearchEngineUtil.getSearchWriterDestinationName(searchEngineId);
088            }
089    
090            @Override
091            public void indexKeyword(
092                    SearchContext searchContext, float weight, String keywordType) {
093    
094                    throw new UnsupportedOperationException();
095            }
096    
097            @Override
098            public void indexQuerySuggestionDictionaries(SearchContext searchContext) {
099                    throw new UnsupportedOperationException();
100            }
101    
102            @Override
103            public void indexQuerySuggestionDictionary(SearchContext searchContext) {
104                    throw new UnsupportedOperationException();
105            }
106    
107            @Override
108            public void indexSpellCheckerDictionaries(SearchContext searchContext) {
109                    throw new UnsupportedOperationException();
110            }
111    
112            @Override
113            public void indexSpellCheckerDictionary(SearchContext searchContext) {
114                    throw new UnsupportedOperationException();
115            }
116    
117            @Override
118            public void partiallyUpdateDocument(
119                    SearchContext searchContext, Document document) {
120    
121                    throw new UnsupportedOperationException();
122            }
123    
124            @Override
125            public void partiallyUpdateDocuments(
126                    SearchContext searchContext, Collection<Document> documents) {
127            }
128    
129            @Override
130            public void updateDocument(SearchContext searchContext, Document document) {
131                    throw new UnsupportedOperationException();
132            }
133    
134            @Override
135            public void updateDocuments(
136                    SearchContext searchContext, Collection<Document> documents) {
137    
138                    throw new UnsupportedOperationException();
139            }
140    
141    }