Class SslConnection<T extends Connector>
- java.lang.Object
-
- org.restlet.ext.nio.internal.connection.Connection<T>
-
- org.restlet.ext.nio.internal.connection.SslConnection<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
SelectionListener
@Deprecated public class SslConnection<T extends Connector> extends Connection<T>
Deprecated.Will be removed to favor lower-level network extensions allowing more control at the Restlet API level.Connection secured with SSL/TLS protocols.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisHandshakingDeprecated.Whether a handshake is in progress.private java.net.InetSocketAddresspeerAddressDeprecated.The peer address.private javax.net.ssl.SSLEnginesslEngineDeprecated.The engine to use for wrapping and unwrapping.private javax.net.ssl.SSLEngineResultsslEngineResultDeprecated.The engine result.
-
Constructor Summary
Constructors Constructor Description SslConnection(ConnectionHelper<T> helper, java.nio.channels.SocketChannel socketChannel, ConnectionController controller, java.net.InetSocketAddress socketAddress, javax.net.ssl.SSLEngine sslEngine)Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ReadableSelectionChannelcreateReadableSelectionChannel()Deprecated.Creates a new readable channel.protected WritableSelectionChannelcreateWritableSelectionChannel()Deprecated.Creates a new writable channel.intgetApplicationBufferSize()Deprecated.Returns the suggested application buffer size.intgetInboundBufferSize()Deprecated.Returns the size of the content buffer for receiving messages.intgetOutboundBufferSize()Deprecated.Returns the size of the content buffer for sending responses.intgetPacketBufferSize()Deprecated.Returns the suggested SSL packet buffer size.java.net.InetSocketAddressgetPeerAddress()Deprecated.Returns the peer address.java.lang.StringgetSslCipherSuite()Deprecated.Returns the SSL cipher suite.java.util.List<java.security.cert.Certificate>getSslClientCertificates()Deprecated.Returns the list of client SSL certificates.javax.net.ssl.SSLEnginegetSslEngine()Deprecated.Returns the engine to use for wrapping and unwrapping.javax.net.ssl.SSLEngineResultgetSslEngineResult()Deprecated.Returns the engine result.javax.net.ssl.SSLEngineResult.StatusgetSslEngineStatus()Deprecated.Returns the latest SSL engine status, orSSLEngineResult.Status.OKotherwise.javax.net.ssl.SSLEngineResult.HandshakeStatusgetSslHandshakeStatus()Deprecated.Returns the SSL handshake status, either from the latest engine result or from the SSL engine.java.lang.IntegergetSslKeySize()Deprecated.Returns the SSL key size, if available and accessible.javax.net.ssl.SSLSessiongetSslSession()Deprecated.Returns the current SSL session or null.private voidhandleSslHandshake()Deprecated.Handles the SSL handshake states based on the last result received.voidhandleSslResult()Deprecated.Handles the result of a previous SSL engine processing.voidinitSslEngine()Deprecated.Initializes the SSL engine with the current SSL context and socket address.booleanisSslHandshaking()Deprecated.Indicates if the SSL handshake is going on.private voidonFinished()Deprecated.Notifies that the SSL handshake is finished.private voidonNeedTask()Deprecated.Runs the pending lengthy task.private voidonUnwrap()Deprecated.Callback invoked when the SSL handshake requires unwrapping.private voidonWrap()Deprecated.Callback invoked when the SSL handshake requires wrapping.voidreuse(java.nio.channels.SocketChannel socketChannel, ConnectionController controller, java.net.InetSocketAddress socketAddress)Deprecated.Reuses the connection and associates it to the given socket.voidsetPeerAddress(java.net.InetSocketAddress peerAddress)Deprecated.Sets the peer address.voidsetSslEngine(javax.net.ssl.SSLEngine engine)Deprecated.Sets the engine to use for wrapping and unwrapping.protected voidsetSslEngineResult(javax.net.ssl.SSLEngineResult engineResult)Deprecated.Sets the engine result.voidsetSslResult(javax.net.ssl.SSLEngineResult sslResult)Deprecated.Saves the result of a previous SSL engine processing.protected voidshutdown(java.net.Socket socket)Deprecated.Shutdowns the socket, first its input then its output.java.lang.StringtoString()Deprecated.-
Methods inherited from class org.restlet.ext.nio.internal.connection.Connection
clear, close, commit, getAddress, getHelper, getInboundWay, getLastActivity, getLoadScore, getLogger, getMaxIoIdleTimeMs, getOutboundWay, getPort, getReadableSelectionChannel, getRegistration, getSocket, getSocketAddress, getSocketChannel, getState, getWritableSelectionChannel, hasTimedOut, init, isAvailable, isClientSide, isEmpty, isPersistent, isPipelining, isReady, isServerSide, onActivity, onError, onSelected, onTimeOut, open, setPersistent, setPipelining, setRegistration, setState, updateState
-
-
-
-
Field Detail
-
isHandshaking
private volatile boolean isHandshaking
Deprecated.Whether a handshake is in progress.
-
peerAddress
private volatile java.net.InetSocketAddress peerAddress
Deprecated.The peer address.
-
sslEngine
private volatile javax.net.ssl.SSLEngine sslEngine
Deprecated.The engine to use for wrapping and unwrapping.
-
sslEngineResult
private volatile javax.net.ssl.SSLEngineResult sslEngineResult
Deprecated.The engine result.
-
-
Constructor Detail
-
SslConnection
public SslConnection(ConnectionHelper<T> helper, java.nio.channels.SocketChannel socketChannel, ConnectionController controller, java.net.InetSocketAddress socketAddress, javax.net.ssl.SSLEngine sslEngine) throws java.io.IOException
Deprecated.Constructor.- Parameters:
helper- The parent connector helper.socketChannel- The underlying NIO socket channel.controller- The IO controller.socketAddress- The associated IP address.- Throws:
java.io.IOException
-
-
Method Detail
-
createReadableSelectionChannel
protected ReadableSelectionChannel createReadableSelectionChannel()
Deprecated.Description copied from class:ConnectionCreates a new readable channel.- Overrides:
createReadableSelectionChannelin classConnection<T extends Connector>- Returns:
- A new readable channel.
-
createWritableSelectionChannel
protected WritableSelectionChannel createWritableSelectionChannel()
Deprecated.Description copied from class:ConnectionCreates a new writable channel.- Overrides:
createWritableSelectionChannelin classConnection<T extends Connector>- Returns:
- A new writable channel.
-
getApplicationBufferSize
public int getApplicationBufferSize()
Deprecated.Returns the suggested application buffer size.- Returns:
- The suggested application buffer size.
-
getInboundBufferSize
public int getInboundBufferSize()
Deprecated.Description copied from class:ConnectionReturns the size of the content buffer for receiving messages. By default, it callsConnection.getInboundBufferSize().- Overrides:
getInboundBufferSizein classConnection<T extends Connector>- Returns:
- The size of the content buffer for receiving messages.
-
getOutboundBufferSize
public int getOutboundBufferSize()
Deprecated.Description copied from class:ConnectionReturns the size of the content buffer for sending responses. By default, it callsConnection.getOutboundBufferSize().- Overrides:
getOutboundBufferSizein classConnection<T extends Connector>- Returns:
- The size of the content buffer for sending responses.
-
getPacketBufferSize
public int getPacketBufferSize()
Deprecated.Returns the suggested SSL packet buffer size.- Returns:
- The suggested SSL packet buffer size.
-
getPeerAddress
public java.net.InetSocketAddress getPeerAddress()
Deprecated.Returns the peer address.- Returns:
- The peer address.
-
getSslCipherSuite
public java.lang.String getSslCipherSuite()
Deprecated.Returns the SSL cipher suite.- Returns:
- The SSL cipher suite.
-
getSslClientCertificates
public java.util.List<java.security.cert.Certificate> getSslClientCertificates()
Deprecated.Returns the list of client SSL certificates.- Returns:
- The list of client SSL certificates.
-
getSslEngine
public javax.net.ssl.SSLEngine getSslEngine()
Deprecated.Returns the engine to use for wrapping and unwrapping.- Returns:
- The engine to use for wrapping and unwrapping.
-
getSslEngineResult
public javax.net.ssl.SSLEngineResult getSslEngineResult()
Deprecated.Returns the engine result.- Returns:
- The engine result.
-
getSslEngineStatus
public javax.net.ssl.SSLEngineResult.Status getSslEngineStatus()
Deprecated.Returns the latest SSL engine status, orSSLEngineResult.Status.OKotherwise.- Returns:
- The latest SSL engine status.
-
getSslHandshakeStatus
public javax.net.ssl.SSLEngineResult.HandshakeStatus getSslHandshakeStatus()
Deprecated.Returns the SSL handshake status, either from the latest engine result or from the SSL engine.- Returns:
- The SSL handshake status.
-
getSslKeySize
public java.lang.Integer getSslKeySize()
Deprecated.Returns the SSL key size, if available and accessible.- Returns:
- The SSL key size, if available and accessible.
-
getSslSession
public javax.net.ssl.SSLSession getSslSession()
Deprecated.Returns the current SSL session or null.- Returns:
- The current SSL session or null.
-
handleSslHandshake
private void handleSslHandshake() throws java.io.IOExceptionDeprecated.Handles the SSL handshake states based on the last result received.- Throws:
java.io.IOException
-
handleSslResult
public void handleSslResult() throws java.io.IOExceptionDeprecated.Handles the result of a previous SSL engine processing.- Throws:
java.io.IOException
-
initSslEngine
public void initSslEngine() throws javax.net.ssl.SSLExceptionDeprecated.Initializes the SSL engine with the current SSL context and socket address.- Throws:
javax.net.ssl.SSLException
-
isSslHandshaking
public boolean isSslHandshaking()
Deprecated.Indicates if the SSL handshake is going on.- Returns:
- True if the SSL handshake is going on.
-
onFinished
private void onFinished()
Deprecated.Notifies that the SSL handshake is finished. Application data can now be exchanged.
-
onNeedTask
private void onNeedTask()
Deprecated.Runs the pending lengthy task.
-
onUnwrap
private void onUnwrap() throws java.io.IOExceptionDeprecated.Callback invoked when the SSL handshake requires unwrapping.- Throws:
java.io.IOException
-
onWrap
private void onWrap() throws java.io.IOExceptionDeprecated.Callback invoked when the SSL handshake requires wrapping.- Throws:
java.io.IOException
-
reuse
public void reuse(java.nio.channels.SocketChannel socketChannel, ConnectionController controller, java.net.InetSocketAddress socketAddress) throws java.io.IOExceptionDeprecated.Description copied from class:ConnectionReuses the connection and associates it to the given socket.- Overrides:
reusein classConnection<T extends Connector>- Parameters:
socketChannel- The underlying NIO socket channel.controller- The underlying IO controller.socketAddress- The associated socket address.- Throws:
java.io.IOException
-
setPeerAddress
public void setPeerAddress(java.net.InetSocketAddress peerAddress)
Deprecated.Sets the peer address.- Parameters:
peerAddress- The peer address.
-
setSslEngine
public void setSslEngine(javax.net.ssl.SSLEngine engine)
Deprecated.Sets the engine to use for wrapping and unwrapping.- Parameters:
engine- The engine to use for wrapping and unwrapping.
-
setSslEngineResult
protected void setSslEngineResult(javax.net.ssl.SSLEngineResult engineResult)
Deprecated.Sets the engine result.- Parameters:
engineResult- The engine result.
-
setSslResult
public void setSslResult(javax.net.ssl.SSLEngineResult sslResult) throws java.io.IOExceptionDeprecated.Saves the result of a previous SSL engine processing.- Parameters:
sslResult- The SSL result to handle.- Throws:
java.io.IOException
-
shutdown
protected void shutdown(java.net.Socket socket) throws java.io.IOExceptionDeprecated.Description copied from class:ConnectionShutdowns the socket, first its input then its output.- Overrides:
shutdownin classConnection<T extends Connector>- Parameters:
socket- The socket to shutdown.- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classConnection<T extends Connector>
-
-