public class DefaultSessionManager extends SessionManager
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.
cacheSizeLimit
Constructor and Description |
---|
DefaultSessionManager()
Create only one sessin manager for all SSLSockets.
|
Modifier and Type | Method and Description |
---|---|
protected void |
cacheSession(SSLTransport transport,
Session session)
Put a session into the session cache.
|
void |
clear()
Clears the contents of the SessionManager.
|
int |
getCacheSizeLimit()
Gets the size limit of the session cache.
|
long |
getResumePeriod()
Returns the resume period of this session manager.
|
protected Session |
getSession(SSLTransport transport,
java.lang.Object sessionID)
Returns a session from the cache.
|
void |
setCacheSizeLimit(int size)
Sets the size limit of the session cache.
|
void |
setResumePeriod(long period)
Sets the resume period of cached sessions.
|
java.lang.String |
toString()
Returns some statistics about the sessions cache.
|
getDefault, setDefault, setNumberOfTicketsToBeSent
public DefaultSessionManager()
public void setResumePeriod(long period)
setResumePeriod
in class SessionManager
period
- the resume period in secondspublic long getResumePeriod()
getResumePeriod
in class SessionManager
protected void cacheSession(SSLTransport transport, Session session)
cacheSession
in class SessionManager
transport
- the SSLTransport which wants to cache this sessionsession
- the session to cacheprotected Session getSession(SSLTransport transport, java.lang.Object sessionID)
getSession
in class SessionManager
transport
- the SSLTransport which wants to look for a sessionsessionID
- the ID of the session which should be resumed
or null
if this method is called by a SSL client.null
public void setCacheSizeLimit(int size) throws java.lang.IllegalArgumentException
setCacheSizeLimit
in class SessionManager
size
- the size limit of the session cache; a size of 0 indicates
that the session cache size has no limitjava.lang.IllegalArgumentException
- if the given size is < 0.public int getCacheSizeLimit()
getCacheSizeLimit
in class SessionManager
public void clear()
public java.lang.String toString()
toString
in class java.lang.Object