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