public class SessionContext extends Object implements NamePathResolver
Constructor and Description |
---|
SessionContext(RepositoryContext repositoryContext,
SessionImpl session,
WorkspaceConfig workspaceConfig)
Creates a component context for the given session.
|
Modifier and Type | Method and Description |
---|---|
AccessManager |
getAccessManager() |
DataStore |
getDataStore()
Returns the data store of this repository, or
null
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 given
Name 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 the
Name 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.
|
public SessionContext(RepositoryContext repositoryContext, SessionImpl session, WorkspaceConfig workspaceConfig) throws RepositoryException
repositoryContext
- repository context of the sessionsession
- the sessionworkspaceConfig
- workspace configurationRepositoryException
- if the workspace can not be accessedpublic RepositoryContext getRepositoryContext()
public RepositoryImpl getRepository()
public NodeId getRootNodeId()
public DataStore getDataStore()
null
if a data store is not configured.null
public NodeTypeRegistry getNodeTypeRegistry()
public SessionImpl getSessionImpl()
public SessionState getSessionState()
public ValueFactory getValueFactory()
public ItemValidator getItemValidator()
public NodeTypeManagerImpl getNodeTypeManager()
public PrivilegeManagerImpl getPrivilegeManager()
public NamespaceRegistry getNamespaceRegistry()
public WorkspaceImpl getWorkspace()
public SessionItemStateManager getItemStateManager()
public void setItemStateManager(SessionItemStateManager itemStateManager)
public HierarchyManager getHierarchyManager()
public ItemManager getItemManager()
public void setItemManager(ItemManager itemManager)
public AccessManager getAccessManager()
public void setAccessManager(AccessManager accessManager)
public ObservationManagerImpl getObservationManager()
public void setObservationManager(ObservationManagerImpl observationManager)
public NodeIdFactory getNodeIdFactory()
public Name getQName(String name) throws IllegalNameException, NamespaceException
NameResolver
Name
for the given JCR name String.getQName
in interface NameResolver
name
- A JCR name String.Name
object.IllegalNameException
- if the JCR name format is invalidNamespaceException
- if the namespace prefix can not be resolvedpublic String getJCRName(Name name) throws NamespaceException
NameResolver
Name
object.getJCRName
in interface NameResolver
name
- A Name
object.prefix:localName
or
localName
in case of the empty namespace.NamespaceException
- if the namespace URI can not be resolvedpublic Path getQPath(String path) throws MalformedPathException, IllegalNameException, NamespaceException
PathResolver
getQPath
in interface PathResolver
path
- prefixed JCR pathPath
object.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.public Path getQPath(String path, boolean normalizeIdentifier) throws MalformedPathException, IllegalNameException, NamespaceException
PathResolver
getQPath
in interface PathResolver
path
- prefixed JCR pathPath
object.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.public String getJCRPath(Path path) throws NamespaceException
PathResolver
getJCRPath
in interface PathResolver
path
- a Path
object.NamespaceException
- if a namespace URI can not be resolvedCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.