org.apache.slide.common
Class SlideTokenWrapper

java.lang.Object
  |
  +--org.apache.slide.common.SlideTokenWrapper
All Implemented Interfaces:
SlideToken

public final class SlideTokenWrapper
extends java.lang.Object
implements SlideToken

Slide token class.

Author:
Remy Maucherat

Constructor Summary
SlideTokenWrapper(SlideToken token, boolean forceStoreEnlistment)
          Constructor.
 
Method Summary
 void addLockToken(java.lang.String lockId)
          Add a new lock token to the lock token list.
 void addParameter(java.lang.String parameterName, java.lang.Object parameterValue)
          Add a new parameter to the parameter list.
 boolean checkLockToken(java.lang.String lockToken)
          Checks if the given lock token is present.
 void clearLockTokens()
          Clears the lock token list.
 void clearParameters()
          Clears the parameter list.
 CacheInfoToken getCacheInfoToken()
          Returns the CacheInfo token.
 CredentialsToken getCredentialsToken()
          Returns the credentials token.
 java.util.Enumeration getParameterNames()
          Return parameter list.
 boolean isEnforceLockTokens()
          Use lock tokens in lock resolution ?
 boolean isForceStoreEnlistment()
          Force store enlistment flag accessor.
 void removeLockToken(java.lang.String lockId)
          Removes a lock token from the lock token list.
 void removeParameter(java.lang.String parameterName)
          Removes a parameter from the parameter list.
 void setCacheInfoToken(CacheInfoToken cacheInfoToken)
          CacheInfo token mutator.
 void setCredentialsToken(CredentialsToken credentialsToken)
          Credentials token mutator.
 void setEnforceLockTokens(boolean enforceLockTokens)
          Enforce lock tokens flag mutator.
 void setForceStoreEnlistment(boolean forceStoreEnlistment)
          Force store enlistment flag mutator.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlideTokenWrapper

public SlideTokenWrapper(SlideToken token,
                         boolean forceStoreEnlistment)
Constructor.
Parameters:
credentials - Credentials stored in this token
Method Detail

getCredentialsToken

public CredentialsToken getCredentialsToken()
Returns the credentials token.
Specified by:
getCredentialsToken in interface SlideToken
Returns:
String

setCredentialsToken

public void setCredentialsToken(CredentialsToken credentialsToken)
Credentials token mutator.
Specified by:
setCredentialsToken in interface SlideToken

getCacheInfoToken

public CacheInfoToken getCacheInfoToken()
Returns the CacheInfo token.
Specified by:
getCacheInfoToken in interface SlideToken
Returns:
CacheInfoToken

setCacheInfoToken

public void setCacheInfoToken(CacheInfoToken cacheInfoToken)
CacheInfo token mutator.
Specified by:
setCacheInfoToken in interface SlideToken

isEnforceLockTokens

public boolean isEnforceLockTokens()
Use lock tokens in lock resolution ?
Specified by:
isEnforceLockTokens in interface SlideToken
Returns:
boolean

setEnforceLockTokens

public void setEnforceLockTokens(boolean enforceLockTokens)
Enforce lock tokens flag mutator.
Specified by:
setEnforceLockTokens in interface SlideToken
Parameters:
enforceLockTokens - New flag value

isForceStoreEnlistment

public boolean isForceStoreEnlistment()
Force store enlistment flag accessor. If true, that will cause Slide to enlist the store in the current transaction for all operations, to be able to prevent dirty reads when doing complex updates.
Specified by:
isForceStoreEnlistment in interface SlideToken
Returns:
boolean

setForceStoreEnlistment

public void setForceStoreEnlistment(boolean forceStoreEnlistment)
Force store enlistment flag mutator. If set to true, that will cause Slide to enlist the store in the current transaction for all operations, to be able to prevent dirty reads when doing complex updates. That value should be set to true only in some very specific critical sections of the code, as this would greatly decrease the ability of Slide to handle multiple concurrent requests.
Specified by:
setForceStoreEnlistment in interface SlideToken
Parameters:
forceStoreEnlistment - New flag value

addLockToken

public void addLockToken(java.lang.String lockId)
Add a new lock token to the lock token list.
Specified by:
addLockToken in interface SlideToken
Parameters:
lockToken - Lock token to add

removeLockToken

public void removeLockToken(java.lang.String lockId)
Removes a lock token from the lock token list.
Specified by:
removeLockToken in interface SlideToken
Parameters:
lockToken - Lock token to remove

clearLockTokens

public void clearLockTokens()
Clears the lock token list.
Specified by:
clearLockTokens in interface SlideToken

checkLockToken

public boolean checkLockToken(java.lang.String lockToken)
Checks if the given lock token is present.
Specified by:
checkLockToken in interface SlideToken
Parameters:
lockToken - Lock token to check
Returns:
boolean True if the given lock token is present

addParameter

public void addParameter(java.lang.String parameterName,
                         java.lang.Object parameterValue)
Add a new parameter to the parameter list.
Specified by:
addParameter in interface SlideToken
Parameters:
parameterName - Parameter to add
parameterValue - Parameter value

removeParameter

public void removeParameter(java.lang.String parameterName)
Removes a parameter from the parameter list.
Specified by:
removeParameter in interface SlideToken
Parameters:
parameterName - Parameter to remove

clearParameters

public void clearParameters()
Clears the parameter list.
Specified by:
clearParameters in interface SlideToken

getParameterNames

public java.util.Enumeration getParameterNames()
Return parameter list.
Specified by:
getParameterNames in interface SlideToken