org.apache.slide.common
Interface SlideToken

All Known Implementing Classes:
SlideTokenImpl, SlideTokenWrapper

public interface SlideToken

The SlideToken interface identifies the current acting principal and its credentials, and maintains information about the state of the user transaction.

An object implementing this interface is required to use any of the methods provided by the helpers API. The default implementation of this interface is SlideTokenImpl. In the context of a Java servlet, such an object should be instantiated like this:

   Principal principal = request.getUserPrincipal();
   CredentialsToken credentials;
   if (principal == null) {
       credentials = new CredentialsToken("");
   } else {
       credentials = new CredentialsToken(principal);
   }
   SlideToken token = new SlideTokenImpl(credentials);
   

Version:
$Revision: 1.7 $
Author:
Remy Maucherat

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.
 

Method Detail

getCredentialsToken

public CredentialsToken getCredentialsToken()
Returns the credentials token.
Returns:
String

setCredentialsToken

public void setCredentialsToken(CredentialsToken credentialsToken)
Credentials token mutator.

getCacheInfoToken

public CacheInfoToken getCacheInfoToken()
Returns the CacheInfo token.
Returns:
CacheInfoToken

setCacheInfoToken

public void setCacheInfoToken(CacheInfoToken cacheInfoToken)
CacheInfo token mutator.

isEnforceLockTokens

public boolean isEnforceLockTokens()
Use lock tokens in lock resolution ?
Returns:
boolean

setEnforceLockTokens

public void setEnforceLockTokens(boolean enforceLockTokens)
Enforce lock tokens flag mutator.
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.
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.
Parameters:
forceStoreEnlistment - New flag value

addLockToken

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

removeLockToken

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

clearLockTokens

public void clearLockTokens()
Clears the lock token list.

checkLockToken

public boolean checkLockToken(java.lang.String lockToken)
Checks if the given lock token is present.
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.
Parameters:
parameterName - Parameter to add
parameterValue - Parameter value

removeParameter

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

clearParameters

public void clearParameters()
Clears the parameter list.

getParameterNames

public java.util.Enumeration getParameterNames()
Return parameter list.