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.Collection;
021    
022    /**
023     * @author Bruno Farache
024     * @author Tina Tian
025     */
026    public class IndexWriterProxyBean extends BaseMultiDestinationProxyBean
027            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 deleteDocument(SearchContext searchContext, String uid) {
043                    throw new UnsupportedOperationException();
044            }
045    
046            @Override
047            public void deleteDocuments(
048                    SearchContext searchContext, Collection<String> uids) {
049    
050                    throw new UnsupportedOperationException();
051            }
052    
053            @Override
054            public void deletePortletDocuments(
055                    SearchContext searchContext, String portletId) {
056    
057                    throw new UnsupportedOperationException();
058            }
059    
060            @Override
061            public String getDestinationName(ProxyRequest proxyRequest) {
062                    Object[] arguments = proxyRequest.getArguments();
063    
064                    SearchContext searchContext = (SearchContext)arguments[0];
065    
066                    String searchEngineId = searchContext.getSearchEngineId();
067    
068                    return SearchEngineUtil.getSearchWriterDestinationName(searchEngineId);
069            }
070    
071            @Override
072            public void updateDocument(SearchContext searchContext, Document document) {
073                    throw new UnsupportedOperationException();
074            }
075    
076            @Override
077            public void updateDocuments(
078                    SearchContext searchContext, Collection<Document> documents) {
079    
080                    throw new UnsupportedOperationException();
081            }
082    
083    }