public interface SessionInfo
SessionInfo
is created upon
RepositoryService.obtain(javax.jcr.Credentials, String)
or
RepositoryService.obtain(SessionInfo, String)
and will be used for
any call on the RepositoryService that requires user and workspace
identification.
In addition the SessionInfo acts as primary container for lock tokens. They will assert that a given SessionInfo is able to execute operations on the RepositoryService that are affected by existing locks.
Modifier and Type | Method and Description |
---|---|
void |
addLockToken(String lockToken)
Add the given lock token to this
SessionInfo . |
String[] |
getLockTokens()
Returns the lock tokens present on this
SessionInfo . |
String |
getUserID()
Returns the user id.
|
String |
getWorkspaceName()
Returns the workspace name.
|
void |
removeLockToken(String lockToken)
Removes the given lock token from this
SessionInfo . |
void |
setUserData(String userData)
Sets the user data used for
Event.getUserData() . |
String getUserID()
RepositoryService.obtain(javax.jcr.Credentials, String)
String getWorkspaceName()
workspace
this
SessionInfo has been built for.RepositoryService.obtain(javax.jcr.Credentials, String)
,
Workspace.getName()
String[] getLockTokens() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
SessionInfo
.SessionInfo
.javax.jcr.UnsupportedRepositoryOperationException
- If locking is not supported.javax.jcr.RepositoryException
- If another error occurs.void addLockToken(String lockToken) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
SessionInfo
. The token will
enable the SessionInfo to operate on Items that are affected by the
lock identified by the given token.lockToken
- to be added.javax.jcr.UnsupportedRepositoryOperationException
- If locking is not supported.javax.jcr.lock.LockException
- If the token cannot be added.javax.jcr.RepositoryException
- If another error occurs.void removeLockToken(String lockToken) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
SessionInfo
.
This must happen if the associated Session successfully removes the Lock
from a Node or if the token is removed from the Session itself by calling
Session.removeLockToken(String)
. Consequently all
RepositoryService
operations affected by a lock will fail
with LockException provided the lock hasn't been released.lockToken
- to be removed.javax.jcr.UnsupportedRepositoryOperationException
- If locking is not supported.javax.jcr.lock.LockException
- If the token cannot be removed.javax.jcr.RepositoryException
- If another error occurs.void setUserData(String userData) throws javax.jcr.RepositoryException
Event.getUserData()
.userData
- javax.jcr.RepositoryException
ObservationManager.setUserData(String)
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.