|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.search.AbstractSearchEngine<WorkspaceType,ProcessorType>
WorkspaceType
- the workspace typeProcessorType
- the processor type@ThreadSafe public abstract class AbstractSearchEngine<WorkspaceType extends SearchEngineWorkspace,ProcessorType extends SearchEngineProcessor>
A component that acts as a search engine for the content within a single RepositorySource
. This engine manages a set of
indexes and provides search functionality for each of the workspaces within the source, and provides various methods to
(re)index the content contained with source's workspaces and keep the indexes up-to-date via changes.
Nested Class Summary | |
---|---|
protected class |
AbstractSearchEngine.SearchWorkspaces
|
static interface |
AbstractSearchEngine.Workspaces<WorkspaceType extends SearchEngineWorkspace>
|
Field Summary | |
---|---|
static boolean |
DEFAULT_VERIFY_WORKSPACE_IN_SOURCE
|
Constructor Summary | |
---|---|
protected |
AbstractSearchEngine(String sourceName,
RepositoryConnectionFactory connectionFactory)
Create a new provider instance that can be used to manage the indexes for the workspaces in a single source. |
protected |
AbstractSearchEngine(String sourceName,
RepositoryConnectionFactory connectionFactory,
boolean verifyWorkspaceInSource)
Create a new provider instance that can be used to manage the indexes for the workspaces in a single source. |
Method Summary | |
---|---|
protected abstract ProcessorType |
createProcessor(ExecutionContext context,
AbstractSearchEngine.Workspaces<WorkspaceType> workspaces,
Observer observer,
boolean readOnly)
Create the SearchEngineProcessor implementation that can be used to operate against the
SearchEngineWorkspace instances. |
SearchEngineProcessor |
createProcessor(ExecutionContext context,
Observer observer,
boolean readOnly)
Create the SearchEngineProcessor implementation that can be used to operate against the
SearchEngineWorkspace instances. |
protected abstract WorkspaceType |
createWorkspace(ExecutionContext context,
String workspaceName)
Create the index(es) required for the named workspace. |
protected RepositoryConnectionFactory |
getConnectionFactory()
|
String |
getSourceName()
Get the name of the source that can be searched with an engine that uses this provider. |
protected Graph |
graph(ExecutionContext context)
Obtain a graph to the source for which this engine exists. |
boolean |
isVerifyWorkspaceInSource()
Determine whether the workspaces should be verified with the original source before creating indexes for them. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.modeshape.graph.search.SearchEngine |
---|
index, indexExists |
Field Detail |
---|
public static final boolean DEFAULT_VERIFY_WORKSPACE_IN_SOURCE
Constructor Detail |
---|
protected AbstractSearchEngine(String sourceName, RepositoryConnectionFactory connectionFactory)
sourceName
- the name of the source that can be searched; never nullconnectionFactory
- the connection factory; may be null if the engine can operate without connecting to the sourceprotected AbstractSearchEngine(String sourceName, RepositoryConnectionFactory connectionFactory, boolean verifyWorkspaceInSource)
sourceName
- the name of the source that can be searched; never nullconnectionFactory
- the connection factory; may be null if the engine can operate without connecting to the sourceverifyWorkspaceInSource
- true if the workspaces are to be verified by checking the original source
IllegalArgumentException
- if any of the parameters are nullMethod Detail |
---|
protected RepositoryConnectionFactory getConnectionFactory()
public String getSourceName()
getSourceName
in interface SearchEngine
SearchEngine.getSourceName()
public boolean isVerifyWorkspaceInSource()
protected Graph graph(ExecutionContext context)
context
- the context in which the graph operations should be performed; never null
RepositorySourceException
- if a connection to the source cannot be establishedprotected abstract WorkspaceType createWorkspace(ExecutionContext context, String workspaceName) throws SearchEngineException
context
- the context in which the operation is to be performed; may not be nullworkspaceName
- the name of the workspace; may not be null
SearchEngineException
- if there is a problem creating the workspace.protected abstract ProcessorType createProcessor(ExecutionContext context, AbstractSearchEngine.Workspaces<WorkspaceType> workspaces, Observer observer, boolean readOnly)
SearchEngineProcessor
implementation that can be used to operate against the
SearchEngineWorkspace
instances.
Note that the resulting processor must be closed
by the caller when completed.
context
- the context in which the processor is to be used; never nullworkspaces
- the set of existing search workspaces; never nullobserver
- the observer of any events created by the processor; may be nullreadOnly
- true if the processor will only be reading or searching, or false if the processor will be used to update
the workspaces
public SearchEngineProcessor createProcessor(ExecutionContext context, Observer observer, boolean readOnly)
SearchEngineProcessor
implementation that can be used to operate against the
SearchEngineWorkspace
instances.
Note that the resulting processor must be closed
by the caller when completed.
createProcessor
in interface SearchEngine
context
- the context in which the processor is to be used; never nullobserver
- the observer of any events created by the processor; may be nullreadOnly
- true if the processor will only be reading or searching, or false if the processor will be used to update
the workspaces
SearchEngine.createProcessor(org.modeshape.graph.ExecutionContext,
org.modeshape.graph.observe.Observer, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |