HDIV API 2.0.4

org.hdiv.state
Class Page

java.lang.Object
  extended by org.hdiv.state.Page
All Implemented Interfaces:
java.io.Serializable, IPage

public class Page
extends java.lang.Object
implements IPage, java.io.Serializable

DataStructure to store server states

Author:
Roberto Velasco
See Also:
Serialized Form

Field Summary
protected  java.util.Map states
          Map with the states of the page this.
 
Constructor Summary
Page()
          Creates a new Page object with a new states map.
 
Method Summary
 void addState(IState state)
          Adds a new state to the page this.
 void addState(java.lang.String id, java.lang.String stateHash)
          Adds a new state hash to the page this.
 boolean existState(java.lang.String key)
          Checks if exists a state with the given identifier key.
 java.lang.String getFlowId()
          Returns the unique id of flow.
 java.lang.String getName()
           
 java.lang.String getRandomToken()
           
 IState getState(java.lang.String key)
          Returns the state with the given identifier key from the map of states
 java.lang.String getStateHash(java.lang.String key)
          Returns the state hash with the given identifier key from the map of states
 java.util.Map getStates()
           
 void setFlowId(java.lang.String flowId)
           
 void setName(java.lang.String name)
           
 void setRandomToken(java.lang.String randomToken)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

states

protected java.util.Map states
Map with the states of the page this.

Constructor Detail

Page

public Page()
Creates a new Page object with a new states map.

Method Detail

addState

public void addState(IState state)
Adds a new state to the page this.

Specified by:
addState in interface IPage
Parameters:
state - State that represents all the data that composes a possible request.

addState

public void addState(java.lang.String id,
                     java.lang.String stateHash)
Adds a new state hash to the page this.

Specified by:
addState in interface IPage
Parameters:
id - state identifier
state - Hash of a state that represents all the data that composes a possible request.

existState

public boolean existState(java.lang.String key)
Checks if exists a state with the given identifier key.

Specified by:
existState in interface IPage
Parameters:
key - State identifier

getState

public IState getState(java.lang.String key)
Returns the state with the given identifier key from the map of states

Specified by:
getState in interface IPage
Parameters:
key - State identifier
Returns:
IState State with the identifier key.

getStateHash

public java.lang.String getStateHash(java.lang.String key)
Returns the state hash with the given identifier key from the map of states

Specified by:
getStateHash in interface IPage
Parameters:
key - State identifier
Returns:
String hash with the identifier key.

getName

public java.lang.String getName()
Specified by:
getName in interface IPage
Returns:
Returns the page name.

setName

public void setName(java.lang.String name)
Specified by:
setName in interface IPage
Parameters:
name - The page name to set.

getStates

public java.util.Map getStates()
Specified by:
getStates in interface IPage
Returns:
Returns the page states.

getFlowId

public java.lang.String getFlowId()
Returns the unique id of flow.

Specified by:
getFlowId in interface IPage
Returns:
the flow id

setFlowId

public void setFlowId(java.lang.String flowId)
Specified by:
setFlowId in interface IPage
Parameters:
flowId - the flowId to set

getRandomToken

public java.lang.String getRandomToken()
Specified by:
getRandomToken in interface IPage
Returns:
the randomToken
Since:
HDIV 2.0.4

setRandomToken

public void setRandomToken(java.lang.String randomToken)
Specified by:
setRandomToken in interface IPage
Parameters:
randomToken - the randomToken to set
Since:
HDIV 2.0.4

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.