Package org.xnio.ssl
Class SslConnection
java.lang.Object
org.xnio.Connection
org.xnio.StreamConnection
org.xnio.ssl.SslConnection
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,InterruptibleChannel,BoundChannel,CloseableChannel,CloseListenerSettable<StreamConnection>,Configurable,ConnectedChannel,SslChannel
- Direct Known Subclasses:
JsseSslConnection,JsseSslStreamConnection
A stream connection which can use SSL/TLS to negotiate a security layer.
- Author:
- Flavia Rainone
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.xnio.channels.CloseListenerSettable
CloseListenerSettable.Setter<C extends Channel> -
Field Summary
Fields inherited from class org.xnio.Connection
threadFields inherited from interface org.xnio.channels.Configurable
EMPTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSslConnection(XnioIoThread thread) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionChannelListener.Setter<? extends SslConnection>Get the setter which can be used to change the close listener for this channel.abstract ChannelListener.Setter<? extends SslConnection>Get the setter which can be used to change the handshake listener for this channel.abstract SSLSessionGet the currentSSLSessionfor this channel.abstract voidStart or restart the SSL/TLS handshake.Methods inherited from class org.xnio.StreamConnection
getCloseListener, getSinkChannel, getSourceChannel, notifyReadClosed, notifyWriteClosed, setCloseListener, setSinkConduit, setSourceConduitMethods inherited from class org.xnio.Connection
close, closeAction, getIoThread, getLocalAddress, getOption, getPeerAddress, getWorker, isOpen, isReadShutdown, isWriteShutdown, readClosed, setOption, supportsOption, writeClosedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xnio.channels.BoundChannel
getLocalAddress, getLocalAddressMethods inherited from interface org.xnio.channels.CloseableChannel
close, getIoThread, getWorkerMethods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOptionMethods inherited from interface org.xnio.channels.ConnectedChannel
getPeerAddress, getPeerAddress
-
Constructor Details
-
SslConnection
Construct a new instance.- Parameters:
thread- the I/O thread of this connection
-
-
Method Details
-
startHandshake
Start or restart the SSL/TLS handshake. To force a complete SSL/TLS session renegotiation, the current session should be invalidated prior to calling this method. This method is not needed for the initial handshake unless theOptions.SSL_STARTTLSoption is set as sending or receiving over the channel will automatically initiate it. This method must not be called while a read or write operation is taking place.- Specified by:
startHandshakein interfaceSslChannel- Throws:
IOException- if an I/O error occurs
-
getSslSession
Get the currentSSLSessionfor this channel.- Specified by:
getSslSessionin interfaceSslChannel- Returns:
- the current
SSLSession
-
getHandshakeSetter
Get the setter which can be used to change the handshake listener for this channel.- Specified by:
getHandshakeSetterin interfaceSslChannel- Returns:
- the setter
-
getCloseSetter
Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.- Specified by:
getCloseSetterin interfaceBoundChannel- Specified by:
getCloseSetterin interfaceCloseableChannel- Specified by:
getCloseSetterin interfaceConnectedChannel- Specified by:
getCloseSetterin interfaceSslChannel- Overrides:
getCloseSetterin classStreamConnection- Returns:
- the setter
-