Class NettyTelnetTtyBootstrap

java.lang.Object
org.aesh.terminal.telnet.netty.NettyTelnetTtyBootstrap

public class NettyTelnetTtyBootstrap extends Object
Bootstrap class for starting a Telnet TTY server using Netty.
Author:
Julien Viet
  • Constructor Details

    • NettyTelnetTtyBootstrap

      public NettyTelnetTtyBootstrap()
      Creates a new NettyTelnetTtyBootstrap with default settings.
  • Method Details

    • getHost

      public String getHost()
      Returns the host address the server will bind to.
      Returns:
      the host address
    • setHost

      public NettyTelnetTtyBootstrap setHost(String host)
      Sets the host address the server will bind to.
      Parameters:
      host - the host address
      Returns:
      this bootstrap instance for method chaining
    • getPort

      public int getPort()
      Returns the port number the server will listen on.
      Returns:
      the port number
    • setPort

      public NettyTelnetTtyBootstrap setPort(int port)
      Sets the port number the server will listen on.
      Parameters:
      port - the port number
      Returns:
      this bootstrap instance for method chaining
    • isOutBinary

      public boolean isOutBinary()
      Returns whether binary mode is enabled for output.
      Returns:
      true if binary mode is enabled for output
    • setOutBinary

      public NettyTelnetTtyBootstrap setOutBinary(boolean outBinary)
      Enable or disable the TELNET BINARY option on output.
      Parameters:
      outBinary - true to require the client to receive binary
      Returns:
      this object
    • isInBinary

      public boolean isInBinary()
      Returns whether binary mode is enabled for input.
      Returns:
      true if binary mode is enabled for input
    • setInBinary

      public NettyTelnetTtyBootstrap setInBinary(boolean inBinary)
      Enable or disable the TELNET BINARY option on input.
      Parameters:
      inBinary - true to require the client to emit binary
      Returns:
      this object
    • getCharset

      public Charset getCharset()
      Returns the charset used for encoding/decoding.
      Returns:
      the charset
    • setCharset

      public void setCharset(Charset charset)
      Sets the charset to use for encoding/decoding.
      Parameters:
      charset - the charset
    • start

      public CompletableFuture<?> start(Consumer<Connection> factory)
      Starts the telnet TTY server asynchronously.
      Parameters:
      factory - the connection handler factory
      Returns:
      a future that completes when the server has started
    • stop

      public CompletableFuture<?> stop()
      Stops the telnet TTY server asynchronously.
      Returns:
      a future that completes when the server has stopped
    • start

      public void start(Consumer<Connection> factory, Consumer<Throwable> doneHandler)
      Starts the telnet TTY server with a callback handler.
      Parameters:
      factory - the connection handler factory
      doneHandler - the handler called when start completes (with null on success, or an exception on failure)
    • stop

      public void stop(Consumer<Throwable> doneHandler)
      Stops the telnet TTY server with a callback handler.
      Parameters:
      doneHandler - the handler called when stop completes (with null on success, or an exception on failure)