iaik.security.ssl
Class SessionManager

java.lang.Object
  |
  +--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

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.
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.
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
 

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:
socket - the socket which wants to cache this session
session - the session to cache

getSession

protected abstract Session getSession(SSLTransport transport,
                                      java.lang.Object sessionID)
Get a session from the session cache. Notice, that there is a difference whether this method is called from a client or a server.
Parameters:
socket - the socket which wants to look for a session
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