org.apache.jackrabbit.spi.commons.logging
Class SessionInfoLogger

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.logging.AbstractLogger
      extended by org.apache.jackrabbit.spi.commons.logging.SessionInfoLogger
All Implemented Interfaces:
SessionInfo

public class SessionInfoLogger
extends AbstractLogger
implements SessionInfo

Log wrapper for a SessionInfo.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
AbstractLogger.Callable, AbstractLogger.SafeCallable
 
Field Summary
 
Fields inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
writer
 
Constructor Summary
SessionInfoLogger(SessionInfo sessionInfo, LogWriter writer)
          Create a new instance for the given sessionInfo which uses writer for persisting log messages.
 
Method Summary
 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().
 
Methods inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
execute, execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionInfoLogger

public SessionInfoLogger(SessionInfo sessionInfo,
                         LogWriter writer)
Create a new instance for the given sessionInfo which uses writer for persisting log messages.

Parameters:
sessionInfo -
writer -
Method Detail

getSessionInfo

public SessionInfo getSessionInfo()
Returns:
the wrapped SessionInfo

getUserID

public String getUserID()
Description copied from interface: SessionInfo
Returns the user id.

Specified by:
getUserID in interface SessionInfo
Returns:
The user identification.
See Also:
RepositoryService.obtain(javax.jcr.Credentials, String)

getWorkspaceName

public String getWorkspaceName()
Description copied from interface: SessionInfo
Returns the workspace name.

Specified by:
getWorkspaceName in interface SessionInfo
Returns:
The name of the workspace this SessionInfo has been built for.
See Also:
RepositoryService.obtain(javax.jcr.Credentials, String), Workspace.getName()

getLockTokens

public String[] getLockTokens()
                       throws RepositoryException
Description copied from interface: SessionInfo
Returns the lock tokens present on this SessionInfo.

Specified by:
getLockTokens in interface SessionInfo
Returns:
lock tokens present on this SessionInfo.
Throws:
UnsupportedRepositoryOperationException - If locking is not supported.
RepositoryException - If another error occurs.

addLockToken

public void addLockToken(String lockToken)
                  throws RepositoryException
Description copied from interface: SessionInfo
Add the given lock token to this SessionInfo. The token will enable the SessionInfo to operate on Items that are affected by the lock identified by the given token.

Specified by:
addLockToken in interface SessionInfo
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

public void removeLockToken(String lockToken)
                     throws RepositoryException
Description copied from interface: SessionInfo
Removes the given lock token from this 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.

Specified by:
removeLockToken in interface SessionInfo
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

public void setUserData(String userData)
                 throws RepositoryException
Description copied from interface: SessionInfo
Sets the user data used for Event.getUserData().

Specified by:
setUserData in interface SessionInfo
Throws:
RepositoryException
See Also:
ObservationManager.setUserData(String)


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.