org.apache.jackrabbit.core.session
Class SessionContext

java.lang.Object
  extended by 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
SessionContext(RepositoryContext repositoryContext, SessionImpl session, WorkspaceConfig workspaceConfig)
          Creates a component context for the given session.
 
Method Summary
 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.
 NodeTypeManagerImpl getNodeTypeManager()
          Returns the node type manager of this session.
 NodeTypeRegistry getNodeTypeRegistry()
          Returns the node type registry of this repository.
 ObservationManagerImpl getObservationManager()
           
 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.
 JackrabbitSecurityManager getSecurityManager()
          Returns the security manager of this 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 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

getSecurityManager

public JackrabbitSecurityManager getSecurityManager()
Returns the security manager of this repository.

Returns:
security manager

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

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)

getQName

public Name getQName(String name)
              throws IllegalNameException,
                     NamespaceException
Description copied from interface: NameResolver
Returns the Name for the given JCR name String.

Specified by:
getQName in interface NameResolver
Parameters:
name - A JCR name String.
Returns:
A Name object.
Throws:
IllegalNameException - if the JCR name format is invalid
NamespaceException - 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 given Name object.

Specified by:
getJCRName in interface NameResolver
Parameters:
name - A Name object.
Returns:
The qualified JCR name String consisting of prefix:localName or localName 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 interface PathResolver
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 interface PathResolver
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 interface PathResolver
Parameters:
path - a Path object.
Returns:
a JCR path string
Throws:
NamespaceException - if a namespace URI can not be resolved

toString

public String toString()
Dumps the session internals to a string.

Overrides:
toString in class Object
Returns:
string representation of session internals


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.