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.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 Priority getClusteredWritePriority() {
034                    return _searchEngine.getClusteredWritePriority();
035            }
036    
037            public IndexSearcher getIndexSearcher() {
038                    return _indexSearcher;
039            }
040    
041            public IndexWriter getIndexWriter() {
042                    return _indexWriter;
043            }
044    
045            public String getName() {
046                    return _searchEngine.getName();
047            }
048    
049            public SearchEngine getSearchEngine() {
050                    return _searchEngine;
051            }
052    
053            public String getVendor() {
054                    return _searchEngine.getVendor();
055            }
056    
057            public boolean isClusteredWrite() {
058                    return _searchEngine.isClusteredWrite();
059            }
060    
061            public boolean isLuceneBased() {
062                    return _searchEngine.isLuceneBased();
063            }
064    
065            private IndexSearcher _indexSearcher;
066            private IndexWriter _indexWriter;
067            private SearchEngine _searchEngine;
068    
069    }