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 AccessManager
getAccessManager()
DataStore
getDataStore()
Returns the data store of this repository, ornull
if a data store is not configured.HierarchyManager
getHierarchyManager()
ItemManager
getItemManager()
SessionItemStateManager
getItemStateManager()
ItemValidator
getItemValidator()
Returns the item validator of this session.String
getJCRName(Name name)
Returns the qualified JCR name String for the givenName
object.String
getJCRPath(Path path)
Returns the given JCR path string for the given path object.NamespaceRegistry
getNamespaceRegistry()
Returns a namespace registry instance which asserts that the editing session is allowed to modify the namespace registry.NodeIdFactory
getNodeIdFactory()
NodeTypeManagerImpl
getNodeTypeManager()
Returns the node type manager of this session.NodeTypeRegistry
getNodeTypeRegistry()
Returns the node type registry of this repository.ObservationManagerImpl
getObservationManager()
PrivilegeManagerImpl
getPrivilegeManager()
Returns the privilege manager of this session.Name
getQName(String name)
Returns theName
for the given JCR name String.Path
getQPath(String path)
Returns the path object for the given JCR path string.Path
getQPath(String path, boolean normalizeIdentifier)
Returns the path object for the given JCR path string.RepositoryImpl
getRepository()
Returns this repository.RepositoryContext
getRepositoryContext()
Returns the repository context of the session.NodeId
getRootNodeId()
Returns the root node identifier of the repository.SessionImpl
getSessionImpl()
Returns this session.SessionState
getSessionState()
Returns the state of this session.ValueFactory
getValueFactory()
Returns the value factory of this session.WorkspaceImpl
getWorkspace()
Returns the workspace of this session.void
setAccessManager(AccessManager accessManager)
void
setItemManager(ItemManager itemManager)
void
setItemStateManager(SessionItemStateManager itemStateManager)
void
setObservationManager(ObservationManagerImpl observationManager)
String
toString()
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, ornull
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
-
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:NameResolver
Returns theName
for the given JCR name String.- Specified by:
getQName
in interfaceNameResolver
- Parameters:
name
- A JCR name String.- Returns:
- A
Name
object. - 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:NameResolver
Returns the qualified JCR name String for the givenName
object.- Specified by:
getJCRName
in interfaceNameResolver
- Parameters:
name
- AName
object.- Returns:
- The qualified JCR name String consisting of
prefix:localName
orlocalName
in 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:PathResolver
Returns the path object for the given JCR path string.- Specified by:
getQPath
in interfacePathResolver
- Parameters:
path
- prefixed JCR path- Returns:
- a
Path
object. - 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:PathResolver
Returns the path object for the given JCR path string.- Specified by:
getQPath
in interfacePathResolver
- Parameters:
path
- prefixed JCR path- Returns:
- a
Path
object. - 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:PathResolver
Returns the given JCR path string for the given path object.- Specified by:
getJCRPath
in interfacePathResolver
- Parameters:
path
- aPath
object.- Returns:
- a JCR path string
- Throws:
NamespaceException
- if a namespace URI can not be resolved
-
-