org.apache.jackrabbit.core.query
Class AbstractQueryHandler

java.lang.Object
  extended by 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 of QueryHandler.


Constructor Summary
AbstractQueryHandler()
           
 
Method Summary
 ExecutablePreparedQuery createExecutablePreparedQuery(SessionImpl session, ItemManager itemMgr, QueryObjectModelTree qomTree)
          Creates a new query by specifying the query object model.

Throws UnsupportedOperationException.

protected abstract  void doInit()
          This method must be implemented by concrete sub classes and will be called from init(org.apache.jackrabbit.core.query.QueryHandlerContext).
 QueryHandlerContext getContext()
          Returns the context for this query handler.
 void init(QueryHandlerContext context)
          Initializes this query handler by setting all properties in this class with appropriate parameter values.
 void updateNodes(NodeIdIterator remove, NodeStateIterator add)
          This default implementation calls the individual QueryHandler.deleteNode(NodeId) and QueryHandler.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, close, createExecutableQuery, deleteNode
 

Constructor Detail

AbstractQueryHandler

public AbstractQueryHandler()
Method Detail

init

public final void init(QueryHandlerContext context)
                throws IOException
Initializes this query handler by setting all properties in this class with appropriate parameter values.

Specified by:
init in interface QueryHandler
Parameters:
context - the context for this query handler.
Throws:
IOException - if an error occurs during initialization.

doInit

protected abstract void doInit()
                        throws IOException
This method must be implemented by concrete sub classes and will be called from init(org.apache.jackrabbit.core.query.QueryHandlerContext).

Throws:
IOException

getContext

public QueryHandlerContext getContext()
Returns the context for this query handler.

Specified by:
getContext in interface QueryHandler
Returns:
the QueryHandlerContext instance for this QueryHandler.

updateNodes

public void updateNodes(NodeIdIterator remove,
                        NodeStateIterator add)
                 throws RepositoryException,
                        IOException
This default implementation calls the individual QueryHandler.deleteNode(NodeId) and QueryHandler.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 interface QueryHandler
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.

createExecutablePreparedQuery

public ExecutablePreparedQuery createExecutablePreparedQuery(SessionImpl session,
                                                             ItemManager itemMgr,
                                                             QueryObjectModelTree qomTree)
                                                      throws InvalidQueryException
Creates a new query by specifying the query object model. If the query object model is considered invalid for the implementing class, an InvalidQueryException is thrown.

Throws UnsupportedOperationException.

Specified by:
createExecutablePreparedQuery in interface QueryHandler
Parameters:
session - the session of the current user creating the query object.
itemMgr - the item manager of the current user.
qomTree - query query object model tree.
Returns:
A Query object.
Throws:
InvalidQueryException - if the query object model tree is invalid.


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.