Package org.apache.jackrabbit.spi
Interface SessionInfo
-
- All Known Subinterfaces:
XASessionInfo
- All Known Implementing Classes:
SessionInfoImpl
,SessionInfoImpl
,SessionInfoLogger
public interface SessionInfo
SessionInfo
is created uponRepositoryService.obtain(javax.jcr.Credentials, String)
orRepositoryService.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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addLockToken(String lockToken)
Add the given lock token to thisSessionInfo
.String[]
getLockTokens()
Returns the lock tokens present on thisSessionInfo
.String
getUserID()
Returns the user id.String
getWorkspaceName()
Returns the workspace name.void
removeLockToken(String lockToken)
Removes the given lock token from thisSessionInfo
.void
setUserData(String userData)
Sets the user data used forEvent.getUserData()
.
-
-
-
Method Detail
-
getUserID
String getUserID()
Returns the user id.- Returns:
- The user identification.
- See Also:
RepositoryService.obtain(javax.jcr.Credentials, String)
-
getWorkspaceName
String getWorkspaceName()
Returns the workspace name.- Returns:
- The name of the
workspace
this SessionInfo has been built for. - See Also:
RepositoryService.obtain(javax.jcr.Credentials, String)
,Workspace.getName()
-
getLockTokens
String[] getLockTokens() throws UnsupportedRepositoryOperationException, RepositoryException
Returns the lock tokens present on thisSessionInfo
.- Returns:
- lock tokens present on this
SessionInfo
. - Throws:
UnsupportedRepositoryOperationException
- If locking is not supported.RepositoryException
- If another error occurs.
-
addLockToken
void addLockToken(String lockToken) throws UnsupportedRepositoryOperationException, LockException, RepositoryException
Add the given lock token to thisSessionInfo
. The token will enable the SessionInfo to operate on Items that are affected by the lock identified by the given token.- Parameters:
lockToken
- to be added.- Throws:
UnsupportedRepositoryOperationException
- If locking is not supported.LockException
- If the token cannot be added.RepositoryException
- If another error occurs.
-
removeLockToken
void removeLockToken(String lockToken) throws UnsupportedRepositoryOperationException, LockException, RepositoryException
Removes the given lock token from thisSessionInfo
. 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 callingSession.removeLockToken(String)
. Consequently allRepositoryService
operations affected by a lock will fail with LockException provided the lock hasn't been released.- Parameters:
lockToken
- to be removed.- Throws:
UnsupportedRepositoryOperationException
- If locking is not supported.LockException
- If the token cannot be removed.RepositoryException
- If another error occurs.
-
setUserData
void setUserData(String userData) throws RepositoryException
Sets the user data used forEvent.getUserData()
.- Parameters:
userData
-- Throws:
RepositoryException
- See Also:
ObservationManager.setUserData(String)
-
-