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
thread
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SslConnection
(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 SSLSession
Get the currentSSLSession
for this channel.abstract void
Start or restart the SSL/TLS handshake.Methods inherited from class org.xnio.StreamConnection
getCloseListener, getSinkChannel, getSourceChannel, notifyReadClosed, notifyWriteClosed, setCloseListener, setSinkConduit, setSourceConduit
Methods inherited from class org.xnio.Connection
close, closeAction, getIoThread, getLocalAddress, getOption, getPeerAddress, getWorker, isOpen, isReadShutdown, isWriteShutdown, readClosed, setOption, supportsOption, writeClosed
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xnio.channels.BoundChannel
getLocalAddress, getLocalAddress
Methods inherited from interface org.xnio.channels.CloseableChannel
close, getIoThread, getWorker
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
Methods 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_STARTTLS
option 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:
startHandshake
in interfaceSslChannel
- Throws:
IOException
- if an I/O error occurs
-
getSslSession
Get the currentSSLSession
for this channel.- Specified by:
getSslSession
in interfaceSslChannel
- Returns:
- the current
SSLSession
-
getHandshakeSetter
Get the setter which can be used to change the handshake listener for this channel.- Specified by:
getHandshakeSetter
in 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:
getCloseSetter
in interfaceBoundChannel
- Specified by:
getCloseSetter
in interfaceCloseableChannel
- Specified by:
getCloseSetter
in interfaceConnectedChannel
- Specified by:
getCloseSetter
in interfaceSslChannel
- Overrides:
getCloseSetter
in classStreamConnection
- Returns:
- the setter
-