public class SessionInfoLogger extends AbstractLogger implements SessionInfo
SessionInfo
.AbstractLogger.Callable, AbstractLogger.SafeCallable
writer
Constructor and Description |
---|
SessionInfoLogger(SessionInfo sessionInfo,
LogWriter writer)
Create a new instance for the given
sessionInfo which uses
writer for persisting log messages. |
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 . |
SessionInfo |
getSessionInfo() |
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() . |
execute, execute
public SessionInfoLogger(SessionInfo sessionInfo, LogWriter writer)
sessionInfo
which uses
writer
for persisting log messages.sessionInfo
- writer
- public SessionInfo getSessionInfo()
public String getUserID()
SessionInfo
getUserID
in interface SessionInfo
RepositoryService.obtain(javax.jcr.Credentials, String)
public String getWorkspaceName()
SessionInfo
getWorkspaceName
in interface SessionInfo
workspace
this
SessionInfo has been built for.RepositoryService.obtain(javax.jcr.Credentials, String)
,
Workspace.getName()
public String[] getLockTokens() throws javax.jcr.RepositoryException
SessionInfo
SessionInfo
.getLockTokens
in interface SessionInfo
SessionInfo
.javax.jcr.UnsupportedRepositoryOperationException
- If locking is not supported.javax.jcr.RepositoryException
- If another error occurs.public void addLockToken(String lockToken) throws javax.jcr.RepositoryException
SessionInfo
SessionInfo
. The token will
enable the SessionInfo to operate on Items that are affected by the
lock identified by the given token.addLockToken
in interface SessionInfo
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.public void removeLockToken(String lockToken) throws javax.jcr.RepositoryException
SessionInfo
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.removeLockToken
in interface SessionInfo
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.public void setUserData(String userData) throws javax.jcr.RepositoryException
SessionInfo
Event.getUserData()
.setUserData
in interface SessionInfo
javax.jcr.RepositoryException
ObservationManager.setUserData(String)
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.