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 void postProcessContextQuery(
136                            BooleanQuery contextQuery, SearchContext searchContext)
137                    throws Exception {
138    
139                    _indexer.postProcessContextQuery(contextQuery, searchContext);
140            }
141    
142            @Override
143            public void postProcessSearchQuery(
144                            BooleanQuery searchQuery, SearchContext searchContext)
145                    throws Exception {
146    
147                    _indexer.postProcessSearchQuery(searchQuery, searchContext);
148            }
149    
150            @Override
151            public void registerIndexerPostProcessor(
152                    IndexerPostProcessor indexerPostProcessor) {
153    
154                    _indexer.registerIndexerPostProcessor(indexerPostProcessor);
155            }
156    
157            @Override
158            public void reindex(Object obj) throws SearchException {
159                    _indexer.reindex(obj);
160            }
161    
162            @Override
163            public void reindex(String className, long classPK) throws SearchException {
164                    _indexer.reindex(className, classPK);
165            }
166    
167            @Override
168            public void reindex(String[] ids) throws SearchException {
169                    _indexer.reindex(ids);
170            }
171    
172            @Override
173            public void reindexDDMStructures(List<Long> ddmStructureIds)
174                    throws SearchException {
175    
176                    _indexer.reindexDDMStructures(ddmStructureIds);
177            }
178    
179            @Override
180            public Hits search(SearchContext searchContext) throws SearchException {
181                    return _indexer.search(searchContext);
182            }
183    
184            @Override
185            public void unregisterIndexerPostProcessor(
186                    IndexerPostProcessor indexerPostProcessor) {
187    
188                    _indexer.unregisterIndexerPostProcessor(indexerPostProcessor);
189            }
190    
191            private Indexer _indexer;
192    
193    }