001    /**
002     * Copyright (c) 2000-present 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    /**
018     * @author Michael C. Han
019     */
020    public class SearchEngineProxyWrapper implements SearchEngine {
021    
022            public SearchEngineProxyWrapper(
023                    SearchEngine searchEngine, IndexSearcher indexSearcher,
024                    IndexWriter indexWriter) {
025    
026                    _searchEngine = searchEngine;
027                    _indexSearcher = indexSearcher;
028                    _indexWriter = indexWriter;
029            }
030    
031            @Override
032            public String backup(long companyId, String backupName)
033                    throws SearchException {
034    
035                    return _searchEngine.backup(companyId, backupName);
036            }
037    
038            /**
039             * @deprecated As of 7.0.0
040             */
041            @Deprecated
042            @Override
043            public BooleanClauseFactory getBooleanClauseFactory() {
044                    return _searchEngine.getBooleanClauseFactory();
045            }
046    
047            /**
048             * @deprecated As of 7.0.0
049             */
050            @Deprecated
051            @Override
052            public BooleanQueryFactory getBooleanQueryFactory() {
053                    return _searchEngine.getBooleanQueryFactory();
054            }
055    
056            @Override
057            public IndexSearcher getIndexSearcher() {
058                    return _indexSearcher;
059            }
060    
061            @Override
062            public IndexWriter getIndexWriter() {
063                    return _indexWriter;
064            }
065    
066            public SearchEngine getSearchEngine() {
067                    return _searchEngine;
068            }
069    
070            /**
071             * @deprecated As of 7.0.0
072             */
073            @Deprecated
074            @Override
075            public TermQueryFactory getTermQueryFactory() {
076                    return _searchEngine.getTermQueryFactory();
077            }
078    
079            /**
080             * @deprecated As of 7.0.0
081             */
082            @Deprecated
083            @Override
084            public TermRangeQueryFactory getTermRangeQueryFactory() {
085                    return _searchEngine.getTermRangeQueryFactory();
086            }
087    
088            @Override
089            public String getVendor() {
090                    return _searchEngine.getVendor();
091            }
092    
093            @Override
094            public void initialize(long companyId) {
095                    _searchEngine.initialize(companyId);
096            }
097    
098            @Override
099            public void removeBackup(long companyId, String backupName)
100                    throws SearchException {
101    
102                    _searchEngine.removeBackup(companyId, backupName);
103            }
104    
105            @Override
106            public void removeCompany(long companyId) {
107                    _searchEngine.removeCompany(companyId);
108            }
109    
110            @Override
111            public void restore(long companyId, String backupName)
112                    throws SearchException {
113    
114                    _searchEngine.restore(companyId, backupName);
115            }
116    
117            private final IndexSearcher _indexSearcher;
118            private final IndexWriter _indexWriter;
119            private final SearchEngine _searchEngine;
120    
121    }