edu.internet2.middleware.shibboleth.common.session.impl
Class AbstractSession

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.session.impl.AbstractSession
All Implemented Interfaces:
Session, Serializable

public abstract class AbstractSession
extends Object
implements Session

Base class for Shibboleth sessions.

See Also:
Serialized Form

Field Summary
private  long inactivityTimeout
          Session inactivity timeout in milliseconds.
private  long lastActivity
          The last activity time of the user.
private static long serialVersionUID
          Serial version UID.
private  String sessionId
          The session ID.
private  Subject subject
          Subject of this session.
 
Constructor Summary
AbstractSession(String id, long timeout)
          Constructor.
 
Method Summary
 long getInactivityTimeout()
          Gets the session inactivity timeout in milliseconds.
 org.joda.time.DateTime getLastActivityInstant()
          Gets the time of the last activity from the user.
 String getPrincipalName()
          A convenience method that gets the first principal retrieved from the Subject.
 String getSessionID()
          Gets the unique identifier of the session.
 Subject getSubject()
          Gets the subject with which this session is associated.
 void setLastActivityInstant(org.joda.time.DateTime activity)
          Sets the time of the last activity from the user.
 void setSubject(Subject newSubject)
          Sets the subject with which this session is associated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version UID.

See Also:
Constant Field Values

sessionId

private final String sessionId
The session ID.


subject

private Subject subject
Subject of this session.


inactivityTimeout

private long inactivityTimeout
Session inactivity timeout in milliseconds.


lastActivity

private long lastActivity
The last activity time of the user.

Constructor Detail

AbstractSession

public AbstractSession(String id,
                       long timeout)
Constructor.

Parameters:
id - ID of the session
timeout - inactivity timeout for the session in milliseconds
Method Detail

getSessionID

public String getSessionID()
Gets the unique identifier of the session.

Specified by:
getSessionID in interface Session
Returns:
unique identifier of the session

getSubject

public Subject getSubject()
Gets the subject with which this session is associated.

Specified by:
getSubject in interface Session
Returns:
subject with which this session is associated

setSubject

public void setSubject(Subject newSubject)
Sets the subject with which this session is associated.

Specified by:
setSubject in interface Session
Parameters:
newSubject - the subject with which this session is associated

getPrincipalName

public String getPrincipalName()
A convenience method that gets the first principal retrieved from the Subject.

Specified by:
getPrincipalName in interface Session
Returns:
principal ID of the user, or null

getInactivityTimeout

public long getInactivityTimeout()
Gets the session inactivity timeout in milliseconds.

Specified by:
getInactivityTimeout in interface Session
Returns:
session inactivity timeout in milliseconds

getLastActivityInstant

public org.joda.time.DateTime getLastActivityInstant()
Gets the time of the last activity from the user.

Specified by:
getLastActivityInstant in interface Session
Returns:
time of the last activity from the user

setLastActivityInstant

public void setLastActivityInstant(org.joda.time.DateTime activity)
Sets the time of the last activity from the user.

Specified by:
setLastActivityInstant in interface Session
Parameters:
activity - time of the last activity from the user


Copyright © 1999-2012. All Rights Reserved.