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