fr.gedeon.telnetservice
Class SessionState

java.lang.Object
  extended by fr.gedeon.telnetservice.StateHolder
      extended by fr.gedeon.telnetservice.SessionState

public final class SessionState
extends StateHolder

Holds the state of the session, as well as that of the integrating application relating to the session.
There is one Session State instance per session, and it is provided by the Session. It is passed as a parameter to most Session initiated methods and may be referenced for future use. In such case, it is strongly recommended to register as a SessionListener and clear the reference on connection lost event.
The session state provides both a holder to store state info as well as a gateway to useful service components attached to this session.

Author:
wgedeon@gmail.com

Constructor Summary
SessionState()
           
 
Method Summary
 void disactivateSession()
          Set session active flag to false
 Session getSession()
           
 Object getStateEntry(String key)
          Retrieve the state entry with the given key.
 boolean isSessionActive()
           
 void putStateEntry(String key, Object value)
          Store the given value with the given key.
 void removeStateEntry(String key)
          Remove the value stored with this key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionState

public SessionState()
Method Detail

getSession

public Session getSession()

isSessionActive

public boolean isSessionActive()

disactivateSession

public void disactivateSession()
Set session active flag to false


getStateEntry

public Object getStateEntry(String key)
                     throws StateEntryNotFoundException
Retrieve the state entry with the given key.

Overrides:
getStateEntry in class StateHolder
Throws:
StateEntryNotFoundException - if there was no state entries with that key.

putStateEntry

public void putStateEntry(String key,
                          Object value)
Store the given value with the given key. The key must be unique, it is recommended to compose the key with the value class name and some other provider specific parts.

Overrides:
putStateEntry in class StateHolder

removeStateEntry

public void removeStateEntry(String key)
Remove the value stored with this key.

Overrides:
removeStateEntry in class StateHolder


Copyright © 2008. All Rights Reserved.