org.enhydra.barracuda.core.util.data
Class HttpSessionStateMap

java.lang.Object
  |
  +--org.enhydra.barracuda.core.util.data.HttpSessionStateMap
All Implemented Interfaces:
StateMap

public class HttpSessionStateMap
extends java.lang.Object
implements StateMap

The implementation provides a StateMap bridge to a HttpSession object. By this, we mean that this class allows you to treat an HttpSession as a StateMap. Unlike the HttpSession, this class will handle null keys, values.


Field Summary
protected  javax.servlet.http.HttpSession session
           
 
Constructor Summary
HttpSessionStateMap(javax.servlet.http.HttpSession isession)
          Public constructor.
 
Method Summary
 javax.servlet.http.HttpSession getSession()
          get a reference to the underlying HttpSession
 java.lang.Object getState(java.lang.Object key)
          get a property in this StateMap
 java.util.List getStateKeys()
          get a List of the keys for this StateMap (implementation is an ArrayList)
 java.util.Map getStateValues()
          get a copy of the underlying Map (in this case, we map all the attributes of the HttpSession structure into a Map and return that)
 void putState(java.lang.Object key, java.lang.Object val)
          set a property in this StateMap
 java.lang.Object removeState(java.lang.Object key)
          remove a property in this StateMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected javax.servlet.http.HttpSession session
Constructor Detail

HttpSessionStateMap

public HttpSessionStateMap(javax.servlet.http.HttpSession isession)
Public constructor.

Method Detail

putState

public void putState(java.lang.Object key,
                     java.lang.Object val)
set a property in this StateMap

Specified by:
putState in interface StateMap
Parameters:
key - the key object
val - the value object

getState

public java.lang.Object getState(java.lang.Object key)
get a property in this StateMap

Specified by:
getState in interface StateMap
Parameters:
key - the key object
Returns:
the value for the given key

removeState

public java.lang.Object removeState(java.lang.Object key)
remove a property in this StateMap

Specified by:
removeState in interface StateMap
Parameters:
key - the key object
Returns:
the object which was removed

getStateKeys

public java.util.List getStateKeys()
get a List of the keys for this StateMap (implementation is an ArrayList)

Specified by:
getStateKeys in interface StateMap
Returns:
a List the keys for this StateMap

getStateValues

public java.util.Map getStateValues()
get a copy of the underlying Map (in this case, we map all the attributes of the HttpSession structure into a Map and return that)

Specified by:
getStateValues in interface StateMap
Returns:
a copy of the underlying state Map

getSession

public javax.servlet.http.HttpSession getSession()
get a reference to the underlying HttpSession

Returns:
a reference to the underlying HttpSession


Copyright © 2001 Enhydra.org