org.apache.jackrabbit.oak.jcr.session
Class SessionContext

java.lang.Object
  extended by org.apache.jackrabbit.oak.jcr.session.SessionContext
All Implemented Interfaces:
org.apache.jackrabbit.oak.namepath.NameMapper, org.apache.jackrabbit.oak.namepath.NamePathMapper, org.apache.jackrabbit.oak.namepath.PathMapper

public class SessionContext
extends Object
implements org.apache.jackrabbit.oak.namepath.NamePathMapper

Instances of this class are passed to all JCR implementation classes (e.g. SessionImpl, NodeImpl, etc.) and provide access to the session scoped instances generally needed (e.g. NamePathMapper, ValueFactory, etc.).


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.namepath.NamePathMapper
org.apache.jackrabbit.oak.namepath.NamePathMapper.Default
 
Field Summary
 
Fields inherited from interface org.apache.jackrabbit.oak.namepath.NamePathMapper
DEFAULT
 
Constructor Summary
SessionContext(javax.jcr.Repository repository, org.apache.jackrabbit.oak.stats.StatisticManager statisticManager, org.apache.jackrabbit.oak.spi.security.SecurityProvider securityProvider, org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard, Map<String,Object> attributes, SessionDelegate delegate, int observationQueueLength, org.apache.jackrabbit.oak.plugins.observation.CommitRateLimiter commitRateLimiter)
           
 
Method Summary
protected  SessionImpl createSession()
          Factory method for creating the Session instance for this context.
protected  WorkspaceImpl createWorkspace()
          Factory method for creating the Workspace instance for this context.
 javax.jcr.security.AccessControlManager getAccessControlManager()
           
 AccessManager getAccessManager()
           
 Map<String,Object> getAttributes()
           
 AtomicLong getCounter(org.apache.jackrabbit.api.stats.RepositoryStatistics.Type type)
           
 String getJcrName(String oakName)
           
 String getJcrPath(String oakPath)
           
 String getOakName(String jcrName)
           
 String getOakNameOrNull(String jcrName)
           
 String getOakPath(String jcrPath)
           
 String getOakPathKeepIndex(String jcrPath)
           
 String getOakPathOrThrow(String jcrPath)
          Returns the Oak path for the given JCR path, or throws a RepositoryException if the path can not be mapped.
 String getOakPathOrThrowNotFound(String jcrPath)
          Returns the Oak path for the given JCR path, or throws a PathNotFoundException if the path can not be mapped.
 javax.jcr.observation.ObservationManager getObservationManager()
           
 Set<String> getOpenScopedLocks()
           
 org.apache.jackrabbit.api.security.principal.PrincipalManager getPrincipalManager()
           
 org.apache.jackrabbit.api.security.authorization.PrivilegeManager getPrivilegeManager()
           
 List<org.apache.jackrabbit.oak.spi.xml.ProtectedItemImporter> getProtectedItemImporters()
           
 javax.jcr.Repository getRepository()
           
 org.apache.jackrabbit.oak.spi.security.SecurityProvider getSecurityProvider()
           
 SessionImpl getSession()
           
 SessionDelegate getSessionDelegate()
           
 Map<String,String> getSessionLocalMappings()
           
 Set<String> getSessionScopedLocks()
           
 org.apache.jackrabbit.oak.stats.StatisticManager getStatisticManager()
           
 org.apache.jackrabbit.api.security.user.UserManager getUserManager()
           
 javax.jcr.ValueFactory getValueFactory()
           
 WorkspaceImpl getWorkspace()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionContext

public SessionContext(@Nonnull
                      javax.jcr.Repository repository,
                      @Nonnull
                      org.apache.jackrabbit.oak.stats.StatisticManager statisticManager,
                      @Nonnull
                      org.apache.jackrabbit.oak.spi.security.SecurityProvider securityProvider,
                      @Nonnull
                      org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard,
                      @Nonnull
                      Map<String,Object> attributes,
                      @Nonnull
                      SessionDelegate delegate,
                      int observationQueueLength,
                      org.apache.jackrabbit.oak.plugins.observation.CommitRateLimiter commitRateLimiter)
Method Detail

getAttributes

public final Map<String,Object> getAttributes()

getSession

public final SessionImpl getSession()

getWorkspace

public final WorkspaceImpl getWorkspace()

createSession

protected SessionImpl createSession()
Factory method for creating the Session instance for this context. Called by getSession() when first accessed. Can be overridden by subclasses to customize the session implementation.

Returns:
session instance

createWorkspace

protected WorkspaceImpl createWorkspace()
Factory method for creating the Workspace instance for this context. Called by getWorkspace() when first accessed. Can be overridden by subclasses to customize the workspace implementation.

Returns:
session instance

getStatisticManager

@Nonnull
public org.apache.jackrabbit.oak.stats.StatisticManager getStatisticManager()

getCounter

@Nonnull
public AtomicLong getCounter(org.apache.jackrabbit.api.stats.RepositoryStatistics.Type type)

getRepository

@Nonnull
public javax.jcr.Repository getRepository()

getSessionDelegate

@Nonnull
public SessionDelegate getSessionDelegate()

getSessionLocalMappings

@Nonnull
public Map<String,String> getSessionLocalMappings()
Specified by:
getSessionLocalMappings in interface org.apache.jackrabbit.oak.namepath.NameMapper

getValueFactory

public javax.jcr.ValueFactory getValueFactory()

getAccessControlManager

@Nonnull
public javax.jcr.security.AccessControlManager getAccessControlManager()
                                                                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getPrincipalManager

@Nonnull
public org.apache.jackrabbit.api.security.principal.PrincipalManager getPrincipalManager()

getUserManager

@Nonnull
public org.apache.jackrabbit.api.security.user.UserManager getUserManager()

getPrivilegeManager

@Nonnull
public org.apache.jackrabbit.api.security.authorization.PrivilegeManager getPrivilegeManager()

getProtectedItemImporters

@Nonnull
public List<org.apache.jackrabbit.oak.spi.xml.ProtectedItemImporter> getProtectedItemImporters()

getObservationManager

@Nonnull
public javax.jcr.observation.ObservationManager getObservationManager()
                                                               throws javax.jcr.UnsupportedRepositoryOperationException
Throws:
javax.jcr.UnsupportedRepositoryOperationException

getOpenScopedLocks

public Set<String> getOpenScopedLocks()

getSessionScopedLocks

public Set<String> getSessionScopedLocks()

getOakName

@Nonnull
public String getOakName(String jcrName)
                  throws javax.jcr.RepositoryException
Specified by:
getOakName in interface org.apache.jackrabbit.oak.namepath.NameMapper
Throws:
javax.jcr.RepositoryException

getOakNameOrNull

@CheckForNull
public String getOakNameOrNull(@Nonnull
                                            String jcrName)
Specified by:
getOakNameOrNull in interface org.apache.jackrabbit.oak.namepath.NameMapper

getJcrName

public String getJcrName(@Nonnull
                         String oakName)
Specified by:
getJcrName in interface org.apache.jackrabbit.oak.namepath.NameMapper

getOakPath

@CheckForNull
public String getOakPath(String jcrPath)
Specified by:
getOakPath in interface org.apache.jackrabbit.oak.namepath.PathMapper

getOakPathKeepIndex

@CheckForNull
public String getOakPathKeepIndex(String jcrPath)
Specified by:
getOakPathKeepIndex in interface org.apache.jackrabbit.oak.namepath.PathMapper

getJcrPath

@Nonnull
public String getJcrPath(String oakPath)
Specified by:
getJcrPath in interface org.apache.jackrabbit.oak.namepath.PathMapper

getOakPathOrThrow

@Nonnull
public String getOakPathOrThrow(String jcrPath)
                         throws javax.jcr.RepositoryException
Returns the Oak path for the given JCR path, or throws a RepositoryException if the path can not be mapped.

Parameters:
jcrPath - JCR path
Returns:
Oak path
Throws:
javax.jcr.RepositoryException - if the path can not be mapped

getOakPathOrThrowNotFound

@Nonnull
public String getOakPathOrThrowNotFound(String jcrPath)
                                 throws javax.jcr.PathNotFoundException
Returns the Oak path for the given JCR path, or throws a PathNotFoundException if the path can not be mapped.

Parameters:
jcrPath - JCR path
Returns:
Oak path
Throws:
javax.jcr.PathNotFoundException - if the path can not be mapped

getAccessManager

@Nonnull
public AccessManager getAccessManager()
                               throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getSecurityProvider

@Nonnull
public org.apache.jackrabbit.oak.spi.security.SecurityProvider getSecurityProvider()


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.