Package io.netty.handler.ssl
Class OpenSslSessionCache
java.lang.Object
io.netty.handler.ssl.OpenSslSessionCache
- All Implemented Interfaces:
io.netty.internal.tcnative.SSLSessionCache
- Direct Known Subclasses:
OpenSslClientSessionCache
SSLSessionCache
implementation for our native SSL implementation.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
OpenSslInternalSession
implementation which wraps the native SSL_SESSION* while in cache. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final OpenSslInternalSession[]
private final OpenSslEngineMap
private final AtomicInteger
private int
private final Map
<OpenSslSessionId, OpenSslSessionCache.NativeSslSession> private final AtomicInteger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
clear()
Clear the cache and free all cached SSL_SESSION*.(package private) final boolean
Returnstrue
if there is a session for the given id in the cache.private void
(package private) final List
<OpenSslSessionId> getIds()
Returns a snapshot of the session ids of the current valid sessions.final long
getSession
(long ssl, byte[] sessionId) (package private) final OpenSslInternalSession
Return theOpenSslInternalSession
which is cached for the given id.(package private) final int
(package private) final int
private void
(package private) final void
Remove the session with the given id from the cacheboolean
sessionCreated
(long ssl, long sslSession) protected boolean
Called once a newOpenSslInternalSession
was created.protected void
Called once anOpenSslInternalSession
was removed from the cache.(package private) boolean
setSession
(long ssl, OpenSslInternalSession session, String host, int port) (package private) final void
setSessionCacheSize
(int size) (package private) final void
setSessionTimeout
(int seconds)
-
Field Details
-
EMPTY_SESSIONS
-
DEFAULT_CACHE_SIZE
private static final int DEFAULT_CACHE_SIZE -
engineMap
-
sessions
-
maximumCacheSize
-
sessionTimeout
-
sessionCounter
private int sessionCounter
-
-
Constructor Details
-
OpenSslSessionCache
OpenSslSessionCache(OpenSslEngineMap engineMap)
-
-
Method Details
-
setSessionTimeout
final void setSessionTimeout(int seconds) -
getSessionTimeout
final int getSessionTimeout() -
sessionCreated
Called once a newOpenSslInternalSession
was created.- Parameters:
session
- the new session.- Returns:
true
if the session should be cached,false
otherwise.
-
sessionRemoved
Called once anOpenSslInternalSession
was removed from the cache.- Parameters:
session
- the session to remove.
-
setSessionCacheSize
final void setSessionCacheSize(int size) -
getSessionCacheSize
final int getSessionCacheSize() -
expungeInvalidSessions
private void expungeInvalidSessions() -
sessionCreated
public boolean sessionCreated(long ssl, long sslSession) - Specified by:
sessionCreated
in interfaceio.netty.internal.tcnative.SSLSessionCache
-
getSession
public final long getSession(long ssl, byte[] sessionId) - Specified by:
getSession
in interfaceio.netty.internal.tcnative.SSLSessionCache
-
setSession
-
removeSessionWithId
Remove the session with the given id from the cache -
containsSessionWithId
Returnstrue
if there is a session for the given id in the cache. -
notifyRemovalAndFree
-
getSession
Return theOpenSslInternalSession
which is cached for the given id. -
getIds
Returns a snapshot of the session ids of the current valid sessions. -
clear
void clear()Clear the cache and free all cached SSL_SESSION*.
-