Class SessionInfoLogger
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.logging.AbstractLogger
-
- org.apache.jackrabbit.spi.commons.logging.SessionInfoLogger
-
- All Implemented Interfaces:
SessionInfo
public class SessionInfoLogger extends AbstractLogger implements SessionInfo
Log wrapper for aSessionInfo.
-
-
Constructor Summary
Constructors Constructor Description SessionInfoLogger(SessionInfo sessionInfo, LogWriter writer)Create a new instance for the givensessionInfowhich useswriterfor persisting log messages.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLockToken(java.lang.String lockToken)Add the given lock token to thisSessionInfo.java.lang.String[]getLockTokens()Returns the lock tokens present on thisSessionInfo.SessionInfogetSessionInfo()java.lang.StringgetUserID()Returns the user id.java.lang.StringgetWorkspaceName()Returns the workspace name.voidremoveLockToken(java.lang.String lockToken)Removes the given lock token from thisSessionInfo.voidsetUserData(java.lang.String userData)Sets the user data used forEvent.getUserData().
-
-
-
Constructor Detail
-
SessionInfoLogger
public SessionInfoLogger(SessionInfo sessionInfo, LogWriter writer)
Create a new instance for the givensessionInfowhich useswriterfor persisting log messages.- Parameters:
sessionInfo-writer-
-
-
Method Detail
-
getSessionInfo
public SessionInfo getSessionInfo()
- Returns:
- the wrapped SessionInfo
-
getUserID
public java.lang.String getUserID()
Description copied from interface:SessionInfoReturns the user id.- Specified by:
getUserIDin interfaceSessionInfo- Returns:
- The user identification.
- See Also:
RepositoryService.obtain(javax.jcr.Credentials, String)
-
getWorkspaceName
public java.lang.String getWorkspaceName()
Description copied from interface:SessionInfoReturns the workspace name.- Specified by:
getWorkspaceNamein interfaceSessionInfo- Returns:
- The name of the
workspacethis SessionInfo has been built for. - See Also:
RepositoryService.obtain(javax.jcr.Credentials, String),Workspace.getName()
-
getLockTokens
public java.lang.String[] getLockTokens() throws javax.jcr.RepositoryExceptionDescription copied from interface:SessionInfoReturns the lock tokens present on thisSessionInfo.- Specified by:
getLockTokensin interfaceSessionInfo- Returns:
- lock tokens present on this
SessionInfo. - Throws:
javax.jcr.UnsupportedRepositoryOperationException- If locking is not supported.javax.jcr.RepositoryException- If another error occurs.
-
addLockToken
public void addLockToken(java.lang.String lockToken) throws javax.jcr.RepositoryExceptionDescription copied from interface:SessionInfoAdd 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.- Specified by:
addLockTokenin interfaceSessionInfo- Parameters:
lockToken- to be added.- Throws:
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.
-
removeLockToken
public void removeLockToken(java.lang.String lockToken) throws javax.jcr.RepositoryExceptionDescription copied from interface:SessionInfoRemoves 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 allRepositoryServiceoperations affected by a lock will fail with LockException provided the lock hasn't been released.- Specified by:
removeLockTokenin interfaceSessionInfo- Parameters:
lockToken- to be removed.- Throws:
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.
-
setUserData
public void setUserData(java.lang.String userData) throws javax.jcr.RepositoryExceptionDescription copied from interface:SessionInfoSets the user data used forEvent.getUserData().- Specified by:
setUserDatain interfaceSessionInfo- Throws:
javax.jcr.RepositoryException- See Also:
ObservationManager.setUserData(String)
-
-