Package org.conscrypt

Class ExternalSession

java.lang.Object
org.conscrypt.ExternalSession
All Implemented Interfaces:
SSLSession, ConscryptSession

final class ExternalSession extends Object implements ConscryptSession
An externalized view of the underlying SSLSession used within a socket/engine. This class provides the caller with a consistent session handle which will continue to be usable regardless of internal changes to the connection. It does this by delegating calls to the current internal session, which is provided by the session Provider (i.e. the socket or engine that owns the session). This allows the provider to switch implementations (for instance, using a JNI implementation to access live values while the connection is open and a set of final values when the connection is closed), even if the caller stores a reference to the session object.

This class implements the SSLSession value API itself, rather than delegating to the provided session, to ensure the caller has a consistent value map, regardless of which internal session is currently being used by the socket/engine. This class will never call the value API methods on the underlying sessions, so they need not be implemented.