deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.security.session
Class Session

java.lang.Object
  extended by org.deegree.security.session.Session

public class Session
extends Object

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth , last edited by: $Author: mschneider $

Constructor Summary
Session()
          creates a session that never expires for an anonymous user
Session(int duration)
          creates a session with a specific lifetime for an anonymous user. the expiration date will be updated each time a user accesses his session
Session(SessionID sessionID)
          creates a session with a specific SessionID for an anonymous user. the expiration date will be updated each time a uses accesses his session
Session(String user)
          creates a session that never expires
Session(String user, int duration)
          creates a session with a specific lifetime. the expiration date will be updated each time a uses accesses his session
Session(String user, SessionID sessionID)
          creates a session with a specific SessionID. the expiration date will be updated each time a uses accesses his session
 
Method Summary
 void addAttribute(Object key, Object value)
          adds an attribute to the session. calling this method will reset the expiration date of the encapsulated sessionID
this method throws an exception if the sessinID has been killed or is alive anymore
 void close()
          kills a Session by marking the encapsulated SessionID as invalid.
 Object getAttribute(Object key)
          returns the values of the attribute identified by the passed key. calling this method will reset the expiration date of the encapsulated sessionID
this method throws an exception if the sessinID has been killed or is alive anymore
 SessionID getSessionID()
          returns the sessionID encapsulated in this session.
 String getUser()
          returns the name user the user who owns the session. returns null if its a session for an anonymous user
 boolean isAlive()
          returns true if the session is still alive or false if the expiration date of the sessionID has been reached
 Object removeAttribute(Object key)
          removes the attribute identified by the passed key from the session. calling this method will reset the expiration date of the encapsulated sessionID
this method throws an exception if the sessinID has been killed or is alive anymore
 void reset()
          resets the expiration date of the session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session()
creates a session that never expires for an anonymous user


Session

public Session(String user)
creates a session that never expires

Parameters:
user - user the session is assigned to

Session

public Session(int duration)
creates a session with a specific lifetime for an anonymous user. the expiration date will be updated each time a user accesses his session

Parameters:
duration -

Session

public Session(String user,
               int duration)
creates a session with a specific lifetime. the expiration date will be updated each time a uses accesses his session

Parameters:
duration -
user -

Session

public Session(SessionID sessionID)
creates a session with a specific SessionID for an anonymous user. the expiration date will be updated each time a uses accesses his session

Parameters:
sessionID -

Session

public Session(String user,
               SessionID sessionID)
creates a session with a specific SessionID. the expiration date will be updated each time a uses accesses his session

Parameters:
sessionID -
user -
Method Detail

getUser

public String getUser()
returns the name user the user who owns the session. returns null if its a session for an anonymous user

Returns:
the name user the user who owns the session. returns null if its a session for an anonymous user

addAttribute

public void addAttribute(Object key,
                         Object value)
                  throws SessionStatusException
adds an attribute to the session. calling this method will reset the expiration date of the encapsulated sessionID
this method throws an exception if the sessinID has been killed or is alive anymore

Parameters:
key -
value -
Throws:
SessionStatusException

getAttribute

public Object getAttribute(Object key)
                    throws SessionStatusException
returns the values of the attribute identified by the passed key. calling this method will reset the expiration date of the encapsulated sessionID
this method throws an exception if the sessinID has been killed or is alive anymore

Parameters:
key -
Returns:
the values of the attribute identified by the passed key. calling this method will reset the expiration date of the encapsulated sessionID
Throws:
SessionStatusException

removeAttribute

public Object removeAttribute(Object key)
                       throws SessionStatusException
removes the attribute identified by the passed key from the session. calling this method will reset the expiration date of the encapsulated sessionID
this method throws an exception if the sessinID has been killed or is alive anymore

Parameters:
key -
Returns:
the attribute
Throws:
SessionStatusException

isAlive

public boolean isAlive()
returns true if the session is still alive or false if the expiration date of the sessionID has been reached

Returns:
true if the session is still alive or false if the expiration date of the sessionID has been reached

getSessionID

public SessionID getSessionID()
returns the sessionID encapsulated in this session.

Returns:
the sessionID encapsulated in this session.

close

public void close()
kills a Session by marking the encapsulated SessionID as invalid. A killed SessionID can't be reseted


reset

public void reset()
           throws SessionStatusException
resets the expiration date of the session

Throws:
SessionStatusException

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org