Class NettyTelnetTtyBootstrap
java.lang.Object
org.aesh.terminal.telnet.netty.NettyTelnetTtyBootstrap
Bootstrap class for starting a Telnet TTY server using Netty.
- Author:
- Julien Viet
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new NettyTelnetTtyBootstrap with default settings. -
Method Summary
Modifier and TypeMethodDescriptionReturns the charset used for encoding/decoding.getHost()Returns the host address the server will bind to.intgetPort()Returns the port number the server will listen on.booleanReturns whether binary mode is enabled for input.booleanReturns whether binary mode is enabled for output.voidsetCharset(Charset charset) Sets the charset to use for encoding/decoding.Sets the host address the server will bind to.setInBinary(boolean inBinary) Enable or disable the TELNET BINARY option on input.setOutBinary(boolean outBinary) Enable or disable the TELNET BINARY option on output.setPort(int port) Sets the port number the server will listen on.start(Consumer<Connection> factory) Starts the telnet TTY server asynchronously.voidstart(Consumer<Connection> factory, Consumer<Throwable> doneHandler) Starts the telnet TTY server with a callback handler.stop()Stops the telnet TTY server asynchronously.voidStops the telnet TTY server with a callback handler.
-
Constructor Details
-
NettyTelnetTtyBootstrap
public NettyTelnetTtyBootstrap()Creates a new NettyTelnetTtyBootstrap with default settings.
-
-
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
-
isOutBinary
public boolean isOutBinary()Returns whether binary mode is enabled for output.- Returns:
- true if binary mode is enabled for output
-
setOutBinary
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
Enable or disable the TELNET BINARY option on input.- Parameters:
inBinary- true to require the client to emit binary- Returns:
- this object
-
getCharset
-
setCharset
Sets the charset to use for encoding/decoding.- Parameters:
charset- the charset
-
start
Starts the telnet TTY server asynchronously.- Parameters:
factory- the connection handler factory- Returns:
- a future that completes when the server has started
-
stop
Stops the telnet TTY server asynchronously.- Returns:
- a future that completes when the server has stopped
-
start
Starts the telnet TTY server with a callback handler.- Parameters:
factory- the connection handler factorydoneHandler- the handler called when start completes (with null on success, or an exception on failure)
-
stop
-