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 Details

    • read

      int read() throws Exception
      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

      int write() throws Exception
      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

      void close() throws Exception
      Close the underlying channel and SSL engine.
      Throws:
      Exception - if any error occurs.
    • getAppReceiveBuffer

      ByteBuffer getAppReceiveBuffer()
      Get the application receive buffer.
      Returns:
      a ByteBuffer instance.
    • getAppSendBuffer

      ByteBuffer getAppSendBuffer()
      Get the application send buffer.
      Returns:
      a ByteBuffer instance.
    • getNetReceiveBuffer

      ByteBuffer getNetReceiveBuffer()
      Get the channel receive buffer.
      Returns:
      a ByteBuffer instance.
    • getNetSendBuffer

      ByteBuffer getNetSendBuffer()
      Get the channel send buffer.
      Returns:
      a ByteBuffer instance.
    • 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.