Class QueryHandlerContext


  • public class QueryHandlerContext
    extends Object
    Acts as an argument for the QueryHandler to keep the interface stable. This class provides access to the environment where the query handler is running in.
    • Constructor Detail

      • QueryHandlerContext

        public QueryHandlerContext​(String workspace,
                                   RepositoryContext repositoryContext,
                                   SharedItemStateManager stateMgr,
                                   PersistenceManager pm,
                                   NodeId rootId,
                                   QueryHandler parentHandler,
                                   NodeId excludedNodeId)
        Creates a new context instance.
        Parameters:
        workspace - the workspace name.
        repositoryContext - the repository context.
        stateMgr - provides persistent item states.
        pm - the underlying persistence manager.
        rootId - the id of the root node.
        parentHandler - the parent query handler or null it there is no parent handler.
        excludedNodeId - id of the node that should be excluded from indexing. Any descendant of that node is also excluded from indexing.
    • Method Detail

      • getItemStateManager

        public ItemStateManager getItemStateManager()
        Returns the persistent ItemStateManager of the workspace this QueryHandler is based on.
        Returns:
        the persistent ItemStateManager of the current workspace.
      • getHierarchyManager

        public HierarchyManager getHierarchyManager()
        Returns the hierarchy manager on top of the item state manager of this query handler context.
        Returns:
        the hierarchy manager.
      • getPersistenceManager

        public PersistenceManager getPersistenceManager()
        Returns:
        the underlying persistence manager.
      • getRootId

        public NodeId getRootId()
        Returns the id of the root node.
        Returns:
        the idof the root node.
      • getPropertyTypeRegistry

        public PropertyTypeRegistry getPropertyTypeRegistry()
        Returns the PropertyTypeRegistry for this repository.
        Returns:
        the PropertyTypeRegistry for this repository.
      • getNodeTypeRegistry

        public NodeTypeRegistry getNodeTypeRegistry()
        Returns the NodeTypeRegistry for this repository.
        Returns:
        the NodeTypeRegistry for this repository.
      • getNamespaceRegistry

        public NamespaceRegistryImpl getNamespaceRegistry()
        Returns the NamespaceRegistryImpl for this repository.
        Returns:
        the NamespaceRegistryImpl for this repository.
      • getParentHandler

        public QueryHandler getParentHandler()
        Returns the parent query handler.
        Returns:
        the parent query handler.
      • getExcludedNodeId

        public NodeId getExcludedNodeId()
        Returns the id of the node that should be excluded from indexing. Any descendant of this node is also excluded from indexing.
        Returns:
        the uuid of the excluded node.
      • destroy

        public void destroy()
        Destroys this context and releases resources.
      • getExecutor

        public ScheduledExecutorService getExecutor()
        Returns the background task executor.
        Returns:
        background task executor
      • getClusterNode

        public ClusterNode getClusterNode()
        Returns the cluster node instance of this repository, or null if clustering is not enabled.
        Returns:
        cluster node
      • getWorkspace

        public String getWorkspace()