Top Description Inners Fields Constructors Methods
io.netty.handler.ssl

pack-priv Class OpenSslSessionCache

extends Object
implements SSLSessionCache
Class Inheritance
All Implemented Interfaces
io.netty.internal.tcnative.SSLSessionCache
Known Direct Subclasses
io.netty.handler.ssl.OpenSslClientSessionCache
Imports
io.netty.internal.tcnative.SSLSession, .SSLSessionCache, io.netty.util.ResourceLeakDetector, .ResourceLeakDetectorFactory, .ResourceLeakTracker, io.netty.util.internal.EmptyArrays, .SystemPropertyUtil, javax.security.cert.X509Certificate, java.security.Principal, java.security.cert.Certificate, java.util.ArrayList, .Iterator, .LinkedHashMap, .List, .Map, java.util.concurrent.atomic.AtomicInteger

SSLSessionCache implementation for our native SSL implementation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
OpenSslSessionCache.NativeSslSession

OpenSslSession implementation which wraps the native SSL_SESSION* while in cache.

Field Summary

Modifier and TypeField and Description
private static final int
private static final OpenSslSession[]
private final OpenSslEngineMap
private final AtomicInteger
private int
private final Map<OpenSslSessionId, OpenSslSessionCache.NativeSslSession>
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized void
clear()

Clear the cache and free all cached SSL_SESSION*.

pack-priv final synchronized boolean
containsSessionWithId(OpenSslSessionId id)

Returns true if there is a session for the given id in the cache.

private void
pack-priv final List<OpenSslSessionId>
getIds()

Returns a snapshot of the session ids of the current valid sessions.

public final long
getSession(long
{code SSL_CTX*}
ssl
,
byte[]
the session id
sessionId
)

Implements io.netty.internal.tcnative.SSLSessionCache.getSession.

Called once a SSL_SESSION should be retrieved for the given SSL and with the given session ID. See SSL_CTX_sess_set_get_cb.
pack-priv final synchronized OpenSslSession
getSession(OpenSslSessionId id)

Return the OpenSslSession which is cached for the given id.

pack-priv final int
pack-priv final int
private void
pack-priv final synchronized void
removeSessionWithId(OpenSslSessionId id)

Remove the session with the given id from the cache

protected boolean

Returns:

true if the session should be cached, false otherwise.
sessionCreated
(OpenSslSessionCache.NativeSslSession
the new session.
session
)

Called once a new OpenSslSession was created.

public boolean
sessionCreated(long
SSL*
ssl
,
long
SSL_SESSION*
sslSession
)

Implements io.netty.internal.tcnative.SSLSessionCache.sessionCreated.

Returns true if the cache takes ownership of the SSL_SESSION and will call SSL_SESSION_free once it should be destroyed, false otherwise.
protected void
sessionRemoved(OpenSslSessionCache.NativeSslSession
the session to remove.
session
)

Called once an OpenSslSession was removed from the cache.

pack-priv boolean
setSession(long ssl, OpenSslSession session, String host, int port)

pack-priv final void
pack-priv final void
setSessionTimeout(int seconds)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_CACHE_SIZEback to summary
private static final int DEFAULT_CACHE_SIZE
EMPTY_SESSIONSback to summary
private static final OpenSslSession[] EMPTY_SESSIONS
engineMapback to summary
private final OpenSslEngineMap engineMap
maximumCacheSizeback to summary
private final AtomicInteger maximumCacheSize
sessionCounterback to summary
private int sessionCounter
sessionsback to summary
private final Map<OpenSslSessionId, OpenSslSessionCache.NativeSslSession> sessions
sessionTimeoutback to summary
private final AtomicInteger sessionTimeout

Constructor Detail

OpenSslSessionCacheback to summary
pack-priv OpenSslSessionCache(OpenSslEngineMap engineMap)

Method Detail

clearback to summary
pack-priv synchronized void clear()

Clear the cache and free all cached SSL_SESSION*.

containsSessionWithIdback to summary
pack-priv final synchronized boolean containsSessionWithId(OpenSslSessionId id)

Returns true if there is a session for the given id in the cache.

expungeInvalidSessionsback to summary
private void expungeInvalidSessions()
getIdsback to summary
pack-priv final List<OpenSslSessionId> getIds()

Returns a snapshot of the session ids of the current valid sessions.

getSessionback to summary
public final long getSession(long ssl, byte[] sessionId)

Implements io.netty.internal.tcnative.SSLSessionCache.getSession.

Doc from io.netty.internal.tcnative.SSLSessionCache.getSession.

Called once a SSL_SESSION should be retrieved for the given SSL and with the given session ID. See SSL_CTX_sess_set_get_cb. If the session is shared you need to call SSLSession#upRef(long) explicit in this callback and explicit free all SSL_SESSIONs once the cache is destroyed via SSLSession#free(long).

Parameters
ssl:long

{code SSL_CTX*}

sessionId:byte[]

the session id

Returns:long

the SSL_SESSION or -1 if none was found in the cache.

Annotations
@Override
getSessionback to summary
pack-priv final synchronized OpenSslSession getSession(OpenSslSessionId id)

Return the OpenSslSession which is cached for the given id.

getSessionCacheSizeback to summary
pack-priv final int getSessionCacheSize()
getSessionTimeoutback to summary
pack-priv final int getSessionTimeout()
notifyRemovalAndFreeback to summary
private void notifyRemovalAndFree(OpenSslSessionCache.NativeSslSession session)
removeSessionWithIdback to summary
pack-priv final synchronized void removeSessionWithId(OpenSslSessionId id)

Remove the session with the given id from the cache

sessionCreatedback to summary
protected boolean sessionCreated(OpenSslSessionCache.NativeSslSession session)

Called once a new OpenSslSession was created.

Parameters
session:OpenSslSessionCache.NativeSslSession

the new session.

Returns:boolean

true if the session should be cached, false otherwise.

sessionCreatedback to summary
public boolean sessionCreated(long ssl, long sslSession)

Implements io.netty.internal.tcnative.SSLSessionCache.sessionCreated.

Doc from io.netty.internal.tcnative.SSLSessionCache.sessionCreated.

Returns true if the cache takes ownership of the SSL_SESSION and will call SSL_SESSION_free once it should be destroyed, false otherwise. See SSL_CTX_sess_set_new_cb.

Parameters
ssl:long

SSL*

sslSession:long

SSL_SESSION*

Returns:boolean

true if session ownership was transfered, false if not.

Annotations
@Override
sessionRemovedback to summary
protected void sessionRemoved(OpenSslSessionCache.NativeSslSession session)

Called once an OpenSslSession was removed from the cache.

Parameters
session:OpenSslSessionCache.NativeSslSession

the session to remove.

setSessionback to summary
pack-priv boolean setSession(long ssl, OpenSslSession session, String host, int port)
setSessionCacheSizeback to summary
pack-priv final void setSessionCacheSize(int size)
setSessionTimeoutback to summary
pack-priv final void setSessionTimeout(int seconds)
io.netty.handler.ssl back to summary

pack-priv final Class OpenSslSessionCache.NativeSslSession

extends Object
implements OpenSslSession
Class Inheritance
All Implemented Interfaces
io.netty.handler.ssl.OpenSslSession, javax.net.ssl.SSLSession

OpenSslSession implementation which wraps the native SSL_SESSION* while in cache.

Field Summary

Modifier and TypeField and Description
private final long
private boolean
private final OpenSslSessionId
pack-priv final Map<String, Object>
private volatile long
pack-priv static final ResourceLeakDetector<OpenSslSessionCache.NativeSslSession>
private final ResourceLeakTracker<OpenSslSessionCache.NativeSslSession>
private final String
private final int
private final long
private final long
private volatile boolean

Constructor Summary

AccessConstructor and Description
pack-priv
NativeSslSession(long session, String peerHost, int peerPort, long timeout, Map<String, Object> keyValueStorage)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
pack-priv synchronized void
free()

public int
getApplicationBufferSize()

Implements javax.net.ssl.SSLSession.getApplicationBufferSize.

Gets the current size of the largest application data that is expected when using this session.
public String
getCipherSuite()

Implements javax.net.ssl.SSLSession.getCipherSuite.

Returns the name of the SSL cipher suite which is used for all connections in the session.
public long
getCreationTime()

Implements javax.net.ssl.SSLSession.getCreationTime.

Returns the time at which this Session representation was created, in milliseconds since midnight, January 1, 1970 UTC.
public byte[]
getId()

Implements javax.net.ssl.SSLSession.getId.

Returns the identifier assigned to this Session.
public long
getLastAccessedTime()

Implements javax.net.ssl.SSLSession.getLastAccessedTime.

Returns the last time this Session representation was accessed by the session level infrastructure, in milliseconds since midnight, January 1, 1970 UTC.
public Certificate[]
getLocalCertificates()

Implements javax.net.ssl.SSLSession.getLocalCertificates.

Returns the certificate(s) that were sent to the peer during handshaking.
public Principal
getLocalPrincipal()

Implements javax.net.ssl.SSLSession.getLocalPrincipal.

Returns the principal that was sent to the peer during handshaking.
public int
getPacketBufferSize()

Implements javax.net.ssl.SSLSession.getPacketBufferSize.

Gets the current size of the largest SSL/TLS/DTLS packet that is expected when using this session.
public X509Certificate[]
getPeerCertificateChain()

Overrides default javax.net.ssl.SSLSession.getPeerCertificateChain.

Deprecated as a consequence of X509Certificate being deprecated.
Returns the identity of the peer which was identified as part of defining the session.
public Certificate[]
getPeerCertificates()

Implements javax.net.ssl.SSLSession.getPeerCertificates.

Returns the identity of the peer which was established as part of defining the session.
public String
getPeerHost()

Implements javax.net.ssl.SSLSession.getPeerHost.

Returns the host name of the peer in this session.
public int
getPeerPort()

Implements javax.net.ssl.SSLSession.getPeerPort.

Returns the port number of the peer in this session.
public Principal
getPeerPrincipal()

Implements javax.net.ssl.SSLSession.getPeerPrincipal.

Returns the identity of the peer which was established as part of defining the session.
public String
getProtocol()

Implements javax.net.ssl.SSLSession.getProtocol.

Returns the standard name of the protocol used for all connections in the session.
public OpenSslSessionContext
getSessionContext()

Implements io.netty.handler.ssl.OpenSslSession.getSessionContext.

Returns the context in which this session is bound.
public Object
getValue(String
the name of the binding to find.
name
)

Implements javax.net.ssl.SSLSession.getValue.

Returns the object bound to the given name in the session's application layer data.
public String[]
getValueNames()

Implements javax.net.ssl.SSLSession.getValueNames.

Returns an array of the names of all the application layer data objects bound into the Session.
public void
handshakeFinished(byte[] id, String cipher, String protocol, byte[] peerCertificate, byte[][] peerCertificateChain, long creationTime, long timeout)

Implements io.netty.handler.ssl.OpenSslSession.handshakeFinished.

Called once the handshake has completed.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public void
invalidate()

Implements javax.net.ssl.SSLSession.invalidate.

Invalidates the session.
pack-priv boolean
isValid(long now)

public boolean
isValid()

Implements javax.net.ssl.SSLSession.isValid.

Returns whether this session is valid and available for resuming or joining.
public Map<String, Object>
public void
prepareHandshake()

Implements io.netty.handler.ssl.OpenSslSession.prepareHandshake.

Called on a handshake session before being exposed to a javax.net.ssl.TrustManager.
public void
putValue(String
the name to which the data object will be bound. This may not be null.
name
,
Object
the data object to be bound. This may not be null.
value
)

Implements javax.net.ssl.SSLSession.putValue.

Binds the specified value object into the session's application layer data with the given name.
public void
removeValue(String
the name of the object to remove visible across different access control contexts
name
)

Implements javax.net.ssl.SSLSession.removeValue.

Removes the object bound to the given name in the session's application layer data.
pack-priv long
public OpenSslSessionId
sessionId()

Implements io.netty.handler.ssl.OpenSslSession.sessionId.

Return the OpenSslSessionId that can be used to identify this session.
public void
setLastAccessedTime(long
the time
time
)

Implements io.netty.handler.ssl.OpenSslSession.setLastAccessedTime.

Set the last access time which will be returned by getLastAccessedTime().
public void
setLocalCertificate(Certificate[] localCertificate)

Implements io.netty.handler.ssl.OpenSslSession.setLocalCertificate.

Set the local certificate chain that is used.
public void
setSessionDetails(long
the time at which the session was created.
creationTime
,
long
the time at which the session was last accessed via the session infrastructure (cache).
lastAccessedTime
,
OpenSslSessionId id, Map<String, Object>
the key value store. See keyValueStorage().
keyValueStorage
)

Implements io.netty.handler.ssl.OpenSslSession.setSessionDetails.

Set the details for the session which might come from a cache.
pack-priv boolean
public void
tryExpandApplicationBufferSize(int
The packet size which exceeds the current getApplicationBufferSize().
packetLengthDataOnly
)

Implements io.netty.handler.ssl.OpenSslSession.tryExpandApplicationBufferSize.

Expand (or increase) the value returned by getApplicationBufferSize() if necessary.
pack-priv boolean
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

creationTimeback to summary
private final long creationTime
freedback to summary
private boolean freed
idback to summary
private final OpenSslSessionId id
keyValueStorageback to summary
pack-priv final Map<String, Object> keyValueStorage
lastAccessedTimeback to summary
private volatile long lastAccessedTime
LEAK_DETECTORback to summary
pack-priv static final ResourceLeakDetector<OpenSslSessionCache.NativeSslSession> LEAK_DETECTOR
leakTrackerback to summary
private final ResourceLeakTracker<OpenSslSessionCache.NativeSslSession> leakTracker
peerHostback to summary
private final String peerHost
peerPortback to summary
private final int peerPort
sessionback to summary
private final long session
timeoutback to summary
private final long timeout
validback to summary
private volatile boolean valid

Constructor Detail

NativeSslSessionback to summary
pack-priv NativeSslSession(long session, String peerHost, int peerPort, long timeout, Map<String, Object> keyValueStorage)

Method Detail

closeback to summary
pack-priv void close()
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
freeback to summary
pack-priv synchronized void free()
getApplicationBufferSizeback to summary
public int getApplicationBufferSize()

Implements javax.net.ssl.SSLSession.getApplicationBufferSize.

Doc from javax.net.ssl.SSLSession.getApplicationBufferSize.

Gets the current size of the largest application data that is expected when using this session.

SSLEngine application data buffers must be large enough to hold the application data from any inbound network application data packet received. Typically, outbound application data buffers can be of any size.

Returns:int

the current maximum expected application packet size

Annotations
@Override
getCipherSuiteback to summary
public String getCipherSuite()

Implements javax.net.ssl.SSLSession.getCipherSuite.

Doc from javax.net.ssl.SSLSession.getCipherSuite.

Returns the name of the SSL cipher suite which is used for all connections in the session.

This defines the level of protection provided to the data sent on the connection, including the kind of encryption used and most aspects of how authentication is done.

Returns:String

the name of the session's cipher suite

Annotations
@Override
getCreationTimeback to summary
public long getCreationTime()

Implements javax.net.ssl.SSLSession.getCreationTime.

Doc from javax.net.ssl.SSLSession.getCreationTime.

Returns the time at which this Session representation was created, in milliseconds since midnight, January 1, 1970 UTC.

Returns:long

the time this Session was created

Annotations
@Override
getIdback to summary
public byte[] getId()

Implements javax.net.ssl.SSLSession.getId.

Doc from javax.net.ssl.SSLSession.getId.

Returns the identifier assigned to this Session.

Returns:byte[]

the Session identifier

Annotations
@Override
getLastAccessedTimeback to summary
public long getLastAccessedTime()

Implements javax.net.ssl.SSLSession.getLastAccessedTime.

Doc from javax.net.ssl.SSLSession.getLastAccessedTime.

Returns the last time this Session representation was accessed by the session level infrastructure, in milliseconds since midnight, January 1, 1970 UTC.

Access indicates a new connection being established using session data. Application level operations, such as getting or setting a value associated with the session, are not reflected in this access time.

This information is particularly useful in session management policies. For example, a session manager thread could leave all sessions in a given context which haven't been used in a long time; or, the sessions might be sorted according to age to optimize some task.

Returns:long

the last time this Session was accessed

Annotations
@Override
getLocalCertificatesback to summary
public Certificate[] getLocalCertificates()

Implements javax.net.ssl.SSLSession.getLocalCertificates.

Doc from javax.net.ssl.SSLSession.getLocalCertificates.

Returns the certificate(s) that were sent to the peer during handshaking.

Note

This method is useful only when using certificate-based cipher suites.

When multiple certificates are available for use in a handshake, the implementation chooses what it considers the "best" certificate chain available, and transmits that to the other side. This method allows the caller to know which certificate chain was actually used.

Returns:Certificate[]

an ordered array of certificates, with the local certificate first followed by any certificate authorities. If no certificates were sent, then null is returned.

Annotations
@Override
getLocalPrincipalback to summary
public Principal getLocalPrincipal()

Implements javax.net.ssl.SSLSession.getLocalPrincipal.

Doc from javax.net.ssl.SSLSession.getLocalPrincipal.

Returns the principal that was sent to the peer during handshaking.

Returns:Principal

the principal sent to the peer. Returns an X500Principal of the end-entity certificate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites. If no principal was sent, then null is returned.

Annotations
@Override
getPacketBufferSizeback to summary
public int getPacketBufferSize()

Implements javax.net.ssl.SSLSession.getPacketBufferSize.

Doc from javax.net.ssl.SSLSession.getPacketBufferSize.

Gets the current size of the largest SSL/TLS/DTLS packet that is expected when using this session.

An SSLEngine using this session may generate SSL/TLS/DTLS packets of any size up to and including the value returned by this method. All SSLEngine network buffers should be sized at least this large to avoid insufficient space problems when performing wrap and unwrap calls.

Returns:int

the current maximum expected network packet size

Annotations
@Override
getPeerCertificateChainback to summary
public X509Certificate[] getPeerCertificateChain()

Overrides default javax.net.ssl.SSLSession.getPeerCertificateChain.

Doc from javax.net.ssl.SSLSession.getPeerCertificateChain.

Deprecated

as a consequence of X509Certificate being deprecated. See corresponding docs for further information.

Returns the identity of the peer which was identified as part of defining the session.

Note

This method can be used only when using certificate-based cipher suites; using it with non-certificate-based cipher suites, such as Kerberos, will throw an SSLPeerUnverifiedException.

Note

The returned value may not be a valid certificate chain and should not be relied on for trust decisions.

Note

this method exists for compatibility with previous releases. New applications should use getPeerCertificates instead.

Returns:X509Certificate[]

an ordered array of peer X.509 certificates, with the peer's own certificate first followed by any certificate authorities. (The certificates are in the original JSSE certificate javax.security.cert.X509Certificate format.)

Annotations
@Override
getPeerCertificatesback to summary
public Certificate[] getPeerCertificates()

Implements javax.net.ssl.SSLSession.getPeerCertificates.

Doc from javax.net.ssl.SSLSession.getPeerCertificates.

Returns the identity of the peer which was established as part of defining the session.

Note

This method can be used only when using certificate-based cipher suites; using it with non-certificate-based cipher suites, such as Kerberos, will throw an SSLPeerUnverifiedException.

Note

The returned value may not be a valid certificate chain and should not be relied on for trust decisions.

Returns:Certificate[]

an ordered array of peer certificates, with the peer's own certificate first followed by any certificate authorities.

Annotations
@Override
getPeerHostback to summary
public String getPeerHost()

Implements javax.net.ssl.SSLSession.getPeerHost.

Doc from javax.net.ssl.SSLSession.getPeerHost.

Returns the host name of the peer in this session.

For the server, this is the client's host; and for the client, it is the server's host. The name may not be a fully qualified host name or even a host name at all as it may represent a string encoding of the peer's network address. If such a name is desired, it might be resolved through a name service based on the value returned by this method.

This value is not authenticated and should not be relied upon. It is mainly used as a hint for SSLSession caching strategies.

Returns:String

the host name of the peer host, or null if no information is available.

Annotations
@Override
getPeerPortback to summary
public int getPeerPort()

Implements javax.net.ssl.SSLSession.getPeerPort.

Doc from javax.net.ssl.SSLSession.getPeerPort.

Returns the port number of the peer in this session.

For the server, this is the client's port number; and for the client, it is the server's port number.

This value is not authenticated and should not be relied upon. It is mainly used as a hint for SSLSession caching strategies.

Returns:int

the port number of the peer host, or -1 if no information is available.

Annotations
@Override
getPeerPrincipalback to summary
public Principal getPeerPrincipal()

Implements javax.net.ssl.SSLSession.getPeerPrincipal.

Doc from javax.net.ssl.SSLSession.getPeerPrincipal.

Returns the identity of the peer which was established as part of defining the session.

Returns:Principal

the peer's principal. Returns an X500Principal of the end-entity certificate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites.

Annotations
@Override
getProtocolback to summary
public String getProtocol()

Implements javax.net.ssl.SSLSession.getProtocol.

Doc from javax.net.ssl.SSLSession.getProtocol.

Returns the standard name of the protocol used for all connections in the session.

This defines the protocol used in the connection.

Returns:String

the standard name of the protocol used for all connections in the session.

Annotations
@Override
getSessionContextback to summary
public OpenSslSessionContext getSessionContext()

Implements io.netty.handler.ssl.OpenSslSession.getSessionContext.

Doc from javax.net.ssl.SSLSession.getSessionContext.

Returns the context in which this session is bound.

This context may be unavailable in some environments, in which case this method returns null.

If the context is available and there is a security manager installed, the caller may require permission to access it or a security exception may be thrown. In a Java environment, the security manager's checkPermission method is called with a SSLPermission("getSSLSessionContext") permission.

Returns:OpenSslSessionContext

the session context used for this session, or null if the context is unavailable.

Annotations
@Override
getValueback to summary
public Object getValue(String name)

Implements javax.net.ssl.SSLSession.getValue.

Doc from javax.net.ssl.SSLSession.getValue.

Returns the object bound to the given name in the session's application layer data. Returns null if there is no such binding.

For security reasons, the same named values may not be visible across different access control contexts.

Parameters
name:String

the name of the binding to find.

Returns:Object

the value bound to that name, or null if the binding does not exist.

Annotations
@Override
getValueNamesback to summary
public String[] getValueNames()

Implements javax.net.ssl.SSLSession.getValueNames.

Doc from javax.net.ssl.SSLSession.getValueNames.

Returns an array of the names of all the application layer data objects bound into the Session.

For security reasons, the same named values may not be visible across different access control contexts.

Returns:String[]

a non-null (possibly empty) array of names of the objects bound to this Session.

Annotations
@Override
handshakeFinishedback to summary
public void handshakeFinished(byte[] id, String cipher, String protocol, byte[] peerCertificate, byte[][] peerCertificateChain, long creationTime, long timeout)

Implements io.netty.handler.ssl.OpenSslSession.handshakeFinished.

Doc from io.netty.handler.ssl.OpenSslSession.handshakeFinished.

Called once the handshake has completed.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
invalidateback to summary
public void invalidate()

Implements javax.net.ssl.SSLSession.invalidate.

Doc from javax.net.ssl.SSLSession.invalidate.

Invalidates the session.

Future connections will not be able to resume or join this session. However, any existing connection using this session can continue to use the session until the connection is closed.

Annotations
@Override
isValidback to summary
pack-priv boolean isValid(long now)
isValidback to summary
public boolean isValid()

Implements javax.net.ssl.SSLSession.isValid.

Doc from javax.net.ssl.SSLSession.isValid.

Returns whether this session is valid and available for resuming or joining.

Returns:boolean

true if this session may be rejoined.

Annotations
@Override
keyValueStorageback to summary
public Map<String, Object> keyValueStorage()

Implements io.netty.handler.ssl.OpenSslSession.keyValueStorage.

Doc from io.netty.handler.ssl.OpenSslSession.keyValueStorage.

Return the underlying Map that is used by the following methods:

The Map must be thread-safe!
Returns:Map<String, Object>

storage

Annotations
@Override
prepareHandshakeback to summary
public void prepareHandshake()

Implements io.netty.handler.ssl.OpenSslSession.prepareHandshake.

Doc from io.netty.handler.ssl.OpenSslSession.prepareHandshake.

Called on a handshake session before being exposed to a javax.net.ssl.TrustManager. Session data must be cleared by this call.

Annotations
@Override
putValueback to summary
public void putValue(String name, Object value)

Implements javax.net.ssl.SSLSession.putValue.

Doc from javax.net.ssl.SSLSession.putValue.

Binds the specified value object into the session's application layer data with the given name.

Any existing binding using the same name is replaced. If the new (or existing) value implements the SSLSessionBindingListener interface, the object represented by value is notified appropriately.

For security reasons, the same named values may not be visible across different access control contexts.

Parameters
name:String

the name to which the data object will be bound. This may not be null.

value:Object

the data object to be bound. This may not be null.

Annotations
@Override
removeValueback to summary
public void removeValue(String name)

Implements javax.net.ssl.SSLSession.removeValue.

Doc from javax.net.ssl.SSLSession.removeValue.

Removes the object bound to the given name in the session's application layer data. Does nothing if there is no object bound to the given name. If the bound existing object implements the SSLSessionBindingListener interface, it is notified appropriately.

For security reasons, the same named values may not be visible across different access control contexts.

Parameters
name:String

the name of the object to remove visible across different access control contexts

Annotations
@Override
sessionback to summary
pack-priv long session()
sessionIdback to summary
public OpenSslSessionId sessionId()

Implements io.netty.handler.ssl.OpenSslSession.sessionId.

Doc from io.netty.handler.ssl.OpenSslSession.sessionId.

Return the OpenSslSessionId that can be used to identify this session.

Annotations
@Override
setLastAccessedTimeback to summary
public void setLastAccessedTime(long time)

Implements io.netty.handler.ssl.OpenSslSession.setLastAccessedTime.

Doc from io.netty.handler.ssl.OpenSslSession.setLastAccessedTime.

Set the last access time which will be returned by getLastAccessedTime().

Parameters
time:long

the time

Annotations
@Override
setLocalCertificateback to summary
public void setLocalCertificate(Certificate[] localCertificate)

Implements io.netty.handler.ssl.OpenSslSession.setLocalCertificate.

Doc from io.netty.handler.ssl.OpenSslSession.setLocalCertificate.

Set the local certificate chain that is used. It is not expected that this array will be changed at all and so its ok to not copy the array.

Annotations
@Override
setSessionDetailsback to summary
public void setSessionDetails(long creationTime, long lastAccessedTime, OpenSslSessionId id, Map<String, Object> keyValueStorage)

Implements io.netty.handler.ssl.OpenSslSession.setSessionDetails.

Doc from io.netty.handler.ssl.OpenSslSession.setSessionDetails.

Set the details for the session which might come from a cache.

Parameters
creationTime:long

the time at which the session was created.

lastAccessedTime:long

the time at which the session was last accessed via the session infrastructure (cache).

id:OpenSslSessionId

the OpenSslSessionId

keyValueStorage:Map<String, Object>

the key value store. See keyValueStorage().

Annotations
@Override
shouldBeSingleUseback to summary
pack-priv boolean shouldBeSingleUse()
tryExpandApplicationBufferSizeback to summary
public void tryExpandApplicationBufferSize(int packetLengthDataOnly)

Implements io.netty.handler.ssl.OpenSslSession.tryExpandApplicationBufferSize.

Doc from io.netty.handler.ssl.OpenSslSession.tryExpandApplicationBufferSize.

Expand (or increase) the value returned by getApplicationBufferSize() if necessary.

This is only called in a synchronized block, so no need to use atomic operations.

Parameters
packetLengthDataOnly:int

The packet size which exceeds the current getApplicationBufferSize().

Annotations
@Override
upRefback to summary
pack-priv boolean upRef()