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.security.permission.PermissionChecker;
018    
019    import java.util.List;
020    import java.util.Locale;
021    
022    import javax.portlet.PortletRequest;
023    import javax.portlet.PortletResponse;
024    import javax.portlet.PortletURL;
025    
026    /**
027     * @author Brian Wing Shun Chan
028     */
029    public class IndexerWrapper implements Indexer {
030    
031            public IndexerWrapper(Indexer indexer) {
032                    _indexer = indexer;
033            }
034    
035            @Override
036            public void addRelatedEntryFields(Document document, Object obj)
037                    throws Exception {
038    
039                    _indexer.addRelatedEntryFields(document, obj);
040            }
041    
042            @Override
043            public void delete(long companyId, String uid) throws SearchException {
044                    _indexer.delete(companyId, uid);
045            }
046    
047            @Override
048            public void delete(Object obj) throws SearchException {
049                    _indexer.delete(obj);
050            }
051    
052            @Override
053            public String[] getClassNames() {
054                    return _indexer.getClassNames();
055            }
056    
057            @Override
058            public Document getDocument(Object obj) throws SearchException {
059                    return _indexer.getDocument(obj);
060            }
061    
062            @Override
063            public BooleanQuery getFacetQuery(
064                            String className, SearchContext searchContext)
065                    throws Exception {
066    
067                    return _indexer.getFacetQuery(className, searchContext);
068            }
069    
070            @Override
071            public BooleanQuery getFullQuery(SearchContext searchContext)
072                    throws SearchException {
073    
074                    return _indexer.getFullQuery(searchContext);
075            }
076    
077            @Override
078            public IndexerPostProcessor[] getIndexerPostProcessors() {
079                    return _indexer.getIndexerPostProcessors();
080            }
081    
082            @Override
083            public String getPortletId() {
084                    return _indexer.getPortletId();
085            }
086    
087            @Override
088            public String getSearchEngineId() {
089                    return _indexer.getSearchEngineId();
090            }
091    
092            @Override
093            public String getSortField(String orderByCol) {
094                    return _indexer.getSortField(orderByCol);
095            }
096    
097            @Override
098            public String getSortField(String orderByCol, int sortType) {
099                    return _indexer.getSortField(orderByCol, sortType);
100            }
101    
102            /**
103             * @deprecated As of 7.0.0, replaced by {@link #getSummary(Document, Locale,
104             *             String, PortletURL, PortletRequest, PortletResponse)}
105             */
106            @Deprecated
107            @Override
108            public Summary getSummary(
109                            Document document, Locale locale, String snippet,
110                            PortletURL portletURL)
111                    throws SearchException {
112    
113                    return _indexer.getSummary(document, locale, snippet, portletURL);
114            }
115    
116            @Override
117            public Summary getSummary(
118                            Document document, Locale locale, String snippet,
119                            PortletURL portletURL, PortletRequest portletRequest,
120                            PortletResponse portletResponse)
121                    throws SearchException {
122    
123                    return _indexer.getSummary(
124                            document, locale, snippet, portletURL, portletRequest,
125                            portletResponse);
126            }
127    
128            @Override
129            public boolean hasPermission(
130                            PermissionChecker permissionChecker, String entryClassName,
131                            long entryClassPK, String actionId)
132                    throws Exception {
133    
134                    return _indexer.hasPermission(
135                            permissionChecker, entryClassName, entryClassPK, actionId);
136            }
137    
138            @Override
139            public boolean isFilterSearch() {
140                    return _indexer.isFilterSearch();
141            }
142    
143            @Override
144            public boolean isPermissionAware() {
145                    return _indexer.isPermissionAware();
146            }
147    
148            @Override
149            public boolean isStagingAware() {
150                    return _indexer.isStagingAware();
151            }
152    
153            @Override
154            public boolean isVisible(long classPK, int status) throws Exception {
155                    return _indexer.isVisible(classPK, status);
156            }
157    
158            @Override
159            public boolean isVisibleRelatedEntry(long classPK, int status)
160                    throws Exception {
161    
162                    return _indexer.isVisibleRelatedEntry(classPK, status);
163            }
164    
165            @Override
166            public void postProcessContextQuery(
167                            BooleanQuery contextQuery, SearchContext searchContext)
168                    throws Exception {
169    
170                    _indexer.postProcessContextQuery(contextQuery, searchContext);
171            }
172    
173            @Override
174            public void postProcessSearchQuery(
175                            BooleanQuery searchQuery, SearchContext searchContext)
176                    throws Exception {
177    
178                    _indexer.postProcessSearchQuery(searchQuery, searchContext);
179            }
180    
181            @Override
182            public void registerIndexerPostProcessor(
183                    IndexerPostProcessor indexerPostProcessor) {
184    
185                    _indexer.registerIndexerPostProcessor(indexerPostProcessor);
186            }
187    
188            @Override
189            public void reindex(Object obj) throws SearchException {
190                    _indexer.reindex(obj);
191            }
192    
193            @Override
194            public void reindex(String className, long classPK) throws SearchException {
195                    _indexer.reindex(className, classPK);
196            }
197    
198            @Override
199            public void reindex(String[] ids) throws SearchException {
200                    _indexer.reindex(ids);
201            }
202    
203            @Override
204            public void reindexDDMStructures(List<Long> ddmStructureIds)
205                    throws SearchException {
206    
207                    _indexer.reindexDDMStructures(ddmStructureIds);
208            }
209    
210            @Override
211            public Hits search(SearchContext searchContext) throws SearchException {
212                    return _indexer.search(searchContext);
213            }
214    
215            @Override
216            public void unregisterIndexerPostProcessor(
217                    IndexerPostProcessor indexerPostProcessor) {
218    
219                    _indexer.unregisterIndexerPostProcessor(indexerPostProcessor);
220            }
221    
222            private Indexer _indexer;
223    
224    }