Package javax.net.ssl
Interface SSLSessionContext
- All Known Implementing Classes:
ClientSessionContext,ServerSessionContext
public interface SSLSessionContext
A collection of
SSLSessions.-
Method Summary
Modifier and Type Method Description Enumeration<byte[]>getIds()Returns an iterable of all session identifiers in this session context.SSLSessiongetSession(byte[] sessionId)Returns the session for the specified session identifier.intgetSessionCacheSize()Returns the size of the session cache for this session context.intgetSessionTimeout()Returns the timeout for sessions in this session context.voidsetSessionCacheSize(int size)Sets the size of the session cache for this session context.voidsetSessionTimeout(int seconds)Sets the timeout for sessions in this context.
-
Method Details
-
getIds
Enumeration<byte[]> getIds()Returns an iterable of all session identifiers in this session context.- Returns:
- an iterable of all session identifiers in this session context.
-
getSession
Returns the session for the specified session identifier.- Parameters:
sessionId- the session identifier of the session to look up.- Returns:
- the session for the specified session identifier, or
nullif the specified session identifier does not refer to a session in this context.
-
getSessionCacheSize
int getSessionCacheSize()Returns the size of the session cache for this session context.- Returns:
- the size of the session cache for this session context, or
zeroif unlimited.
-
getSessionTimeout
int getSessionTimeout()Returns the timeout for sessions in this session context. Sessions exceeding the timeout are invalidated.- Returns:
- the timeout in seconds, or
zeroif unlimited.
-
setSessionCacheSize
Sets the size of the session cache for this session context.- Parameters:
size- the size of the session cache, orzerofor unlimited cache size.- Throws:
IllegalArgumentException- ifsizeis negative.
-
setSessionTimeout
Sets the timeout for sessions in this context. Sessions exceeding the timeout are invalidated.- Parameters:
seconds- the timeout in seconds, orzeroif unlimited.- Throws:
IllegalArgumentException- ifsecondsis negative.
-