All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iaik.security.ssl.DefaultSessionManager

java.lang.Object
   |
   +----iaik.security.ssl.DefaultSessionManager

public class DefaultSessionManager
extends Object
implements SessionManager
This class implements a simple default SessionManager. Sessions are stored with the IP address of the peer as key. To get a session from the cache a SSL server calls getSession(addr, id) with the IP address of the client and the session id if the client wants to resume a previous session. If there is no session in the cache or if the cached session has a differend id this method returns null.

A SSL client calls this method with no session id (= null). If there already exists a session to this host the client tries to resume it.


Method Index

 o cacheSession(Session)
Put a session into the session cache.
 o getManager()
Return one session manager for all SSLSockets.
 o getResumePeriod()
Returns the resume period of this session manager.
 o getSession(InetAddress, SessionID)
Returns a session form the cache.
 o setResumePeriod(long)
Sets the resume period of cached sessions.
 o toString()
Returns some statistics about the sessions cache.

Methods

 o getManager
 public static synchronized SessionManager getManager()
Return one session manager for all SSLSockets.

Returns:
the session manager
 o setResumePeriod
 public void setResumePeriod(long period)
Sets the resume period of cached sessions. After this time a session is removed from the session cache and therefore cann't be resumed. If the SSLSocket connects again to this host he has to renegotiate the security parameters.

Parameters:
period - the resume period in seconds
 o getResumePeriod
 public long getResumePeriod()
Returns the resume period of this session manager.

Returns:
the resume period
 o cacheSession
 public void cacheSession(Session session)
Put a session into the session cache. This method first removes sessions which are longer than the resume periode in the cache.

Parameters:
session - the session to cache
 o getSession
 public Session getSession(InetAddress addr,
                           SessionID sessionID)
Returns a session form the cache. This method first removes sessions which are longer than the resume periode in the cache.

Parameters:
addr - the IP address of the peer
sessionID - the ID of the session which should be resumed or null if this method is called by a SSL client.
Returns:
the session from the cache or null
 o toString
 public String toString()
Returns some statistics about the sessions cache.

Returns:
a string representation of some statistics
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index