001: /*
002: * Copyright 2004-2006 the original author or authors.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.compass.core.engine;
018:
019: import org.compass.core.ResourceFactory;
020: import org.compass.core.config.RuntimeCompassSettings;
021: import org.compass.core.engine.event.SearchEngineEventManager;
022: import org.compass.core.engine.naming.PropertyNamingStrategy;
023: import org.compass.core.engine.spellcheck.SearchEngineSpellCheckManager;
024: import org.compass.core.executor.ExecutorManager;
025: import org.compass.core.transaction.context.TransactionContext;
026:
027: /**
028: * A factory class that creates search engines and search engine optimizers.
029: *
030: * @author kimchy
031: */
032: public interface SearchEngineFactory {
033:
034: /**
035: * Opens/Creates a light weight search engine to perform search engine
036: * operations.
037: *
038: * @return A new search engine session.
039: */
040: SearchEngine openSearchEngine(RuntimeCompassSettings runtimeSettings);
041:
042: /**
043: * Returns a resource factory allowing to create resources and properties.
044: */
045: ResourceFactory getResourceFactory();
046:
047: /**
048: * Returns the index manager.
049: *
050: * @return the search engine index manager.
051: */
052: SearchEngineIndexManager getIndexManager();
053:
054: /**
055: * Returns the property naming strategy used by the search engine to create
056: * hidden properties.
057: *
058: * @return The property naming strategy used.
059: */
060: PropertyNamingStrategy getPropertyNamingStrategy();
061:
062: /**
063: * Returns the serach engine optimizer that was created by the factory.
064: *
065: * @return The search engine optimizer
066: */
067: SearchEngineOptimizer getOptimizer();
068:
069: /**
070: * Rerturns the specll checker manager (if enabled).
071: */
072: SearchEngineSpellCheckManager getSpellCheckManager();
073:
074: /**
075: */
076: SearchEngineEventManager getEventManager();
077:
078: /**
079: * Returns a transactional context that operations that (usually) operate on a different
080: * thread or outside of a transactional context should use.
081: */
082: TransactionContext getTransactionContext();
083:
084: /**
085: * Returns an executor manager allowing to execute tasks in an async manner as well as
086: * schedule tasks.
087: */
088: ExecutorManager getExecutorManager();
089:
090: /**
091: * Closes the factory.
092: *
093: * @throws SearchEngineException
094: */
095: void close() throws SearchEngineException;
096:
097: /**
098: * Returns the name of the alias property.
099: *
100: * @return The name of the alias property.
101: */
102: String getAliasProperty();
103:
104: /**
105: * Returns the name of the extending alias property name.
106: */
107: String getExtendedAliasProperty();
108:
109: /**
110: * Returns the name for the all property.
111: *
112: * @return The name of the all property.
113: */
114: String getAllProperty();
115: }
|