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

org.deegree.security.session
Class SessionID

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

public class SessionID
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
SessionID(int duration)
          The constructor ensures that a sessionID that is unique within the JVM will be created.
SessionID(String id, int duration)
           
 
Method Summary
 void close()
          kills a SessionID by marking it as invalid.
 Date getCreated()
           
 Date getExpiration()
          if sessionID never expires this method returns new Timestamp(0)
 String getId()
          this method throws an exception if the sessinID has been killed or is alive anymore
 boolean isAlive()
          returns true if the expiration date of the SessionID is after the current timestamp
 void reset()
          resets the expiration date to the current timestamp plus duration passed to the constructor when creating the SessionID this method throws an exception if the sessinID has been killed or is alive anymore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionID

public SessionID(int duration)
The constructor ensures that a sessionID that is unique within the JVM will be created. If the sessionID must be unique across two or more JVMs use the construtor SessionID(String, int) and ensure that the passed ID is valid.

Parameters:
duration - duration in millis the ID is valid. -1 indicates that a sessionID never expires.

SessionID

public SessionID(String id,
                 int duration)
Parameters:
id - encapsulated ID
duration - duration in millis the ID is valid. -1 indicates that a sessionID never expires.
Method Detail

getCreated

public Date getCreated()
Returns:
Returns the created.

getExpiration

public Date getExpiration()
if sessionID never expires this method returns new Timestamp(0)

Returns:
Returns the expiration.

getId

public String getId()
             throws SessionStatusException
this method throws an exception if the sessinID has been killed or is alive anymore

Returns:
Returns the id.
Throws:
SessionStatusException

isAlive

public boolean isAlive()
returns true if the expiration date of the SessionID is after the current timestamp

Returns:
true if the expiration date of the SessionID is after the current timestamp

reset

public void reset()
           throws SessionStatusException
resets the expiration date to the current timestamp plus duration passed to the constructor when creating the SessionID this method throws an exception if the sessinID has been killed or is alive anymore

Throws:
SessionStatusException

close

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


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