Package org.apache.jackrabbit.core.query
Class AbstractQueryHandler
- java.lang.Object
-
- org.apache.jackrabbit.core.query.AbstractQueryHandler
-
- All Implemented Interfaces:
QueryHandler
- Direct Known Subclasses:
SearchIndex
public abstract class AbstractQueryHandler extends Object implements QueryHandler
Implements default behaviour for some methods ofQueryHandler
.
-
-
Field Summary
Fields Modifier and Type Field Description protected FileSystem
fs
Search index file system, ornull
-
Constructor Summary
Constructors Constructor Description AbstractQueryHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Closes thisQueryHandler
and frees resources attached to this handler.protected abstract void
doInit()
This method must be implemented by concrete sub classes and will be called frominit(org.apache.jackrabbit.core.fs.FileSystem, org.apache.jackrabbit.core.query.QueryHandlerContext)
.QueryHandlerContext
getContext()
Returns the context for this query handler.String
getIdleTime()
String
getOnWorkspaceInconsistency()
OnWorkspaceInconsistency
getOnWorkspaceInconsistencyHandler()
String
getQueryClass()
void
init(FileSystem fs, QueryHandlerContext context)
Initializes this query handler by setting all properties in this class with appropriate parameter values.void
setIdleTime(String idleTime)
Deprecated.This parameter is not supported any more.void
setOnWorkspaceInconsistency(String name)
Sets theOnWorkspaceInconsistency
handler with the given name.void
setQueryClass(String queryClass)
Sets the name of the query class to use.void
updateNodes(Iterator<NodeId> remove, Iterator<NodeState> add)
This default implementation calls the individualQueryHandler.deleteNode(org.apache.jackrabbit.core.NodeId)
andQueryHandler.addNode(org.apache.jackrabbit.core.state.NodeState)
methods for each entry in the iterators.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.core.query.QueryHandler
addNode, createExecutableQuery, deleteNode, getWeaklyReferringNodes
-
-
-
-
Field Detail
-
fs
protected FileSystem fs
Search index file system, ornull
-
-
Method Detail
-
init
public final void init(FileSystem fs, QueryHandlerContext context) throws IOException
Initializes this query handler by setting all properties in this class with appropriate parameter values.- Specified by:
init
in interfaceQueryHandler
- Parameters:
fs
- search index file system, ornull
context
- the context for this query handler.- Throws:
IOException
- if an error occurs during initialization.
-
close
public void close() throws IOException
Description copied from interface:QueryHandler
Closes thisQueryHandler
and frees resources attached to this handler.- Specified by:
close
in interfaceQueryHandler
- Throws:
IOException
-
doInit
protected abstract void doInit() throws IOException
This method must be implemented by concrete sub classes and will be called frominit(org.apache.jackrabbit.core.fs.FileSystem, org.apache.jackrabbit.core.query.QueryHandlerContext)
.- Throws:
IOException
- If an error occurs.
-
getContext
public QueryHandlerContext getContext()
Returns the context for this query handler.- Specified by:
getContext
in interfaceQueryHandler
- Returns:
- the
QueryHandlerContext
instance for thisQueryHandler
.
-
updateNodes
public void updateNodes(Iterator<NodeId> remove, Iterator<NodeState> add) throws RepositoryException, IOException
This default implementation calls the individualQueryHandler.deleteNode(org.apache.jackrabbit.core.NodeId)
andQueryHandler.addNode(org.apache.jackrabbit.core.state.NodeState)
methods for each entry in the iterators. First the nodes to remove are processed then the nodes to add.- Specified by:
updateNodes
in interfaceQueryHandler
- Parameters:
remove
- uuids of nodes to remove.add
- NodeStates to add.- Throws:
RepositoryException
- if an error occurs while indexing a node.IOException
- if an error occurs while updating the index.
-
getOnWorkspaceInconsistencyHandler
public OnWorkspaceInconsistency getOnWorkspaceInconsistencyHandler()
- Returns:
- the
OnWorkspaceInconsistency
handler.
-
setOnWorkspaceInconsistency
public void setOnWorkspaceInconsistency(String name)
Sets theOnWorkspaceInconsistency
handler with the given name. Currently the valid names are:fail
log
- Parameters:
name
- the name of aOnWorkspaceInconsistency
handler.
-
getOnWorkspaceInconsistency
public String getOnWorkspaceInconsistency()
- Returns:
- the name of the currently set
OnWorkspaceInconsistency
.
-
setQueryClass
public void setQueryClass(String queryClass)
Sets the name of the query class to use.- Parameters:
queryClass
- the name of the query class to use.
-
getQueryClass
public String getQueryClass()
- Specified by:
getQueryClass
in interfaceQueryHandler
- Returns:
- the name of the query class to use.
-
setIdleTime
public void setIdleTime(String idleTime)
Deprecated.This parameter is not supported any more. Please use 'maxIdleTime' in the repository configuration.Sets the query handler idle time.- Parameters:
idleTime
- the query handler idle time.
-
getIdleTime
public String getIdleTime()
- Returns:
- the query handler idle time.
-
-