deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.security.session
Class Session

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

public class Session
extends java.lang.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(java.lang.String user)
          creates a session that never expires
Session(java.lang.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(java.lang.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(java.lang.Object key, java.lang.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.
 java.lang.Object getAttribute(java.lang.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.
 java.lang.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
 java.lang.Object removeAttribute(java.lang.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(java.lang.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(java.lang.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(java.lang.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 java.lang.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(java.lang.Object key,
                         java.lang.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 java.lang.Object getAttribute(java.lang.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 java.lang.Object removeAttribute(java.lang.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.5 (2011/06/29 09:44 build-8-official)

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