Class TelnetBootstrap

java.lang.Object
org.aesh.terminal.telnet.TelnetBootstrap
Direct Known Subclasses:
NettyTelnetBootstrap

public abstract class TelnetBootstrap extends Object
Abstract base class for bootstrapping a Telnet server. Provides configuration for host and port binding, as well as start/stop lifecycle methods.
Author:
Julien Viet
  • Constructor Details

    • TelnetBootstrap

      public TelnetBootstrap()
  • Method Details

    • getHost

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

      public TelnetBootstrap 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 TelnetBootstrap setPort(int port)
      Sets the port number the server will listen on.
      Parameters:
      port - the port number
      Returns:
      this bootstrap instance for method chaining
    • start

      public CompletableFuture<?> start(Supplier<TelnetHandler> factory)
      Starts the telnet server asynchronously.
      Parameters:
      factory - the factory to create telnet handlers for each connection
      Returns:
      a future that completes when the server has started
    • stop

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

      public abstract void start(Supplier<TelnetHandler> factory, Consumer<Throwable> doneHandler)
      Start the telnet server
      Parameters:
      factory - the telnet handler factory
      doneHandler - the done handler
    • stop

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