Class SessionContext

  • All Implemented Interfaces:
    org.apache.jackrabbit.spi.commons.conversion.NamePathResolver, org.apache.jackrabbit.spi.commons.conversion.NameResolver, org.apache.jackrabbit.spi.commons.conversion.PathResolver

    public class SessionContext
    extends Object
    implements org.apache.jackrabbit.spi.commons.conversion.NamePathResolver
    Component context of a session. This class keeps track of the internal components associated with a session.
    • Constructor Detail

      • SessionContext

        public SessionContext​(RepositoryContext repositoryContext,
                              SessionImpl session,
                              WorkspaceConfig workspaceConfig)
                       throws RepositoryException
        Creates a component context for the given session.
        Parameters:
        repositoryContext - repository context of the session
        session - the session
        workspaceConfig - workspace configuration
        Throws:
        RepositoryException - if the workspace can not be accessed
    • Method Detail

      • getRepositoryContext

        public RepositoryContext getRepositoryContext()
        Returns the repository context of the session.
        Returns:
        repository context
      • getRepository

        public RepositoryImpl getRepository()
        Returns this repository.
        Returns:
        repository
      • getRootNodeId

        public NodeId getRootNodeId()
        Returns the root node identifier of the repository.
        Returns:
        root node identifier
      • getDataStore

        public org.apache.jackrabbit.core.data.DataStore getDataStore()
        Returns the data store of this repository, or null if a data store is not configured.
        Returns:
        data store, or null
      • getNodeTypeRegistry

        public NodeTypeRegistry getNodeTypeRegistry()
        Returns the node type registry of this repository.
        Returns:
        node type registry
      • getSessionImpl

        public SessionImpl getSessionImpl()
        Returns this session.
        Returns:
        session
      • getSessionState

        public SessionState getSessionState()
        Returns the state of this session.
        Returns:
        session state
      • getValueFactory

        public ValueFactory getValueFactory()
        Returns the value factory of this session.
        Returns:
        value factory
      • getItemValidator

        public ItemValidator getItemValidator()
        Returns the item validator of this session.
        Returns:
        item validator
      • getNodeTypeManager

        public NodeTypeManagerImpl getNodeTypeManager()
        Returns the node type manager of this session.
        Returns:
        node type manager
      • getPrivilegeManager

        public PrivilegeManagerImpl getPrivilegeManager()
        Returns the privilege manager of this session.
        Returns:
        the privilege manager.
      • getNamespaceRegistry

        public NamespaceRegistry getNamespaceRegistry()
        Returns a namespace registry instance which asserts that the editing session is allowed to modify the namespace registry.
        Returns:
      • getWorkspace

        public WorkspaceImpl getWorkspace()
        Returns the workspace of this session.
        Returns:
        workspace
      • setItemManager

        public void setItemManager​(ItemManager itemManager)
      • setAccessManager

        public void setAccessManager​(AccessManager accessManager)
      • getQName

        public org.apache.jackrabbit.spi.Name getQName​(String name)
                                                throws org.apache.jackrabbit.spi.commons.conversion.IllegalNameException,
                                                       NamespaceException
        Specified by:
        getQName in interface org.apache.jackrabbit.spi.commons.conversion.NameResolver
        Throws:
        org.apache.jackrabbit.spi.commons.conversion.IllegalNameException
        NamespaceException
      • getJCRName

        public String getJCRName​(org.apache.jackrabbit.spi.Name name)
                          throws NamespaceException
        Specified by:
        getJCRName in interface org.apache.jackrabbit.spi.commons.conversion.NameResolver
        Throws:
        NamespaceException
      • getQPath

        public org.apache.jackrabbit.spi.Path getQPath​(String path)
                                                throws org.apache.jackrabbit.spi.commons.conversion.MalformedPathException,
                                                       org.apache.jackrabbit.spi.commons.conversion.IllegalNameException,
                                                       NamespaceException
        Specified by:
        getQPath in interface org.apache.jackrabbit.spi.commons.conversion.PathResolver
        Throws:
        org.apache.jackrabbit.spi.commons.conversion.MalformedPathException
        org.apache.jackrabbit.spi.commons.conversion.IllegalNameException
        NamespaceException
      • getQPath

        public org.apache.jackrabbit.spi.Path getQPath​(String path,
                                                       boolean normalizeIdentifier)
                                                throws org.apache.jackrabbit.spi.commons.conversion.MalformedPathException,
                                                       org.apache.jackrabbit.spi.commons.conversion.IllegalNameException,
                                                       NamespaceException
        Specified by:
        getQPath in interface org.apache.jackrabbit.spi.commons.conversion.PathResolver
        Throws:
        org.apache.jackrabbit.spi.commons.conversion.MalformedPathException
        org.apache.jackrabbit.spi.commons.conversion.IllegalNameException
        NamespaceException
      • getJCRPath

        public String getJCRPath​(org.apache.jackrabbit.spi.Path path)
                          throws NamespaceException
        Specified by:
        getJCRPath in interface org.apache.jackrabbit.spi.commons.conversion.PathResolver
        Throws:
        NamespaceException
      • toString

        public String toString()
        Dumps the session internals to a string.
        Overrides:
        toString in class Object
        Returns:
        string representation of session internals