iaik.security.ssl
Class SessionManager

java.lang.Object
  extended by iaik.security.ssl.SessionManager
Direct Known Subclasses:
DefaultSessionManager

public abstract class SessionManager
extends java.lang.Object

An abstract parent class of all SessionManagers. A SessionManager keeps track of session ids and associated session parameters to allow for a faster SSL handshake.

This class also stores the system's default session manager.

See Also:
DefaultSessionManager, Session

Field Summary
protected  int cacheSizeLimit
          Maxiumum size of the session cache (default: 0 so that there is no limit).
 
Constructor Summary
protected SessionManager()
          Constructor for use by subclasses.
 
Method Summary
protected abstract  void cacheSession(SSLTransport transport, Session session)
          Add this session to the session cache.
 int getCacheSizeLimit()
          Gets the size limit of the session cache.
static SessionManager getDefault()
          Get the current session manager.
protected abstract  Session getSession(SSLTransport transport, java.lang.Object sessionID)
          Get a session from the session cache.
 void setCacheSizeLimit(int size)
          Sets the size limit of the session cache.
static void setDefault(SessionManager manager)
          Set the session manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheSizeLimit

protected int cacheSizeLimit
Maxiumum size of the session cache (default: 0 so that there is no limit).

Constructor Detail

SessionManager

protected SessionManager()
Constructor for use by subclasses.

Method Detail

getDefault

public static SessionManager getDefault()
Get the current session manager. Null if session caching is disabled, Initially set to an instance of DefaultSessionManager.

Returns:
the current session manager

setDefault

public static void setDefault(SessionManager manager)
Set the session manager. Set to null to disable session caching for all SSLContexts created after (!) this call.


cacheSession

protected abstract void cacheSession(SSLTransport transport,
                                     Session session)
Add this session to the session cache.

Parameters:
session - the session to cache
transport - the transport

getSession

protected abstract Session getSession(SSLTransport transport,
                                      java.lang.Object sessionID)
Get a session from the session cache.

Parameters:
transport - the transport
sessionID - a SessionID or null
Returns:
null if the session is not in the cache or the SessionManager wont resume this session; the cached session otherwise

setCacheSizeLimit

public void setCacheSizeLimit(int size)
                       throws java.lang.IllegalArgumentException
Sets the size limit of the session cache.

Parameters:
size - the size limit of the session cache; a size of 0 indicates that the session cache size has no limit
Throws:
java.lang.IllegalArgumentException - if the given size is < 0.

getCacheSizeLimit

public int getCacheSizeLimit()
Gets the size limit of the session cache.

Returns:
the size limit of the session cache; a size of 0 indicates that the session cache size has no limit

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

iSaSiLk 5.104, (c) 2002 IAIK, (c) 2003 - 2015 SIC