public final class JsseSslConnection extends SslConnection
CloseListenerSettable.Setter<C extends Channel>
thread
EMPTY
Constructor and Description |
---|
JsseSslConnection(StreamConnection streamConnection,
SSLEngine engine) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeAction()
The close action to perform on this connection.
|
SSLEngine |
getEngine() |
ChannelListener.Setter<? extends SslConnection> |
getHandshakeSetter()
Get the setter which can be used to change the handshake listener for this channel.
|
SocketAddress |
getLocalAddress()
Get the local address that this channel is bound to.
|
<T> T |
getOption(Option<T> option)
Get the value of a channel option.
|
SocketAddress |
getPeerAddress()
Get the peer address of this channel.
|
SSLSession |
getSslSession()
Get the current
SSLSession for this channel. |
boolean |
isOpen() |
boolean |
isReadShutdown()
Determine whether reads have been shut down on this connection.
|
boolean |
isWriteShutdown()
Determine whether writes have been shut down on this connection.
|
protected void |
notifyReadClosed()
Indicate to conduit handlers that reads have been closed.
|
protected void |
notifyWriteClosed()
Indicate to conduit handlers that writes have been closed.
|
<T> T |
setOption(Option<T> option,
T value)
Set an option for this channel.
|
void |
startHandshake()
Start or restart the SSL/TLS handshake.
|
boolean |
supportsOption(Option<?> option)
Determine whether an option is supported on this channel.
|
getCloseSetter
getCloseListener, getSinkChannel, getSourceChannel, setCloseListener, setSinkConduit, setSourceConduit
close, getIoThread, getLocalAddress, getPeerAddress, getWorker, readClosed, writeClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPeerAddress
getLocalAddress
close, getIoThread, getWorker
public JsseSslConnection(StreamConnection streamConnection, SSLEngine engine)
public void startHandshake() throws IOException
SslConnection
Options.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.startHandshake
in interface SslChannel
startHandshake
in class SslConnection
IOException
- if an I/O error occurspublic SSLSession getSslSession()
SslConnection
SSLSession
for this channel.getSslSession
in interface SslChannel
getSslSession
in class SslConnection
SSLSession
protected void closeAction() throws IOException
Connection
closeAction
in class Connection
IOException
- if close failsprotected void notifyWriteClosed()
Connection
notifyWriteClosed
in class Connection
protected void notifyReadClosed()
Connection
notifyReadClosed
in class Connection
public SocketAddress getPeerAddress()
ConnectedChannel
public SocketAddress getLocalAddress()
BoundChannel
public ChannelListener.Setter<? extends SslConnection> getHandshakeSetter()
SslConnection
getHandshakeSetter
in interface SslChannel
getHandshakeSetter
in class SslConnection
public <T> T setOption(Option<T> option, T value) throws IllegalArgumentException, IOException
setOption
in interface Configurable
setOption
in class Connection
T
- the type of the option valueoption
- the option to setvalue
- the value of the option to setIllegalArgumentException
- if the value is not acceptable for this optionIOException
- if an I/O error occurred when modifying the optionpublic <T> T getOption(Option<T> option) throws IOException
getOption
in interface Configurable
getOption
in class Connection
T
- the type of the option valueoption
- the option to getnull
if it is not setIOException
- if an I/O error occurred when reading the optionpublic boolean supportsOption(Option<?> option)
supportsOption
in interface Configurable
supportsOption
in class Connection
option
- the optiontrue
if it is supportedpublic boolean isOpen()
isOpen
in interface Channel
isOpen
in class Connection
public boolean isWriteShutdown()
Connection
isWriteShutdown
in class Connection
true
if writes were shut downpublic boolean isReadShutdown()
Connection
isReadShutdown
in class Connection
true
if reads were shut downpublic SSLEngine getEngine()
Copyright © 2018 JBoss by Red Hat. All rights reserved.