org.jboss.dna.graph.search
Class AbstractSearchEngine<WorkspaceType extends SearchEngineWorkspace,ProcessorType extends SearchEngineProcessor>

java.lang.Object
  extended by org.jboss.dna.graph.search.AbstractSearchEngine<WorkspaceType,ProcessorType>
Type Parameters:
WorkspaceType - the workspace type
ProcessorType - the processor type
All Implemented Interfaces:
SearchEngine
Direct Known Subclasses:
AbstractLuceneSearchEngine

@ThreadSafe
public abstract class AbstractSearchEngine<WorkspaceType extends SearchEngineWorkspace,ProcessorType extends SearchEngineProcessor>
extends Object
implements SearchEngine

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
static interface AbstractSearchEngine.Workspaces<WorkspaceType extends SearchEngineWorkspace>
           
 
Field Summary
static boolean DEFAULT_VERIFY_WORKSPACE_IN_SOURCE
           
 
Method Summary
 SearchEngineProcessor createProcessor(ExecutionContext context, Observer observer, boolean readOnly)
          Create the SearchEngineProcessor implementation that can be used to operate against the SearchEngineWorkspace instances.
 String getSourceName()
          Get the name of the source that can be searched with an engine that uses this provider.
 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.dna.graph.search.SearchEngine
index
 

Field Detail

DEFAULT_VERIFY_WORKSPACE_IN_SOURCE

public static final boolean DEFAULT_VERIFY_WORKSPACE_IN_SOURCE
See Also:
Constant Field Values
Method Detail

getSourceName

public String getSourceName()
Get the name of the source that can be searched with an engine that uses this provider.

Specified by:
getSourceName in interface SearchEngine
Returns:
the name of the source that is to be searchable; never null
See Also:
SearchEngine.getSourceName()

isVerifyWorkspaceInSource

public boolean isVerifyWorkspaceInSource()
Determine whether the workspaces should be verified with the original source before creating indexes for them.

Returns:
true if verification should be performed, or false otherwise

createProcessor

public SearchEngineProcessor createProcessor(ExecutionContext context,
                                             Observer observer,
                                             boolean readOnly)
Create the 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.

Specified by:
createProcessor in interface SearchEngine
Parameters:
context - the context in which the processor is to be used; never null
observer - the observer of any events created by the processor; may be null
readOnly - true if the processor will only be reading or searching, or false if the processor will be used to update the workspaces
Returns:
the processor; may not be null
See Also:
SearchEngine.createProcessor(org.jboss.dna.graph.ExecutionContext, org.jboss.dna.graph.observe.Observer, boolean)


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.