Class SessionContext
- java.lang.Object
-
- 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.).
-
-
Constructor Summary
Constructors Constructor Description SessionContext(@NotNull Repository repository, @NotNull org.apache.jackrabbit.oak.stats.StatisticManager statisticManager, @NotNull org.apache.jackrabbit.oak.spi.security.SecurityProvider securityProvider, @NotNull org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard, @NotNull Map<String,Object> attributes, @NotNull SessionDelegate delegate, int observationQueueLength, org.apache.jackrabbit.oak.plugins.observation.CommitRateLimiter commitRateLimiter)
SessionContext(@NotNull Repository repository, @NotNull org.apache.jackrabbit.oak.stats.StatisticManager statisticManager, @NotNull org.apache.jackrabbit.oak.spi.security.SecurityProvider securityProvider, @NotNull org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard, @NotNull Map<String,Object> attributes, @NotNull SessionDelegate delegate, int observationQueueLength, org.apache.jackrabbit.oak.plugins.observation.CommitRateLimiter commitRateLimiter, org.apache.jackrabbit.oak.spi.mount.MountInfoProvider mountInfoProvider, @Nullable org.apache.jackrabbit.oak.api.blob.BlobAccessProvider blobAccessProvider, boolean fastQueryResultSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SessionImpl
createSession()
Factory method for creating theSession
instance for this context.protected WorkspaceImpl
createWorkspace()
Factory method for creating theWorkspace
instance for this context.@NotNull AccessControlManager
getAccessControlManager()
@NotNull AccessManager
getAccessManager()
Map<String,Object>
getAttributes()
@NotNull org.apache.jackrabbit.oak.api.blob.BlobAccessProvider
getBlobAccessProvider()
@NotNull org.apache.jackrabbit.oak.stats.CounterStats
getCount(org.apache.jackrabbit.api.stats.RepositoryStatistics.Type type)
boolean
getFastQueryResultSize()
@NotNull String
getJcrName(@NotNull String oakName)
@NotNull String
getJcrPath(String oakPath)
@NotNull org.apache.jackrabbit.oak.stats.MeterStats
getMeter(org.apache.jackrabbit.api.stats.RepositoryStatistics.Type type)
@Nullable org.apache.jackrabbit.oak.spi.mount.MountInfoProvider
getMountInfoProvider()
@NotNull String
getOakName(@NotNull String jcrName)
@Nullable String
getOakNameOrNull(@NotNull String jcrName)
@Nullable String
getOakPath(String jcrPath)
@NotNull String
getOakPathOrThrow(String jcrPath)
Returns the Oak path for the given JCR path, or throws aRepositoryException
if the path can not be mapped.@NotNull String
getOakPathOrThrowNotFound(String jcrPath)
Returns the Oak path for the given JCR path, or throws aPathNotFoundException
if the path can not be mapped.@NotNull ObservationManager
getObservationManager()
Set<String>
getOpenScopedLocks()
@NotNull org.apache.jackrabbit.api.security.principal.PrincipalManager
getPrincipalManager()
@NotNull org.apache.jackrabbit.api.security.authorization.PrivilegeManager
getPrivilegeManager()
@NotNull List<org.apache.jackrabbit.oak.spi.xml.ProtectedItemImporter>
getProtectedItemImporters()
@NotNull Repository
getRepository()
@NotNull org.apache.jackrabbit.oak.spi.security.SecurityProvider
getSecurityProvider()
SessionImpl
getSession()
@NotNull SessionDelegate
getSessionDelegate()
@NotNull Map<String,String>
getSessionLocalMappings()
Set<String>
getSessionScopedLocks()
@NotNull org.apache.jackrabbit.oak.stats.StatisticManager
getStatisticManager()
@NotNull org.apache.jackrabbit.oak.stats.TimerStats
getTimer(org.apache.jackrabbit.api.stats.RepositoryStatistics.Type type)
@NotNull org.apache.jackrabbit.api.security.user.UserManager
getUserManager()
ValueFactory
getValueFactory()
WorkspaceImpl
getWorkspace()
boolean
hasEventListeners()
-
-
-
Constructor Detail
-
SessionContext
public SessionContext(@NotNull @NotNull Repository repository, @NotNull @NotNull org.apache.jackrabbit.oak.stats.StatisticManager statisticManager, @NotNull @NotNull org.apache.jackrabbit.oak.spi.security.SecurityProvider securityProvider, @NotNull @NotNull org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard, @NotNull @NotNull Map<String,Object> attributes, @NotNull @NotNull SessionDelegate delegate, int observationQueueLength, org.apache.jackrabbit.oak.plugins.observation.CommitRateLimiter commitRateLimiter)
-
SessionContext
public SessionContext(@NotNull @NotNull Repository repository, @NotNull @NotNull org.apache.jackrabbit.oak.stats.StatisticManager statisticManager, @NotNull @NotNull org.apache.jackrabbit.oak.spi.security.SecurityProvider securityProvider, @NotNull @NotNull org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard, @NotNull @NotNull Map<String,Object> attributes, @NotNull @NotNull SessionDelegate delegate, int observationQueueLength, org.apache.jackrabbit.oak.plugins.observation.CommitRateLimiter commitRateLimiter, org.apache.jackrabbit.oak.spi.mount.MountInfoProvider mountInfoProvider, @Nullable @Nullable org.apache.jackrabbit.oak.api.blob.BlobAccessProvider blobAccessProvider, boolean fastQueryResultSize)
-
-
Method Detail
-
getSession
public final SessionImpl getSession()
-
getWorkspace
public final WorkspaceImpl getWorkspace()
-
createSession
protected SessionImpl createSession()
Factory method for creating theSession
instance for this context. Called bygetSession()
when first accessed. Can be overridden by subclasses to customize the session implementation.- Returns:
- session instance
-
createWorkspace
protected WorkspaceImpl createWorkspace()
Factory method for creating theWorkspace
instance for this context. Called bygetWorkspace()
when first accessed. Can be overridden by subclasses to customize the workspace implementation.- Returns:
- session instance
-
getStatisticManager
@NotNull public @NotNull org.apache.jackrabbit.oak.stats.StatisticManager getStatisticManager()
-
getMeter
@NotNull public @NotNull org.apache.jackrabbit.oak.stats.MeterStats getMeter(org.apache.jackrabbit.api.stats.RepositoryStatistics.Type type)
-
getTimer
@NotNull public @NotNull org.apache.jackrabbit.oak.stats.TimerStats getTimer(org.apache.jackrabbit.api.stats.RepositoryStatistics.Type type)
-
getCount
@NotNull public @NotNull org.apache.jackrabbit.oak.stats.CounterStats getCount(org.apache.jackrabbit.api.stats.RepositoryStatistics.Type type)
-
getRepository
@NotNull public @NotNull Repository getRepository()
-
getSessionDelegate
@NotNull public @NotNull SessionDelegate getSessionDelegate()
-
getSessionLocalMappings
@NotNull public @NotNull Map<String,String> getSessionLocalMappings()
- Specified by:
getSessionLocalMappings
in interfaceorg.apache.jackrabbit.oak.namepath.NameMapper
-
getValueFactory
public ValueFactory getValueFactory()
-
getAccessControlManager
@NotNull public @NotNull AccessControlManager getAccessControlManager() throws RepositoryException
- Throws:
RepositoryException
-
getPrincipalManager
@NotNull public @NotNull org.apache.jackrabbit.api.security.principal.PrincipalManager getPrincipalManager()
-
getUserManager
@NotNull public @NotNull org.apache.jackrabbit.api.security.user.UserManager getUserManager()
-
getPrivilegeManager
@NotNull public @NotNull org.apache.jackrabbit.api.security.authorization.PrivilegeManager getPrivilegeManager()
-
getProtectedItemImporters
@NotNull public @NotNull List<org.apache.jackrabbit.oak.spi.xml.ProtectedItemImporter> getProtectedItemImporters()
-
getObservationManager
@NotNull public @NotNull ObservationManager getObservationManager() throws UnsupportedRepositoryOperationException
-
getBlobAccessProvider
@NotNull public @NotNull org.apache.jackrabbit.oak.api.blob.BlobAccessProvider getBlobAccessProvider()
-
hasEventListeners
public boolean hasEventListeners()
-
getFastQueryResultSize
public boolean getFastQueryResultSize()
-
getMountInfoProvider
@Nullable public @Nullable org.apache.jackrabbit.oak.spi.mount.MountInfoProvider getMountInfoProvider()
-
getOakName
@NotNull public @NotNull String getOakName(@NotNull @NotNull String jcrName) throws RepositoryException
- Specified by:
getOakName
in interfaceorg.apache.jackrabbit.oak.namepath.NameMapper
- Throws:
RepositoryException
-
getOakNameOrNull
@Nullable public @Nullable String getOakNameOrNull(@NotNull @NotNull String jcrName)
- Specified by:
getOakNameOrNull
in interfaceorg.apache.jackrabbit.oak.namepath.NameMapper
-
getJcrName
@NotNull public @NotNull String getJcrName(@NotNull @NotNull String oakName)
- Specified by:
getJcrName
in interfaceorg.apache.jackrabbit.oak.namepath.NameMapper
-
getOakPath
@Nullable public @Nullable String getOakPath(String jcrPath)
- Specified by:
getOakPath
in interfaceorg.apache.jackrabbit.oak.namepath.PathMapper
-
getJcrPath
@NotNull public @NotNull String getJcrPath(String oakPath)
- Specified by:
getJcrPath
in interfaceorg.apache.jackrabbit.oak.namepath.PathMapper
-
getOakPathOrThrow
@NotNull public @NotNull String getOakPathOrThrow(String jcrPath) throws RepositoryException
Returns the Oak path for the given JCR path, or throws aRepositoryException
if the path can not be mapped.- Parameters:
jcrPath
- JCR path- Returns:
- Oak path
- Throws:
RepositoryException
- if the path can not be mapped
-
getOakPathOrThrowNotFound
@NotNull public @NotNull String getOakPathOrThrowNotFound(String jcrPath) throws PathNotFoundException
Returns the Oak path for the given JCR path, or throws aPathNotFoundException
if the path can not be mapped.- Parameters:
jcrPath
- JCR path- Returns:
- Oak path
- Throws:
PathNotFoundException
- if the path can not be mapped
-
getAccessManager
@NotNull public @NotNull AccessManager getAccessManager()
-
getSecurityProvider
@NotNull public @NotNull org.apache.jackrabbit.oak.spi.security.SecurityProvider getSecurityProvider()
-
-