com.bankframe.fe.statemachine.base.sessionmanagers
Class UserSession

java.lang.Object
  extended bycom.bankframe.fe.statemachine.base.sessionmanagers.UserSession
All Implemented Interfaces:
IUserSession, java.io.Serializable
Direct Known Subclasses:
UserSession

public abstract class UserSession
extends java.lang.Object
implements IUserSession, java.io.Serializable

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.bankframe.fe.statemachine.base.sessionmanagers.IUserSession
STATE_ID_SOURCE_REQUEST, STATE_ID_SOURCE_REQUEST_THEN_SESSION, STATE_ID_SOURCE_SESSION, STATE_ID_SOURCE_SESSION_THEN_REQUEST, STATE_ID_SOURCE_UNDEFINED
 
Constructor Summary
UserSession()
           
 
Method Summary
 void addAuthToken(java.lang.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.
 java.util.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(java.util.Collection tokens)
          Determines whether this user session has all the given authentication tokens.
 boolean hasAuthToken(java.lang.String authToken)
          Determines whether this user session has a given authentication token.
 void invalidate()
          This method nullifies the references between this and all other objects, allowing this to be unloaded.
 void removeAllAuthTokens()
          Removes all authTokens from this user session.
 void removeAuthToken(java.lang.String authToken)
          Removes an authentication token from this user session.
 void setLocale(java.util.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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bankframe.fe.statemachine.base.sessionmanagers.IUserSession
getId
 

Constructor Detail

UserSession

public UserSession()
Method Detail

getHistoryStar

public 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.

Specified by:
getHistoryStar in interface IUserSession
Parameters:
state - the state being visited
Returns:
the appropriate state visit, or an IStateVisit containing the given IState and an empty IResponseData.

addStateVisit

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

Specified by:
addStateVisit in interface IUserSession
Parameters:
state - the state being visited
responseData - the response data being given to the view

getHistory

public 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.

Specified by:
getHistory in interface IUserSession
Parameters:
state - the state being visited
Returns:
the appropriate state visit, or an IStateVisit containing the given IState and an empty IResponseData.

invalidate

public void invalidate()
This method nullifies the references between this and all other objects, allowing this to be unloaded.


removeAuthToken

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

Specified by:
removeAuthToken in interface IUserSession
Parameters:
authToken - the token to remove.

addAuthToken

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

Specified by:
addAuthToken in interface IUserSession
Parameters:
authToken - the token to add.

hasAuthToken

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

Specified by:
hasAuthToken in interface IUserSession
Returns:
true iff this user session contains the given authentication token.

getMostRecentVisit

public IStateVisit getMostRecentVisit()
Returns the most recently added StateVisit.

Specified by:
getMostRecentVisit in interface IUserSession
Returns:
the most recent StateVisit.

hasAllAuthTokens

public boolean hasAllAuthTokens(java.util.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...

Specified by:
hasAllAuthTokens in interface IUserSession
Returns:
true iff this user session contains all the given authentication tokens.

removeAllAuthTokens

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

Specified by:
removeAllAuthTokens in interface IUserSession

getStateIdSource

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

Specified by:
getStateIdSource in interface IUserSession
Returns:
stateIdSource

setStateIdSource

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

Specified by:
setStateIdSource in interface IUserSession
Parameters:
stateIdSource -

wasStateVisited

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

Specified by:
wasStateVisited in interface IUserSession
Parameters:
state -
Returns:
true iff the given state has been visited.

getSessionData

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

Specified by:
getSessionData in interface IUserSession
Returns:
sessionData.

setLocale

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

Specified by:
setLocale in interface IUserSession
Parameters:
locale -

getLocale

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

Specified by:
getLocale in interface IUserSession
Returns:
locale


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