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.kernel.cluster.Priority;
018    
019    /**
020     * @author Michael C. Han
021     */
022    public class SearchEngineProxyWrapper implements SearchEngine {
023    
024            public SearchEngineProxyWrapper(
025                    SearchEngine searchEngine, IndexSearcher indexSearcher,
026                    IndexWriter indexWriter) {
027    
028                    _indexSearcher = indexSearcher;
029                    _indexWriter = indexWriter;
030                    _searchEngine = searchEngine;
031            }
032    
033            public BooleanClauseFactory getBooleanClauseFactory() {
034                    return _searchEngine.getBooleanClauseFactory();
035            }
036    
037            public BooleanQueryFactory getBooleanQueryFactory() {
038                    return _searchEngine.getBooleanQueryFactory();
039            }
040    
041            public Priority getClusteredWritePriority() {
042                    return _searchEngine.getClusteredWritePriority();
043            }
044    
045            public IndexSearcher getIndexSearcher() {
046                    return _indexSearcher;
047            }
048    
049            public IndexWriter getIndexWriter() {
050                    return _indexWriter;
051            }
052    
053            public SearchEngine getSearchEngine() {
054                    return _searchEngine;
055            }
056    
057            public TermQueryFactory getTermQueryFactory() {
058                    return _searchEngine.getTermQueryFactory();
059            }
060    
061            public TermRangeQueryFactory getTermRangeQueryFactory() {
062                    return _searchEngine.getTermRangeQueryFactory();
063            }
064    
065            public String getVendor() {
066                    return _searchEngine.getVendor();
067            }
068    
069            public boolean isClusteredWrite() {
070                    return _searchEngine.isClusteredWrite();
071            }
072    
073            public boolean isLuceneBased() {
074                    return _searchEngine.isLuceneBased();
075            }
076    
077            private IndexSearcher _indexSearcher;
078            private IndexWriter _indexWriter;
079            private SearchEngine _searchEngine;
080    
081    }