Package org.xnio.ssl

# Class JsseSslConnection

java.lang.Object
org.xnio.Connection
org.xnio.StreamConnection
org.xnio.ssl.SslConnection
org.xnio.ssl.JsseSslConnection

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Channel`, `InterruptibleChannel`, `BoundChannel`, `CloseableChannel`, `CloseListenerSettable<StreamConnection>`, `Configurable`, `ConnectedChannel`, `SslChannel`

public final class JsseSslConnection extends SslConnection

## 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

Constructors
Constructor
Description
`JsseSslConnection(StreamConnection streamConnection, SSLEngine engine)`

## Method Summary

Modifier and Type
Method
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.
`<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.

### Methods inherited from class org.xnio.ssl.SslConnection

`getCloseSetter`

### Methods inherited from class org.xnio.StreamConnection

`getCloseListener, getSinkChannel, getSourceChannel, notifyReadClosed, notifyWriteClosed, setCloseListener, setSinkConduit, setSourceConduit`

### Methods inherited from class org.xnio.Connection

`close, getIoThread, getLocalAddress, getPeerAddress, getWorker, readClosed, 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`

### Methods inherited from interface org.xnio.channels.CloseableChannel

`close, getIoThread, getWorker`

### Methods inherited from interface org.xnio.channels.ConnectedChannel

`getPeerAddress`

## Constructor Details

### JsseSslConnection

public JsseSslConnection(StreamConnection streamConnection, SSLEngine engine)

## Method Details

### startHandshake

public void startHandshake() throws IOException
Description copied from class: `SslConnection`
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 the `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.

Specified by:
  `startHandshake` in interface `SslChannel`
Specified by:
  `startHandshake` in class `SslConnection`
Throws:
  `IOException` - if an I/O error occurs

### getSslSession

public SSLSession getSslSession()
Description copied from class: `SslConnection`
Get the current `SSLSession` for this channel.

Specified by:
  `getSslSession` in interface `SslChannel`
Specified by:
  `getSslSession` in class `SslConnection`
Returns:
  the current `SSLSession`

### closeAction

protected void closeAction() throws IOException
Description copied from class: `Connection`
The close action to perform on this connection.

Overrides:
  `closeAction` in class `Connection`
Throws:
  `IOException` - if close fails

### getPeerAddress

public SocketAddress getPeerAddress()
Description copied from interface: `ConnectedChannel`
Get the peer address of this channel.

Returns:
  the peer address

### getLocalAddress

public SocketAddress getLocalAddress()
Description copied from interface: `BoundChannel`
Get the local address that this channel is bound to.

Returns:
  the local address

### getHandshakeSetter

public ChannelListener.Setter<? extends SslConnection> getHandshakeSetter()
Description copied from class: `SslConnection`
Get the setter which can be used to change the handshake listener for this channel.

Specified by:
  `getHandshakeSetter` in interface `SslChannel`
Specified by:
  `getHandshakeSetter` in class `SslConnection`
Returns:
  the setter

### setOption

public <T> T setOption(Option<T> option, T value) throws IllegalArgumentException, IOException
Set an option for this channel. Unsupported options are ignored.

Specified by:
  `setOption` in interface `Configurable`
Overrides:
  `setOption` in class `Connection`
Type Parameters:
  `T` - the type of the option value
Parameters:
  `option` - the option to set
  `value` - the value of the option to set
Returns:
  the previous option value, if any
Throws:
  `IllegalArgumentException` - if the value is not acceptable for this option
  `IOException` - if an I/O error occurred when modifying the option

### getOption

public <T> T getOption(Option<T> option) throws IOException
Get the value of a channel option.

Specified by:
  `getOption` in interface `Configurable`
Overrides:
  `getOption` in class `Connection`
Type Parameters:
  `T` - the type of the option value
Parameters:
  `option` - the option to get
Returns:
  the value of the option, or `null` if it is not set
Throws:
  `IOException` - if an I/O error occurred when reading the option

### supportsOption

public boolean supportsOption(Option<?> option)
Determine whether an option is supported on this channel.

Specified by:
  `supportsOption` in interface `Configurable`
Overrides:
  `supportsOption` in class `Connection`
Parameters:
  `option` - the option
Returns:
  `true` if it is supported

### isOpen

public boolean isOpen()

Specified by:
  `isOpen` in interface `Channel`
Overrides:
  `isOpen` in class `Connection`

### isWriteShutdown

public boolean isWriteShutdown()
Description copied from class: `Connection`
Determine whether writes have been shut down on this connection.

Overrides:
  `isWriteShutdown` in class `Connection`
Returns:
  `true` if writes were shut down

### isReadShutdown

public boolean isReadShutdown()
Description copied from class: `Connection`
Determine whether reads have been shut down on this connection.

Overrides:
  `isReadShutdown` in class `Connection`
Returns:
  `true` if reads were shut down

### getEngine

public SSLEngine getEngine()