ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.conversation
Class State

java.lang.Object
  |
  +--com.ibm.able.conversation.State
All Implemented Interfaces:
java.io.Serializable

public class State
extends java.lang.Object
implements java.io.Serializable

Class representing a state in a conversation as defined by a Conversation Policy. Each state has the following associated data

OLD VERSION -- TO BE DELETED Replaced by com.ibm.conversation.base.BasicCpState

(1) a name

(2) a type which could be normal,terminal or load-child

(3) a role thats is active at that state (optionally)

(4) a time-out value for staying at that state (optionally)

(5) a set of transitions possible from that state (optionally)

See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          Serialized version identifier in form YYYYMMDDVerRelModxx
 
Constructor Summary
State()
          Create a new default State object
State(State s)
          Create a new State object by copying all the information from the argument State
 
Method Summary
 void addTransition(Transition transition)
          Adds a new transition to the set of transitions possible from the state
 java.lang.String getActiveRole()
          Returns the role active at that state
 java.util.Hashtable getChildConversationPolicyParams()
          Returns the child conversation policy parameters associated with the state
 java.lang.String getName()
          Returns the name of the state.
 int getTimeoutInterval()
          Returns the time-out value asociated with the state
 Transition getTransition(java.lang.String id)
          Returns the transition identified by the id supplied
 java.util.Enumeration getTransitionNames()
          Returns an enumeration of all transition names(ids) from the state
 java.util.Enumeration getTransitions()
          Returns the set of transitions possible from the state
 java.lang.String getType()
          Returns the type of the state
 boolean isLoadChildState()
          Check if the state is a load-child state
 boolean isNormalState()
          Check if the state is a normal state
 boolean isTerminalState()
          Check if the state is a terminal state
 void setActiveRole(java.lang.String role)
          Sets the role name that is active in that state
 void setChildConversationPolicyParams(java.util.Hashtable params)
          Sets child conversation policy parameters such as rolemaps when loading a child CP
 void setName(java.lang.String name)
          Sets the name of the state
 void setTimeoutInterval(int timeout)
          Sets the time-out period for the state
 void setTransitions(java.util.Hashtable transitions)
          Sets the transitions possible from the state
 void setType(java.lang.String type)
          Sets the type of the state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
Serialized version identifier in form YYYYMMDDVerRelModxx
Constructor Detail

State

public State()
Create a new default State object

State

public State(State s)
Create a new State object by copying all the information from the argument State

Parameters:
s - the original state from which the copy is constructed
Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the state

Parameters:
name - name to be assigned to the state

setType

public void setType(java.lang.String type)
Sets the type of the state

Parameters:
type - type to be assigned to the state

addTransition

public void addTransition(Transition transition)
Adds a new transition to the set of transitions possible from the state

Parameters:
transition - The Transition to be added

setTransitions

public void setTransitions(java.util.Hashtable transitions)
Sets the transitions possible from the state

Parameters:
transitions - Hashtable indexed by the transition name(id) and containing the corresponding transition elements

setTimeoutInterval

public void setTimeoutInterval(int timeout)
Sets the time-out period for the state

Parameters:
timeout - The timeout value to be associated with the state

setActiveRole

public void setActiveRole(java.lang.String role)
Sets the role name that is active in that state

Parameters:
role - The role that is active in that state

setChildConversationPolicyParams

public void setChildConversationPolicyParams(java.util.Hashtable params)
Sets child conversation policy parameters such as rolemaps when loading a child CP

Parameters:
params - Hashtable of parameters associated with loading child CPs

getName

public java.lang.String getName()
Returns the name of the state.

Returns:
name of the state or empty string if not previously set

getType

public java.lang.String getType()
Returns the type of the state

Returns:
type of the state or emty string if not previously set

getTransitions

public java.util.Enumeration getTransitions()
Returns the set of transitions possible from the state

Returns:
Enumeration of transition elements

getTransition

public Transition getTransition(java.lang.String id)
Returns the transition identified by the id supplied

Parameters:
id - the identifier for the transition

Returns:
the transition element or null if the identifier is no present

getTransitionNames

public java.util.Enumeration getTransitionNames()
Returns an enumeration of all transition names(ids) from the state

Returns:
Enumeration of transition names(ids)

getTimeoutInterval

public int getTimeoutInterval()
Returns the time-out value asociated with the state

Returns:
the time-out value or -1 if previously not set

getActiveRole

public java.lang.String getActiveRole()
Returns the role active at that state

Returns:
the role active at that state or empty string if previously not set

getChildConversationPolicyParams

public java.util.Hashtable getChildConversationPolicyParams()
Returns the child conversation policy parameters associated with the state

Returns:
hashtable of parameters or null if previously not set

isNormalState

public boolean isNormalState()
Check if the state is a normal state

Returns:
true is the state is a normal state, false otherwise

isTerminalState

public boolean isTerminalState()
Check if the state is a terminal state

Returns:
true if the state is a terminal state, false otherwise

isLoadChildState

public boolean isLoadChildState()
Check if the state is a load-child state

Returns:
true if the state is of the the type 'load-child', false otherwise

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003