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.security.permission.PermissionChecker;
018    
019    import java.util.Locale;
020    
021    import javax.portlet.PortletURL;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     */
026    public class IndexerWrapper implements Indexer {
027    
028            public IndexerWrapper(Indexer indexer) {
029                    _indexer = indexer;
030            }
031    
032            @Override
033            public void delete(long companyId, String uid) throws SearchException {
034                    _indexer.delete(companyId, uid);
035            }
036    
037            @Override
038            public void delete(Object obj) throws SearchException {
039                    _indexer.delete(obj);
040            }
041    
042            @Override
043            public String[] getClassNames() {
044                    return _indexer.getClassNames();
045            }
046    
047            @Override
048            public Document getDocument(Object obj) throws SearchException {
049                    return _indexer.getDocument(obj);
050            }
051    
052            @Override
053            public BooleanQuery getFacetQuery(
054                            String className, SearchContext searchContext)
055                    throws Exception {
056    
057                    return _indexer.getFacetQuery(className, searchContext);
058            }
059    
060            @Override
061            public BooleanQuery getFullQuery(SearchContext searchContext)
062                    throws SearchException {
063    
064                    return _indexer.getFullQuery(searchContext);
065            }
066    
067            @Override
068            public IndexerPostProcessor[] getIndexerPostProcessors() {
069                    return _indexer.getIndexerPostProcessors();
070            }
071    
072            @Override
073            public String getPortletId() {
074                    return _indexer.getPortletId();
075            }
076    
077            @Override
078            public String getSearchEngineId() {
079                    return _indexer.getSearchEngineId();
080            }
081    
082            @Override
083            public String getSortField(String orderByCol) {
084                    return _indexer.getSortField(orderByCol);
085            }
086    
087            @Override
088            public Summary getSummary(
089                            Document document, Locale locale, String snippet,
090                            PortletURL portletURL)
091                    throws SearchException {
092    
093                    return _indexer.getSummary(document, locale, snippet, portletURL);
094            }
095    
096            @Override
097            public boolean hasPermission(
098                            PermissionChecker permissionChecker, long entryClassPK,
099                            String actionId)
100                    throws Exception {
101    
102                    return _indexer.hasPermission(
103                            permissionChecker, entryClassPK, actionId);
104            }
105    
106            @Override
107            public boolean isFilterSearch() {
108                    return _indexer.isFilterSearch();
109            }
110    
111            @Override
112            public boolean isPermissionAware() {
113                    return _indexer.isPermissionAware();
114            }
115    
116            @Override
117            public boolean isStagingAware() {
118                    return _indexer.isStagingAware();
119            }
120    
121            @Override
122            public void postProcessContextQuery(
123                            BooleanQuery contextQuery, SearchContext searchContext)
124                    throws Exception {
125    
126                    _indexer.postProcessContextQuery(contextQuery, searchContext);
127            }
128    
129            @Override
130            public void postProcessSearchQuery(
131                            BooleanQuery searchQuery, SearchContext searchContext)
132                    throws Exception {
133    
134                    _indexer.postProcessSearchQuery(searchQuery, searchContext);
135            }
136    
137            @Override
138            public void registerIndexerPostProcessor(
139                    IndexerPostProcessor indexerPostProcessor) {
140    
141                    _indexer.registerIndexerPostProcessor(indexerPostProcessor);
142            }
143    
144            @Override
145            public void reindex(Object obj) throws SearchException {
146                    _indexer.reindex(obj);
147            }
148    
149            @Override
150            public void reindex(String className, long classPK) throws SearchException {
151                    _indexer.reindex(className, classPK);
152            }
153    
154            @Override
155            public void reindex(String[] ids) throws SearchException {
156                    _indexer.reindex(ids);
157            }
158    
159            @Override
160            public Hits search(SearchContext searchContext) throws SearchException {
161                    return _indexer.search(searchContext);
162            }
163    
164            @Override
165            public void unregisterIndexerPostProcessor(
166                    IndexerPostProcessor indexerPostProcessor) {
167    
168                    _indexer.unregisterIndexerPostProcessor(indexerPostProcessor);
169            }
170    
171            private Indexer _indexer;
172    
173    }