Class TlsNioSocket

java.lang.Object
io.helidon.common.socket.NioSocket
io.helidon.common.socket.TlsNioSocket
All Implemented Interfaces:
HelidonSocket, SocketContext, Supplier<byte[]>

public final class TlsNioSocket extends NioSocket
TLS NIO helidon socket.
  • Method Details

    • server

      public static TlsNioSocket server(SocketChannel delegate, SSLEngine sslEngine, String channelId, String serverChannelId)
      Create a server TLS NIO socket.
      Parameters:
      delegate - underlying socket
      sslEngine - SSL engine
      channelId - listener channel id
      serverChannelId - connection channel id
      Returns:
      a new TLS socket
    • client

      public static TlsNioSocket client(SocketChannel delegate, SSLEngine sslEngine, String channelId)
      Create a client TLS NIO socket.
      Parameters:
      delegate - underlying socket
      sslEngine - SSL engine
      channelId - channel id
      Returns:
      a new TLS socket
    • remotePeer

      public PeerInfo remotePeer()
      Description copied from interface: SocketContext
      Remote peer information.
      Specified by:
      remotePeer in interface SocketContext
      Overrides:
      remotePeer in class NioSocket
      Returns:
      peer info
    • localPeer

      public PeerInfo localPeer()
      Description copied from interface: SocketContext
      Local peer information.
      Specified by:
      localPeer in interface SocketContext
      Overrides:
      localPeer in class NioSocket
      Returns:
      peer info
    • isSecure

      public boolean isSecure()
      Description copied from interface: SocketContext
      Whether the request is secure.
      Specified by:
      isSecure in interface SocketContext
      Overrides:
      isSecure in class NioSocket
      Returns:
      whether secure
    • protocolNegotiated

      public boolean protocolNegotiated()
      Description copied from interface: HelidonSocket
      Whether a protocol was negotiated by the socket (such as ALPN when using TLS).
      Returns:
      whether a protocol was negotiated
    • protocol

      public String protocol()
      Description copied from interface: HelidonSocket
      Protocol that was negotiated.
      Returns:
      protocol name
    • get

      public byte[] get()
      Specified by:
      get in interface Supplier<byte[]>
      Overrides:
      get in class NioSocket
    • read

      public int read(BufferData buffer)
      Description copied from interface: HelidonSocket
      Read bytes from the socket. This method blocks until at least 1 byte is available.
      Specified by:
      read in interface HelidonSocket
      Overrides:
      read in class NioSocket
      Parameters:
      buffer - buffer to read to
      Returns:
      number of bytes read
    • write

      public void write(BufferData buffer)
      Description copied from interface: HelidonSocket
      Write teh buffer to the underlying socket. This method blocks until all bytes are written.
      Specified by:
      write in interface HelidonSocket
      Overrides:
      write in class NioSocket
      Parameters:
      buffer - buffer to write
    • close

      public void close()
      Description copied from interface: HelidonSocket
      Close the underlying socket.
      Specified by:
      close in interface HelidonSocket
      Overrides:
      close in class NioSocket