Class TelnetHandler

java.lang.Object
org.aesh.terminal.telnet.TelnetHandler
Direct Known Subclasses:
TelnetTtyConnection

public class TelnetHandler extends Object
The handler that defines the callbacks for a telnet connection.
Author:
Julien Viet
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    The telnet connection closed.
    protected void
    onCommand(byte command)
    Called when a telnet command is received.
    protected void
    onData(byte[] data)
    Process data sent by the client.
    protected void
    onEcho(boolean echo)
    Called when the ECHO option state changes.
    protected void
    onNAWS(boolean naws)
    Called when the NAWS (Negotiate About Window Size) option state changes.
    protected void
    The telnet connection opened.
    protected void
    onReceiveBinary(boolean binary)
    Called when the receive binary mode state changes.
    protected void
    onSendBinary(boolean binary)
    Called when the send binary mode state changes.
    protected void
    onSGA(boolean sga)
    Called when the SGA (Suppress Go Ahead) option state changes.
    protected void
    onSize(int width, int height)
    Called when the terminal window size changes.
    protected void
    onTerminalType(String terminalType)
    Called when the terminal type is received from the client.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TelnetHandler

      public TelnetHandler()
  • Method Details

    • onOpen

      protected void onOpen(TelnetConnection conn)
      The telnet connection opened.
      Parameters:
      conn - the connection
    • onClose

      protected void onClose()
      The telnet connection closed.
    • onData

      protected void onData(byte[] data)
      Process data sent by the client.
      Parameters:
      data - the data
    • onSize

      protected void onSize(int width, int height)
      Called when the terminal window size changes.
      Parameters:
      width - the new terminal width in columns
      height - the new terminal height in rows
    • onTerminalType

      protected void onTerminalType(String terminalType)
      Called when the terminal type is received from the client.
      Parameters:
      terminalType - the terminal type string (e.g., "xterm", "vt100")
    • onCommand

      protected void onCommand(byte command)
      Called when a telnet command is received.
      Parameters:
      command - the command byte
    • onNAWS

      protected void onNAWS(boolean naws)
      Called when the NAWS (Negotiate About Window Size) option state changes.
      Parameters:
      naws - true if the client supports NAWS, false otherwise
    • onEcho

      protected void onEcho(boolean echo)
      Called when the ECHO option state changes.
      Parameters:
      echo - true if echo is enabled, false otherwise
    • onSGA

      protected void onSGA(boolean sga)
      Called when the SGA (Suppress Go Ahead) option state changes.
      Parameters:
      sga - true if SGA is enabled, false otherwise
    • onSendBinary

      protected void onSendBinary(boolean binary)
      Called when the send binary mode state changes.
      Parameters:
      binary - true if binary mode is enabled for sending, false otherwise
    • onReceiveBinary

      protected void onReceiveBinary(boolean binary)
      Called when the receive binary mode state changes.
      Parameters:
      binary - true if binary mode is enabled for receiving, false otherwise