public interface QueryHandler
Modifier and Type | Method and Description |
---|---|
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(SessionContext sessionContext,
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(FileSystem, QueryHandlerContext) . |
String |
getQueryClass() |
Iterable<NodeId> |
getWeaklyReferringNodes(NodeId id)
Returns the ids of the nodes that refer to the node with
id
by weak references. |
void |
init(FileSystem fs,
QueryHandlerContext context)
Initializes this query handler.
|
void |
updateNodes(Iterator<NodeId> remove,
Iterator<NodeState> add)
Updates the index in an atomic operation.
|
void init(FileSystem fs, QueryHandlerContext context) throws IOException
QueryHandler
is instantiated.
If a file system has been configured (i.e. the fs argument is not
null
), then the query handler is expected to close
the given file system when the close()
method is called.
fs
- the configured search index file system, or null
context
- the context for this query handler.IOException
- if an error occurs during initialization.QueryHandlerContext getContext()
init(FileSystem, QueryHandlerContext)
.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.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.void updateNodes(Iterator<NodeId> remove, Iterator<NodeState> 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.void close() throws IOException
QueryHandler
and frees resources attached
to this handler.IOException
ExecutableQuery createExecutableQuery(SessionContext sessionContext, 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.sessionContext
- component context of the current sessionstatement
- the query statement.language
- the syntax of the query statement.Query
object.InvalidQueryException
- if statement is invalid or language is unsupported.String getQueryClass()
Iterable<NodeId> getWeaklyReferringNodes(NodeId id) throws RepositoryException, IOException
id
by weak references.id
- the id of the target node.RepositoryException
- if an error occurs.IOException
- if an error occurs while reading from the
index.Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.