com.bankframe.fe.statemachine.base.sessionmanagers
Interface IUserSession

All Known Subinterfaces:
IUserSession
All Known Implementing Classes:
UserSession, UserSession, UserSession, UserSession

public interface IUserSession


Field Summary
static int STATE_ID_SOURCE_REQUEST
           
static int STATE_ID_SOURCE_REQUEST_THEN_SESSION
           
static int STATE_ID_SOURCE_SESSION
           
static int STATE_ID_SOURCE_SESSION_THEN_REQUEST
           
static int STATE_ID_SOURCE_UNDEFINED
           
 
Method Summary
 void addAuthToken(String authToken)
          Adds an authentication token to this user session.
 void addStateVisit(IState state, IResponseData responseData)
          Records a new state visit, adding it to the history of this session.
 IStateVisit getHistory(IState state)
          Returns the most recent state visit which contains an immediate child of the given state.
 IStateVisit getHistoryStar(IState state)
          Returns the most recent state visit which contains a child of the given state.
 String getId()
          The sessionId for this session.
 Locale getLocale()
          Gets the Locale to be used with this UserSession.
 IStateVisit getMostRecentVisit()
          Returns the most recently added StateVisit.
 ISessionData getSessionData()
          Returns the SessionData associated with this UserSession.
 int getStateIdSource()
          Returns the stateIdSource to be used with this user session.
 boolean hasAllAuthTokens(Collection tokens)
          Determines whether this user session has all the given authentication tokens.
 boolean hasAuthToken(String authToken)
          Determines whether this user session has a given authentication token.
 void removeAllAuthTokens()
          Removes all authTokens from this user session.
 void removeAuthToken(String authToken)
          Removes an authentication token from this user session.
 void setLocale(Locale locale)
          Sets the Locale to be used with this UserSession.
 void setStateIdSource(int stateIdSource)
          Sets the stateIdSource to be used with this user session.
 boolean wasStateVisited(IState state)
          Determines whether the given state has been visited in this session.
 

Field Detail

STATE_ID_SOURCE_UNDEFINED

static final int STATE_ID_SOURCE_UNDEFINED
See Also:
Constant Field Values

STATE_ID_SOURCE_REQUEST

static final int STATE_ID_SOURCE_REQUEST
See Also:
Constant Field Values

STATE_ID_SOURCE_SESSION

static final int STATE_ID_SOURCE_SESSION
See Also:
Constant Field Values

STATE_ID_SOURCE_REQUEST_THEN_SESSION

static final int STATE_ID_SOURCE_REQUEST_THEN_SESSION
See Also:
Constant Field Values

STATE_ID_SOURCE_SESSION_THEN_REQUEST

static final int STATE_ID_SOURCE_SESSION_THEN_REQUEST
See Also:
Constant Field Values
Method Detail

getHistory

IStateVisit getHistory(IState state)
Returns the most recent state visit which contains an immediate child of the given state.

If no such state visit exists, this method returns an IStateVisit that contains the given state and an empty IResponseData.

Parameters:
state - the state being entered
Returns:
the appropriate state visit, or an IStateVisit containing the given IState and an empty IResponseData.

getHistoryStar

IStateVisit getHistoryStar(IState state)
Returns the most recent state visit which contains a child of the given state.

If no such state visit exists, this method returns an IStateVisit that contains the given state and an empty IResponseData.

Parameters:
state - the state being visited
Returns:
the appropriate state visit, or an IStateVisit containing the given IState and an empty IResponseData.

getId

String getId()
The sessionId for this session.

Returns:
the sessionId for this session.

addStateVisit

void addStateVisit(IState state,
                   IResponseData responseData)
Records a new state visit, adding it to the history of this session.

Parameters:
state - the state being visited
responseData - the response data being given to the view

addAuthToken

void addAuthToken(String authToken)
Adds an authentication token to this user session.

Parameters:
authToken - the token to add.

removeAuthToken

void removeAuthToken(String authToken)
Removes an authentication token from this user session. If this session does not contain this token, take no action.

Parameters:
authToken - the token to remove.

removeAllAuthTokens

void removeAllAuthTokens()
Removes all authTokens from this user session.


hasAuthToken

boolean hasAuthToken(String authToken)
Determines whether this user session has a given authentication token.

Returns:
true iff this user session contains the given authentication token.

hasAllAuthTokens

boolean hasAllAuthTokens(Collection tokens)
Determines whether this user session has all the given authentication tokens. This may be implemented by iterating through the tokens collection and calling hasAuthToken, but there is probably a better way...

Returns:
true iff this user session contains all the given authentication tokens.

getMostRecentVisit

IStateVisit getMostRecentVisit()
Returns the most recently added StateVisit.

Returns:
the most recent StateVisit.

getStateIdSource

int getStateIdSource()
Returns the stateIdSource to be used with this user session.

Returns:
stateIdSource

setStateIdSource

void setStateIdSource(int stateIdSource)
Sets the stateIdSource to be used with this user session.

Parameters:
stateIdSource -

wasStateVisited

boolean wasStateVisited(IState state)
Determines whether the given state has been visited in this session.

Parameters:
state -
Returns:
true iff the given state has been visited.

getSessionData

ISessionData getSessionData()
Returns the SessionData associated with this UserSession.

Returns:
sessionData.

setLocale

void setLocale(Locale locale)
Sets the Locale to be used with this UserSession.

Parameters:
locale -

getLocale

Locale getLocale()
Gets the Locale to be used with this UserSession.

Returns:
locale


Copyright © 2005, 2007, Oracle. All rights reserved.