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            public void addRelatedEntryFields(Document document, Object obj)
034                    throws Exception {
035    
036                    _indexer.addRelatedEntryFields(document, obj);
037            }
038    
039            public void delete(long companyId, String uid) throws SearchException {
040                    _indexer.delete(companyId, uid);
041            }
042    
043            public void delete(Object obj) throws SearchException {
044                    _indexer.delete(obj);
045            }
046    
047            public String[] getClassNames() {
048                    return _indexer.getClassNames();
049            }
050    
051            public Document getDocument(Object obj) throws SearchException {
052                    return _indexer.getDocument(obj);
053            }
054    
055            public BooleanQuery getFacetQuery(
056                            String className, SearchContext searchContext)
057                    throws Exception {
058    
059                    return _indexer.getFacetQuery(className, searchContext);
060            }
061    
062            public BooleanQuery getFullQuery(SearchContext searchContext)
063                    throws SearchException {
064    
065                    return _indexer.getFullQuery(searchContext);
066            }
067    
068            public IndexerPostProcessor[] getIndexerPostProcessors() {
069                    return _indexer.getIndexerPostProcessors();
070            }
071    
072            public String getPortletId() {
073                    return _indexer.getPortletId();
074            }
075    
076            public String getSearchEngineId() {
077                    return _indexer.getSearchEngineId();
078            }
079    
080            public String getSortField(String orderByCol) {
081                    return _indexer.getSortField(orderByCol);
082            }
083    
084            public Summary getSummary(
085                            Document document, Locale locale, String snippet,
086                            PortletURL portletURL)
087                    throws SearchException {
088    
089                    return _indexer.getSummary(document, locale, snippet, portletURL);
090            }
091    
092            public boolean hasPermission(
093                            PermissionChecker permissionChecker, String entryClassName,
094                            long entryClassPK, String actionId)
095                    throws Exception {
096    
097                    return _indexer.hasPermission(
098                            permissionChecker, entryClassName, entryClassPK, actionId);
099            }
100    
101            public boolean isFilterSearch() {
102                    return _indexer.isFilterSearch();
103            }
104    
105            public boolean isPermissionAware() {
106                    return _indexer.isPermissionAware();
107            }
108    
109            public boolean isStagingAware() {
110                    return _indexer.isStagingAware();
111            }
112    
113            public void postProcessContextQuery(
114                            BooleanQuery contextQuery, SearchContext searchContext)
115                    throws Exception {
116    
117                    _indexer.postProcessContextQuery(contextQuery, searchContext);
118            }
119    
120            public void postProcessSearchQuery(
121                            BooleanQuery searchQuery, SearchContext searchContext)
122                    throws Exception {
123    
124                    _indexer.postProcessSearchQuery(searchQuery, searchContext);
125            }
126    
127            public void registerIndexerPostProcessor(
128                    IndexerPostProcessor indexerPostProcessor) {
129    
130                    _indexer.registerIndexerPostProcessor(indexerPostProcessor);
131            }
132    
133            public void reindex(Object obj) throws SearchException {
134                    _indexer.reindex(obj);
135            }
136    
137            public void reindex(String className, long classPK) throws SearchException {
138                    _indexer.reindex(className, classPK);
139            }
140    
141            public void reindex(String[] ids) throws SearchException {
142                    _indexer.reindex(ids);
143            }
144    
145            public void reindexDDMStructures(List<Long> ddmStructureIds)
146                    throws SearchException {
147    
148                    _indexer.reindexDDMStructures(ddmStructureIds);
149            }
150    
151            public Hits search(SearchContext searchContext) throws SearchException {
152                    return _indexer.search(searchContext);
153            }
154    
155            public void unregisterIndexerPostProcessor(
156                    IndexerPostProcessor indexerPostProcessor) {
157    
158                    _indexer.unregisterIndexerPostProcessor(indexerPostProcessor);
159            }
160    
161            private Indexer _indexer;
162    
163    }