Package org.jppf.nio
Interface SSLHandler
- All Known Implementing Classes:
AbstractSSLHandler,SSLHandlerImpl
public interface SSLHandler
Wrapper for an
SSLEngine and an associated channel.- Author:
- Laurent Cohen
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the underlying channel and SSL engine.Get the application receive buffer.Get the application send buffer.longGet the count of bytes read from the channel, including hansdhaking and encrypted data.longGet the count of bytes written to the channel, including hansdhaking and encrypted data.Get the channel receive buffer.Get the channel send buffer.intread()Read from the channel via the SSLEngine into the application receive buffer.intwrite()Write from the application send buffer to the channel via the SSLEngine.
-
Method Details
-
read
Read from the channel via the SSLEngine into the application receive buffer. Called in blocking mode when input is expected, or in non-blocking mode when the channel is readable.- Returns:
- the number of bytes read from the application receive buffer.
- Throws:
Exception- if any error occurs.
-
write
Write from the application send buffer to the channel via the SSLEngine.- Returns:
- the number of bytes consumed from the application.
- Throws:
Exception- if any error occurs.
-
close
Close the underlying channel and SSL engine.- Throws:
Exception- if any error occurs.
-
getAppReceiveBuffer
ByteBuffer getAppReceiveBuffer()Get the application receive buffer.- Returns:
- a
ByteBufferinstance.
-
getAppSendBuffer
ByteBuffer getAppSendBuffer()Get the application send buffer.- Returns:
- a
ByteBufferinstance.
-
getNetReceiveBuffer
ByteBuffer getNetReceiveBuffer()Get the channel receive buffer.- Returns:
- a
ByteBufferinstance.
-
getNetSendBuffer
ByteBuffer getNetSendBuffer()Get the channel send buffer.- Returns:
- a
ByteBufferinstance.
-
getChannelReadCount
long getChannelReadCount()Get the count of bytes read from the channel, including hansdhaking and encrypted data.- Returns:
- the byte count as a long value.
-
getChannelWriteCount
long getChannelWriteCount()Get the count of bytes written to the channel, including hansdhaking and encrypted data.- Returns:
- the byte count as a long value.
-
getSslEngine
SSLEngine getSslEngine()- Returns:
- the SSLEngine.
-