|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines an interface for the actual node indexing and query execution. The goal is to allow different implementations based on the persistent manager in use. Some persistent model might allow to execute a query in an optimized manner, e.g. database persistence.
Method Summary | |
void |
addNode(NodeState node)
Adds a Node to the search index. |
void |
close()
Closes this QueryHandler and frees resources attached
to this handler. |
ExecutableQuery |
createExecutableQuery(SessionImpl session,
ItemManager itemMgr,
String statement,
String language)
Creates a new query by specifying the query statement itself and the language in which the query is stated. |
void |
deleteNode(NodeId id)
Deletes the Node with id from the search index. |
QueryHandlerContext |
getContext()
Returns the query handler context that passed in init(QueryHandlerContext) . |
void |
init(QueryHandlerContext context)
Initializes this query handler. |
void |
updateNodes(NodeIdIterator remove,
NodeStateIterator add)
Updates the index in an atomic operation. |
Method Detail |
public void init(QueryHandlerContext context) throws IOException
QueryHandler
is instantiated.
context
- the context for this query handler.
IOException
- if an error occurs during initialization.public QueryHandlerContext getContext()
init(QueryHandlerContext)
.
public void addNode(NodeState node) throws RepositoryException, IOException
Node
to the search index.
node
- the NodeState to add.
RepositoryException
- if an error occurs while indexing the node.
IOException
- if an error occurs while adding the node to the index.public void deleteNode(NodeId id) throws IOException
id
from the search index.
id
- the id
of the node to delete.
IOException
- if an error occurs while deleting the node.public void updateNodes(NodeIdIterator remove, NodeStateIterator add) throws RepositoryException, IOException
remove
- Iterator of NodeIds
of nodes to deleteadd
- Iterator of NodeState
instance to add to the
index.
RepositoryException
- if an error occurs while indexing a node.
IOException
- if an error occurs while updating the index.public void close() throws IOException
QueryHandler
and frees resources attached
to this handler.
IOException
public ExecutableQuery createExecutableQuery(SessionImpl session, ItemManager itemMgr, String statement, String language) throws InvalidQueryException
language
must specify a query language
string from among those returned by QueryManager.getSupportedQueryLanguages(); if it is not
then an InvalidQueryException
is thrown.
session
- the session of the current user creating the query object.itemMgr
- the item manager of the current user.statement
- the query statement.language
- the syntax of the query statement.
Query
object.
InvalidQueryException
- if statement is invalid or language is unsupported.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |