org.apache.jackrabbit.core
Class SearchManager

java.lang.Object
  extended byorg.apache.jackrabbit.core.SearchManager
All Implemented Interfaces:
EventListener, SynchronousEventListener

public class SearchManager
extends Object
implements SynchronousEventListener

Acts as a global entry point to execute queries and index nodes.


Field Summary
static String NS_FN_URI
           
static String NS_XS_URI
           
 
Constructor Summary
SearchManager(SessionImpl session, SearchConfig config, NodeTypeRegistry ntReg, ItemStateManager itemMgr)
          Creates a new SearchManager.
 
Method Summary
 void close()
          Closes this SearchManager and also closes the FileSystem configured in SearchConfig.
 Query createQuery(SessionImpl session, ItemManager itemMgr, Node node)
          Creates a query object from a node that can be executed on the workspace.
 Query createQuery(SessionImpl session, ItemManager itemMgr, String statement, String language)
          Creates a query object that can be executed on the workspace.
 void onEvent(EventIterator events)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NS_FN_URI

public static final String NS_FN_URI
See Also:
Constant Field Values

NS_XS_URI

public static final String NS_XS_URI
See Also:
Constant Field Values
Constructor Detail

SearchManager

public SearchManager(SessionImpl session,
                     SearchConfig config,
                     NodeTypeRegistry ntReg,
                     ItemStateManager itemMgr)
              throws RepositoryException
Creates a new SearchManager.

Parameters:
session - the system session.
config - the search configuration.
ntReg - the node type registry.
itemMgr - the shared item state manager.
Throws:
RepositoryException
Method Detail

close

public void close()
Closes this SearchManager and also closes the FileSystem configured in SearchConfig.


createQuery

public Query createQuery(SessionImpl session,
                         ItemManager itemMgr,
                         String statement,
                         String language)
                  throws InvalidQueryException,
                         RepositoryException
Creates a query object that can be executed on the workspace.

Parameters:
session - the session of the user executing the query.
itemMgr - the item manager of the user executing the query. Needed to return Node instances in the result set.
statement - the actual query statement.
language - the syntax of the query statement.
Returns:
a Query instance to execute.
Throws:
InvalidQueryException - if the query is malformed or the language is unknown.
RepositoryException - if any other error occurs.

createQuery

public Query createQuery(SessionImpl session,
                         ItemManager itemMgr,
                         Node node)
                  throws InvalidQueryException,
                         RepositoryException
Creates a query object from a node that can be executed on the workspace.

Parameters:
session - the session of the user executing the query.
itemMgr - the item manager of the user executing the query. Needed to return Node instances in the result set.
node - a node of type nt:query.
Returns:
a Query instance to execute.
Throws:
InvalidQueryException - if absPath is not a valid persisted query (that is, a node of type nt:query)
RepositoryException - if any other error occurs.

onEvent

public void onEvent(EventIterator events)
Specified by:
onEvent in interface EventListener


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