Class TelnetBootstrap
java.lang.Object
org.aesh.terminal.telnet.TelnetBootstrap
- Direct Known Subclasses:
NettyTelnetBootstrap
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHost()Returns the host address the server will bind to.intgetPort()Returns the port number the server will listen on.Sets the host address the server will bind to.setPort(int port) Sets the port number the server will listen on.start(Supplier<TelnetHandler> factory) Starts the telnet server asynchronously.abstract voidstart(Supplier<TelnetHandler> factory, Consumer<Throwable> doneHandler) Start the telnet serverstop()Stops the telnet server asynchronously.abstract voidStops the telnet server with a callback handler.
-
Constructor Details
-
TelnetBootstrap
public TelnetBootstrap()
-
-
Method Details
-
getHost
-
setHost
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
Sets the port number the server will listen on.- Parameters:
port- the port number- Returns:
- this bootstrap instance for method chaining
-
start
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
Stops the telnet server asynchronously.- Returns:
- a future that completes when the server has stopped
-
start
Start the telnet server- Parameters:
factory- the telnet handler factorydoneHandler- the done handler
-
stop
-