org.n52.security.common.protocol.artifact
Class SessionInfo

java.lang.Object
  extended byorg.n52.security.common.protocol.artifact.SessionInfo
All Implemented Interfaces:
TransferableCreator

public class SessionInfo
extends java.lang.Object
implements TransferableCreator

This class represents a user session with either Web Authentication Service or Web Security Service.


Constructor Summary
SessionInfo(int sessionTimeout, java.lang.String issuerName, java.lang.String issuerURL, java.lang.String status, javax.security.auth.Subject subject)
          Creates a new session object storing the session data.
SessionInfo(java.lang.String sessionID)
           
 
Method Summary
 SessionInfo close()
          Changes session status to closed.
static SessionInfo createFromXML(java.io.InputStream pSessionStream)
           
 Transferable getAsTransferable()
           
 java.util.Date getExpiry()
          Return the expiration date for this session.
 java.lang.String getExpiryFormatted()
          Return the expiration date as string according to ISO 8601:1988(E) (yyyy-MM-ddThh:mm:ss:SSSZ).
 java.lang.String getID()
          Returns the session id.
 javax.security.auth.Subject getSubject()
          Returns the subject bound to this session.
 java.lang.String toString()
           
 void update(int secs)
          Renews this session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SessionInfo

public SessionInfo(java.lang.String sessionID)

SessionInfo

public SessionInfo(int sessionTimeout,
                   java.lang.String issuerName,
                   java.lang.String issuerURL,
                   java.lang.String status,
                   javax.security.auth.Subject subject)
Creates a new session object storing the session data.

Parameters:
sessionTimeout - session duration in seconds
issuerName - name of service, which created this session
issuerURL - URL of service, which created this session
status - session status, i.e. opened or closed
subject - represents the user bound to this session
Method Detail

close

public SessionInfo close()
Changes session status to closed.

Returns:
this session object with status closed

getExpiry

public java.util.Date getExpiry()
Return the expiration date for this session.

Returns:
expiration date

getExpiryFormatted

public java.lang.String getExpiryFormatted()
Return the expiration date as string according to ISO 8601:1988(E) (yyyy-MM-ddThh:mm:ss:SSSZ).

Returns:
expiration date in ISO 8601:1998(E)

getID

public java.lang.String getID()
Returns the session id.

Returns:
session id

createFromXML

public static SessionInfo createFromXML(java.io.InputStream pSessionStream)

getSubject

public javax.security.auth.Subject getSubject()
Returns the subject bound to this session.

Returns:
associated subject.

update

public void update(int secs)
Renews this session. The expiration date is incremented by a given number of seconds

Parameters:
secs - number of seconds to be added

getAsTransferable

public Transferable getAsTransferable()
Specified by:
getAsTransferable in interface TransferableCreator

toString

public java.lang.String toString()


Copyright © 2004-2007 52 North. All Rights Reserved.