- java.lang.Object
-
- org.xnio.Connection
-
- org.xnio.StreamConnection
-
- org.xnio.ssl.SslConnection
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.InterruptibleChannel,BoundChannel,CloseableChannel,CloseListenerSettable<StreamConnection>,Configurable,ConnectedChannel,SslChannel
- Direct Known Subclasses:
JsseSslConnection,JsseSslStreamConnection
public abstract class SslConnection extends StreamConnection implements SslChannel
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 java.nio.channels.Channel>
-
-
Field Summary
-
Fields inherited from class org.xnio.Connection
thread
-
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSslConnection(XnioIoThread thread)Construct a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ChannelListener.Setter<? extends SslConnection>getCloseSetter()Get the setter which can be used to change the close listener for this channel.abstract ChannelListener.Setter<? extends SslConnection>getHandshakeSetter()Get the setter which can be used to change the handshake listener for this channel.abstract javax.net.ssl.SSLSessiongetSslSession()Get the currentSSLSessionfor this channel.abstract voidstartHandshake()Start or restart the SSL/TLS handshake.-
Methods inherited from class org.xnio.StreamConnection
getCloseListener, getSinkChannel, getSourceChannel, setCloseListener, setSinkConduit, setSourceConduit
-
Methods inherited from class org.xnio.Connection
close, closeAction, getIoThread, getLocalAddress, getOption, getPeerAddress, getWorker, isOpen, isReadShutdown, isWriteShutdown, notifyReadClosed, notifyWriteClosed, 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 Detail
-
SslConnection
protected SslConnection(XnioIoThread thread)
Construct a new instance.- Parameters:
thread- the I/O thread of this connection
-
-
Method Detail
-
startHandshake
public abstract void startHandshake() throws java.io.IOExceptionStart 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:
java.io.IOException- if an I/O error occurs
-
getSslSession
public abstract javax.net.ssl.SSLSession getSslSession()
Get the currentSSLSessionfor this channel.- Specified by:
getSslSessionin interfaceSslChannel- Returns:
- the current
SSLSession
-
getHandshakeSetter
public abstract ChannelListener.Setter<? extends SslConnection> getHandshakeSetter()
Get the setter which can be used to change the handshake listener for this channel.- Specified by:
getHandshakeSetterin interfaceSslChannel- Returns:
- the setter
-
getCloseSetter
public ChannelListener.Setter<? extends SslConnection> 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
-
-