public class SessionContext extends java.lang.Object implements NamePathMapper
SessionImpl
, NodeImpl
, etc.) and provide access to
the session scoped instances generally needed (e.g. NamePathMapper
,
ValueFactory
, etc.).NamePathMapper.Default
DEFAULT
Constructor and Description |
---|
SessionContext(@NotNull Repository repository,
@NotNull StatisticManager statisticManager,
@NotNull SecurityProvider securityProvider,
@NotNull Whiteboard whiteboard,
@NotNull java.util.Map<java.lang.String,java.lang.Object> attributes,
@NotNull SessionDelegate delegate,
int observationQueueLength,
CommitRateLimiter commitRateLimiter) |
SessionContext(@NotNull Repository repository,
@NotNull StatisticManager statisticManager,
@NotNull SecurityProvider securityProvider,
@NotNull Whiteboard whiteboard,
@NotNull java.util.Map<java.lang.String,java.lang.Object> attributes,
@NotNull SessionDelegate delegate,
int observationQueueLength,
CommitRateLimiter commitRateLimiter,
MountInfoProvider mountInfoProvider,
@Nullable BlobAccessProvider blobAccessProvider,
boolean fastQueryResultSize) |
Modifier and Type | Method and Description |
---|---|
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. |
@NotNull AccessControlManager |
getAccessControlManager() |
@NotNull AccessManager |
getAccessManager() |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes() |
@NotNull BlobAccessProvider |
getBlobAccessProvider() |
@NotNull CounterStats |
getCount(RepositoryStatistics.Type type) |
boolean |
getFastQueryResultSize() |
@NotNull java.lang.String |
getJcrName(@NotNull java.lang.String oakName)
Returns the JCR name for the given Oak name.
|
@NotNull java.lang.String |
getJcrPath(java.lang.String oakPath)
Returns the JCR path for the given Oak path.
|
@NotNull MeterStats |
getMeter(RepositoryStatistics.Type type) |
@Nullable MountInfoProvider |
getMountInfoProvider() |
@NotNull java.lang.String |
getOakName(@NotNull java.lang.String jcrName)
Returns the Oak name for the specified JCR name.
|
@Nullable java.lang.String |
getOakNameOrNull(@NotNull java.lang.String jcrName)
Returns the Oak name for the given JCR name, or
null if no
such mapping exists because the given JCR name contains an unknown
namespace URI or prefix, or is otherwise invalid. |
@Nullable java.lang.String |
getOakPath(java.lang.String jcrPath)
Returns the Oak path for the given JCR path, or
null if no
such mapping exists because the given JCR path contains a name element
with an unknown namespace URI or prefix, or is otherwise invalid. |
@NotNull java.lang.String |
getOakPathOrThrow(java.lang.String jcrPath)
Returns the Oak path for the given JCR path, or throws a
RepositoryException if the path can not be mapped. |
@NotNull java.lang.String |
getOakPathOrThrowNotFound(java.lang.String jcrPath)
Returns the Oak path for the given JCR path, or throws a
PathNotFoundException if the path can not be mapped. |
@NotNull ObservationManager |
getObservationManager() |
java.util.Set<java.lang.String> |
getOpenScopedLocks() |
@NotNull PrincipalManager |
getPrincipalManager() |
@NotNull PrivilegeManager |
getPrivilegeManager() |
@NotNull java.util.List<ProtectedItemImporter> |
getProtectedItemImporters() |
@NotNull Repository |
getRepository() |
@NotNull SecurityProvider |
getSecurityProvider() |
SessionImpl |
getSession() |
@NotNull SessionDelegate |
getSessionDelegate() |
@NotNull java.util.Map<java.lang.String,java.lang.String> |
getSessionLocalMappings()
Returns the local namespace prefix mappings, or an empty map if
there aren't any local mappings.
|
java.util.Set<java.lang.String> |
getSessionScopedLocks() |
@NotNull StatisticManager |
getStatisticManager() |
@NotNull TimerStats |
getTimer(RepositoryStatistics.Type type) |
@NotNull UserManager |
getUserManager() |
ValueFactory |
getValueFactory() |
WorkspaceImpl |
getWorkspace() |
boolean |
hasEventListeners() |
public SessionContext(@NotNull @NotNull Repository repository, @NotNull @NotNull StatisticManager statisticManager, @NotNull @NotNull SecurityProvider securityProvider, @NotNull @NotNull Whiteboard whiteboard, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> attributes, @NotNull @NotNull SessionDelegate delegate, int observationQueueLength, CommitRateLimiter commitRateLimiter)
public SessionContext(@NotNull @NotNull Repository repository, @NotNull @NotNull StatisticManager statisticManager, @NotNull @NotNull SecurityProvider securityProvider, @NotNull @NotNull Whiteboard whiteboard, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> attributes, @NotNull @NotNull SessionDelegate delegate, int observationQueueLength, CommitRateLimiter commitRateLimiter, MountInfoProvider mountInfoProvider, @Nullable @Nullable BlobAccessProvider blobAccessProvider, boolean fastQueryResultSize)
public final java.util.Map<java.lang.String,java.lang.Object> getAttributes()
public final SessionImpl getSession()
public final WorkspaceImpl getWorkspace()
protected SessionImpl createSession()
Session
instance for this
context. Called by getSession()
when first accessed. Can be
overridden by subclasses to customize the session implementation.protected WorkspaceImpl createWorkspace()
Workspace
instance for this
context. Called by getWorkspace()
when first accessed. Can be
overridden by subclasses to customize the workspace implementation.@NotNull public @NotNull StatisticManager getStatisticManager()
@NotNull public @NotNull MeterStats getMeter(RepositoryStatistics.Type type)
@NotNull public @NotNull TimerStats getTimer(RepositoryStatistics.Type type)
@NotNull public @NotNull CounterStats getCount(RepositoryStatistics.Type type)
@NotNull public @NotNull Repository getRepository()
@NotNull public @NotNull SessionDelegate getSessionDelegate()
@NotNull public @NotNull java.util.Map<java.lang.String,java.lang.String> getSessionLocalMappings()
NameMapper
getSessionLocalMappings
in interface NameMapper
public ValueFactory getValueFactory()
@NotNull public @NotNull AccessControlManager getAccessControlManager() throws RepositoryException
RepositoryException
@NotNull public @NotNull PrincipalManager getPrincipalManager()
@NotNull public @NotNull UserManager getUserManager()
@NotNull public @NotNull PrivilegeManager getPrivilegeManager()
@NotNull public @NotNull java.util.List<ProtectedItemImporter> getProtectedItemImporters()
@NotNull public @NotNull ObservationManager getObservationManager() throws UnsupportedRepositoryOperationException
@NotNull public @NotNull BlobAccessProvider getBlobAccessProvider()
public boolean hasEventListeners()
public java.util.Set<java.lang.String> getOpenScopedLocks()
public java.util.Set<java.lang.String> getSessionScopedLocks()
public boolean getFastQueryResultSize()
@Nullable public @Nullable MountInfoProvider getMountInfoProvider()
@NotNull public @NotNull java.lang.String getOakName(@NotNull @NotNull java.lang.String jcrName) throws RepositoryException
NameMapper
NameMapper.getOakNameOrNull(String)
this method will throw a RepositoryException
if the JCR name is invalid and cannot be resolved.getOakName
in interface NameMapper
jcrName
- The JCR name to be converted.RepositoryException
- If the JCR name cannot be resolved.@Nullable public @Nullable java.lang.String getOakNameOrNull(@NotNull @NotNull java.lang.String jcrName)
NameMapper
null
if no
such mapping exists because the given JCR name contains an unknown
namespace URI or prefix, or is otherwise invalid.getOakNameOrNull
in interface NameMapper
jcrName
- JCR namenull
@NotNull public @NotNull java.lang.String getJcrName(@NotNull @NotNull java.lang.String oakName)
NameMapper
getJcrName
in interface NameMapper
oakName
- Oak name@Nullable public @Nullable java.lang.String getOakPath(java.lang.String jcrPath)
PathMapper
null
if no
such mapping exists because the given JCR path contains a name element
with an unknown namespace URI or prefix, or is otherwise invalid.getOakPath
in interface PathMapper
jcrPath
- JCR pathnull
@NotNull public @NotNull java.lang.String getJcrPath(java.lang.String oakPath)
PathMapper
getJcrPath
in interface PathMapper
oakPath
- Oak path@NotNull public @NotNull java.lang.String getOakPathOrThrow(java.lang.String jcrPath) throws RepositoryException
RepositoryException
if the path can not be mapped.jcrPath
- JCR pathRepositoryException
- if the path can not be mapped@NotNull public @NotNull java.lang.String getOakPathOrThrowNotFound(java.lang.String jcrPath) throws PathNotFoundException
PathNotFoundException
if the path can not be mapped.jcrPath
- JCR pathPathNotFoundException
- if the path can not be mapped@NotNull public @NotNull AccessManager getAccessManager()
@NotNull public @NotNull SecurityProvider getSecurityProvider()
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.