public class SimpleSslTransportWrapper extends java.lang.Object implements SslTransportWrapper
wrapOutput() and unwrapInput()
to respond appropriately thereafter.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
_cipherName
could change during the lifetime of the ssl connection owing to renegotiation.
|
private java.nio.ByteBuffer |
_decodedInputBuffer
A buffer for the decoded bytes that will be passed to _underlyingInput.
|
private java.nio.ByteBuffer |
_head |
private boolean |
_head_closed |
private java.nio.ByteBuffer |
_inputBuffer |
private static java.util.logging.Logger |
_logger |
private java.nio.ByteBuffer |
_outputBuffer |
private java.lang.String |
_protocolName
could change during the lifetime of the ssl connection owing to renegotiation.
|
private ProtonSslEngine |
_sslEngine |
private boolean |
_tail_closed |
private TransportInput |
_underlyingInput |
private TransportOutput |
_underlyingOutput |
| Constructor and Description |
|---|
SimpleSslTransportWrapper(ProtonSslEngine sslEngine,
TransportInput underlyingInput,
TransportOutput underlyingOutput) |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
void |
close_head() |
void |
close_tail() |
java.lang.String |
getCipherName() |
java.lang.String |
getProtocolName() |
private boolean |
hasSpaceForSslPacket(java.nio.ByteBuffer byteBuffer) |
java.nio.ByteBuffer |
head() |
private void |
logEngineClientModeAndResult(javax.net.ssl.SSLEngineResult result,
java.lang.String direction) |
int |
pending() |
void |
pop(int bytes) |
int |
position() |
void |
process() |
private java.lang.String |
resultToString(javax.net.ssl.SSLEngineResult result) |
private void |
runDelegatedTasks(javax.net.ssl.SSLEngineResult result) |
java.nio.ByteBuffer |
tail() |
java.lang.String |
toString() |
private void |
unwrapInput()
Unwraps the contents of
_inputBuffer and passes it to _underlyingInput. |
private void |
updateCipherAndProtocolName(javax.net.ssl.SSLEngineResult result) |
private void |
wrapOutput()
Wrap the underlying transport's output, passing it to the output buffer.
|
private static final java.util.logging.Logger _logger
private final ProtonSslEngine _sslEngine
private final TransportInput _underlyingInput
private final TransportOutput _underlyingOutput
private boolean _tail_closed
private java.nio.ByteBuffer _inputBuffer
private boolean _head_closed
private java.nio.ByteBuffer _outputBuffer
private java.nio.ByteBuffer _head
private java.nio.ByteBuffer _decodedInputBuffer
private java.lang.String _cipherName
private java.lang.String _protocolName
SimpleSslTransportWrapper(ProtonSslEngine sslEngine, TransportInput underlyingInput, TransportOutput underlyingOutput)
private void unwrapInput()
throws javax.net.ssl.SSLException
_inputBuffer and passes it to _underlyingInput.
Regarding the state of _inputBuffer:
- On entry, it is assumed to be readable.
- On exit, it is still readable and its "remaining" bytes are those that we were unable
to unwrap (e.g. if they don't form a whole packet).javax.net.ssl.SSLExceptionprivate void wrapOutput()
throws javax.net.ssl.SSLException
_outputBuffer is assumed to be writeable on entry and is guaranteed to
be still writeable on exit.javax.net.ssl.SSLExceptionprivate boolean hasSpaceForSslPacket(java.nio.ByteBuffer byteBuffer)
public java.lang.String getCipherName()
getCipherName in interface SslTransportWrapperpublic java.lang.String getProtocolName()
getProtocolName in interface SslTransportWrapperprivate void updateCipherAndProtocolName(javax.net.ssl.SSLEngineResult result)
private void runDelegatedTasks(javax.net.ssl.SSLEngineResult result)
private void logEngineClientModeAndResult(javax.net.ssl.SSLEngineResult result,
java.lang.String direction)
private java.lang.String resultToString(javax.net.ssl.SSLEngineResult result)
public int capacity()
capacity in interface TransportInputpublic int position()
position in interface TransportInputpublic java.nio.ByteBuffer tail()
tail in interface TransportInputpublic void process()
throws TransportException
process in interface TransportInputTransportExceptionpublic void close_tail()
close_tail in interface TransportInputpublic int pending()
pending in interface TransportOutputpublic java.nio.ByteBuffer head()
head in interface TransportOutputpublic void pop(int bytes)
pop in interface TransportOutputpublic void close_head()
close_head in interface TransportOutputpublic java.lang.String toString()
toString in class java.lang.Object