Class SessionContext
- java.lang.Object
-
- org.apache.jackrabbit.core.session.SessionContext
-
- All Implemented Interfaces:
NamePathResolver,NameResolver,PathResolver
public class SessionContext extends Object implements NamePathResolver
Component context of a session. This class keeps track of the internal components associated with a session.
-
-
Constructor Summary
Constructors Constructor Description SessionContext(RepositoryContext repositoryContext, SessionImpl session, WorkspaceConfig workspaceConfig)Creates a component context for the given session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessManagergetAccessManager()DataStoregetDataStore()Returns the data store of this repository, ornullif a data store is not configured.HierarchyManagergetHierarchyManager()ItemManagergetItemManager()SessionItemStateManagergetItemStateManager()ItemValidatorgetItemValidator()Returns the item validator of this session.StringgetJCRName(Name name)Returns the qualified JCR name String for the givenNameobject.StringgetJCRPath(Path path)Returns the given JCR path string for the given path object.NamespaceRegistrygetNamespaceRegistry()Returns a namespace registry instance which asserts that the editing session is allowed to modify the namespace registry.NodeIdFactorygetNodeIdFactory()NodeTypeManagerImplgetNodeTypeManager()Returns the node type manager of this session.NodeTypeRegistrygetNodeTypeRegistry()Returns the node type registry of this repository.ObservationManagerImplgetObservationManager()PrivilegeManagerImplgetPrivilegeManager()Returns the privilege manager of this session.NamegetQName(String name)Returns theNamefor the given JCR name String.PathgetQPath(String path)Returns the path object for the given JCR path string.PathgetQPath(String path, boolean normalizeIdentifier)Returns the path object for the given JCR path string.RepositoryImplgetRepository()Returns this repository.RepositoryContextgetRepositoryContext()Returns the repository context of the session.NodeIdgetRootNodeId()Returns the root node identifier of the repository.SessionImplgetSessionImpl()Returns this session.SessionStategetSessionState()Returns the state of this session.ValueFactorygetValueFactory()Returns the value factory of this session.WorkspaceImplgetWorkspace()Returns the workspace of this session.voidsetAccessManager(AccessManager accessManager)voidsetItemManager(ItemManager itemManager)voidsetItemStateManager(SessionItemStateManager itemStateManager)voidsetObservationManager(ObservationManagerImpl observationManager)StringtoString()Dumps the session internals to a string.
-
-
-
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 sessionsession- the sessionworkspaceConfig- 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 DataStore getDataStore()
Returns the data store of this repository, ornullif 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
-
getItemStateManager
public SessionItemStateManager getItemStateManager()
-
setItemStateManager
public void setItemStateManager(SessionItemStateManager itemStateManager)
-
getHierarchyManager
public HierarchyManager getHierarchyManager()
-
getItemManager
public ItemManager getItemManager()
-
setItemManager
public void setItemManager(ItemManager itemManager)
-
getAccessManager
public AccessManager getAccessManager()
-
setAccessManager
public void setAccessManager(AccessManager accessManager)
-
getObservationManager
public ObservationManagerImpl getObservationManager()
-
setObservationManager
public void setObservationManager(ObservationManagerImpl observationManager)
-
getNodeIdFactory
public NodeIdFactory getNodeIdFactory()
-
getQName
public Name getQName(String name) throws IllegalNameException, NamespaceException
Description copied from interface:NameResolverReturns theNamefor the given JCR name String.- Specified by:
getQNamein interfaceNameResolver- Parameters:
name- A JCR name String.- Returns:
- A
Nameobject. - Throws:
IllegalNameException- if the JCR name format is invalidNamespaceException- if the namespace prefix can not be resolved
-
getJCRName
public String getJCRName(Name name) throws NamespaceException
Description copied from interface:NameResolverReturns the qualified JCR name String for the givenNameobject.- Specified by:
getJCRNamein interfaceNameResolver- Parameters:
name- ANameobject.- Returns:
- The qualified JCR name String consisting of
prefix:localNameorlocalNamein case of the empty namespace. - Throws:
NamespaceException- if the namespace URI can not be resolved
-
getQPath
public Path getQPath(String path) throws MalformedPathException, IllegalNameException, NamespaceException
Description copied from interface:PathResolverReturns the path object for the given JCR path string.- Specified by:
getQPathin interfacePathResolver- Parameters:
path- prefixed JCR path- Returns:
- a
Pathobject. - Throws:
MalformedPathException- if the JCR path format is invalid.IllegalNameException- if any of the JCR names contained in the path are invalid.NamespaceException- if a namespace prefix can not be resolved.
-
getQPath
public Path getQPath(String path, boolean normalizeIdentifier) throws MalformedPathException, IllegalNameException, NamespaceException
Description copied from interface:PathResolverReturns the path object for the given JCR path string.- Specified by:
getQPathin interfacePathResolver- Parameters:
path- prefixed JCR path- Returns:
- a
Pathobject. - Throws:
MalformedPathException- if the JCR path format is invalid.IllegalNameException- if any of the JCR names contained in the path are invalid.NamespaceException- if a namespace prefix can not be resolved.
-
getJCRPath
public String getJCRPath(Path path) throws NamespaceException
Description copied from interface:PathResolverReturns the given JCR path string for the given path object.- Specified by:
getJCRPathin interfacePathResolver- Parameters:
path- aPathobject.- Returns:
- a JCR path string
- Throws:
NamespaceException- if a namespace URI can not be resolved
-
-