com.bankframe.fe.statemachine.base.apploaders
Class State

java.lang.Object
  extended bycom.bankframe.fe.statemachine.base.apploaders.State
All Implemented Interfaces:
IState
Direct Known Subclasses:
State

public abstract class State
extends java.lang.Object
implements IState


Constructor Summary
State()
           
 
Method Summary
 boolean acceptsEvent(IEvent event)
          Returns trus if the given event is a valid event to be throws from this state.
 boolean acceptsSession(IUserSession session)
          This implementation of acceptsSession checks the authTokens contained in the user session against an internal list auth tokens.
 void executeStateCommand(IStateCommand command, boolean recurse)
          This method executes the given command on this state and (optionally) all child states.
 java.util.Iterator getChildren()
          Returns an iterator over the immediate children of this state.
 IEvent getDefaultEvent()
          Returns a default Event for this state.
 IEvent getEvent(java.lang.String name)
          Returns the Event with the given name.
 java.util.Iterator getEvents()
          Returns an iterator over all the events that can be thrown from this state.
 IState getExceptionState(java.lang.String exceptionDescription)
          Returns a State which can be used if the named exception occurs.
 java.lang.String getId()
          Returns this states Id.
 IState getParentState()
          Returns this state's parent state.
 java.lang.String getTitle()
          Returns a descriptive title for this state.
 java.lang.String getTitle(java.util.Locale locale)
          Returns a descriptive title for this state.
 IUnitOfWork getUnitOfWork()
          Gets the UnitOfWork which contains this state.
 java.util.Properties getUserProperties()
          Returns a Properties for this state.
 java.util.Properties getUserProperties(java.util.Locale locale)
           
 IView getView()
          Returns the IView implementor for this state.
 IView getView(java.util.Locale locale)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State()
Method Detail

acceptsEvent

public boolean acceptsEvent(IEvent event)
Description copied from interface: IState
Returns trus if the given event is a valid event to be throws from this state.

Specified by:
acceptsEvent in interface IState
Parameters:
event - the event to be checked
Returns:
boolean true if the given event can be thrown from this state

acceptsSession

public boolean acceptsSession(IUserSession session)
This implementation of acceptsSession checks the authTokens contained in the user session against an internal list auth tokens.

This method will return ((allRequired || anySufficient) && noForbidden).
In other words, for a session to be accepted it must contain any of this state's sufficient tokens or all of the required tokens, and must not contain any forbidden tokens.

Specified by:
acceptsSession in interface IState
Parameters:
session - the user session to check
Returns:
true if the session has an acceptable set of auth tokens.

getDefaultEvent

public IEvent getDefaultEvent()
Description copied from interface: IState
Returns a default Event for this state.

May return null if no default event exists in this state.

Specified by:
getDefaultEvent in interface IState
Returns:
the default event for this state

getEvent

public IEvent getEvent(java.lang.String name)
Description copied from interface: IState
Returns the Event with the given name.

Specified by:
getEvent in interface IState
Parameters:
name - the name of the required event.
Returns:
the event with the given name

getExceptionState

public IState getExceptionState(java.lang.String exceptionDescription)
Description copied from interface: IState
Returns a State which can be used if the named exception occurs. If this state does not have such an exception, this method searches the parent states, back to the root state. If not state has an exception state with the given name, this method returns the root state.

Specified by:
getExceptionState in interface IState
Parameters:
exceptionDescription - the exception which has been thrown to RequestManager
Returns:
the state which should be the result of the exception.

getId

public java.lang.String getId()
Description copied from interface: IState
Returns this states Id.

Specified by:
getId in interface IState
Returns:
id

getParentState

public IState getParentState()
Description copied from interface: IState
Returns this state's parent state.

Specified by:
getParentState in interface IState
Returns:
the parent state, or null if this is the root state for this applicaiton.

getUnitOfWork

public IUnitOfWork getUnitOfWork()
Description copied from interface: IState
Gets the UnitOfWork which contains this state.

May be null.

Specified by:
getUnitOfWork in interface IState
Returns:
unit of work

getUserProperties

public java.util.Properties getUserProperties(java.util.Locale locale)

getView

public IView getView(java.util.Locale locale)
              throws ViewNotFoundException
Throws:
ViewNotFoundException

getEvents

public java.util.Iterator getEvents()
Returns an iterator over all the events that can be thrown from this state. Note that this does not recurse through parent states.

Specified by:
getEvents in interface IState
Returns:
an Iterator over IEvents

getTitle

public java.lang.String getTitle(java.util.Locale locale)
Returns a descriptive title for this state. This implementation returns the State's ID if no title has been specified.

Parameters:
locale -
Returns:
title

getChildren

public java.util.Iterator getChildren()
Returns an iterator over the immediate children of this state.

Specified by:
getChildren in interface IState
Returns:
an Iterator over IStates

executeStateCommand

public void executeStateCommand(IStateCommand command,
                                boolean recurse)
                         throws StateMachineException
This method executes the given command on this state and (optionally) all child states.

Specified by:
executeStateCommand in interface IState
Parameters:
command - an IStateCommand implementor that performs some operation on states.
recurse - set true if the command is to be executed on the state tree, or false if the command is to be executed on this state only.
Throws:
StateMachineException

getTitle

public java.lang.String getTitle()
Description copied from interface: IState
Returns a descriptive title for this state.

Specified by:
getTitle in interface IState
Returns:
title
See Also:
IState.getTitle()

getUserProperties

public java.util.Properties getUserProperties()
Description copied from interface: IState
Returns a Properties for this state.

userProperties can be used to store information about the state of particular interest to your application.

Specified by:
getUserProperties in interface IState
Returns:
userProperties
See Also:
IState.getUserProperties()

getView

public IView getView()
              throws ViewNotFoundException
Description copied from interface: IState
Returns the IView implementor for this state.

Specified by:
getView in interface IState
Returns:
view
Throws:
ViewNotFoundException
See Also:
IState.getView()


Copyright © 2004 Siebel Systems, Inc. All rights reserved.