Class TelnetWrapper


public final class TelnetWrapper extends TelnetClientHandler
The Class TelnetWrapper.
  • Field Details

    • in

      protected InputStream in
      The in.
    • out

      protected OutputStream out
      The out.
    • socket

      protected Socket socket
      The socket.
    • host

      protected String host
      The host.
    • port

      protected int port
      The port.
    • terminal

      protected String terminal
      The terminal.
    • windowSize

      protected TelnetDimension windowSize
      The window size.
  • Constructor Details

    • TelnetWrapper

      public TelnetWrapper()
      Instantiates a new telnet wrapper.
  • Method Details

    • recordIos

      public void recordIos(boolean recordIos)
      Record ios.
      Parameters:
      recordIos - the record ios
    • getIosLog

      public String getIosLog()
      Gets the ios log.
      Returns:
      the ios log
    • connect

      public void connect(String host, int port) throws IOException
      Connect.
      Parameters:
      host - the host
      port - the port
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • connect

      public void connect(Socket socket) throws IOException
      Connect.
      Parameters:
      socket - the socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • isConnected

      public boolean isConnected()
      Checks if is connected.
      Returns:
      true, if is connected
    • connect

      public void connect(InputStream in, OutputStream out) throws IOException
      Connect.
      Parameters:
      in - the in
      out - the out
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • disconnect

      public void disconnect()
      Disconnect.
    • notifyEndOfRecord

      public void notifyEndOfRecord()
      Notify end of record. Notify end of record.
      Specified by:
      notifyEndOfRecord in class TelnetClientHandler
    • login

      public void login(String user, String pwd) throws IOException
      Login.
      Parameters:
      user - the user
      pwd - the pwd
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • setPrompt

      public void setPrompt(String prompt)
      Sets the prompt.
      Parameters:
      prompt - the new prompt
    • send

      public String send(String cmd) throws IOException
      Sends the.
      Parameters:
      cmd - the cmd
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • waitfor

      public String waitfor(String... searchElements) throws IOException
      Waitfor.
      Parameters:
      searchElements - the search elements
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • read

      public int read(byte[] b) throws IOException
      Read.
      Parameters:
      b - the b
      Returns:
      the int
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • write

      public void write(byte[] b) throws IOException
      Write. Write.
      Specified by:
      write in class TelnetClientHandler
      Parameters:
      b - the b
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getTerminalType

      public String getTerminalType()
      Gets the terminal type. Gets the terminal type.
      Specified by:
      getTerminalType in class TelnetClientHandler
      Returns:
      the terminal type
    • getWindowSize

      public TelnetDimension getWindowSize()
      Gets the window size. Gets the window size.
      Specified by:
      getWindowSize in class TelnetClientHandler
      Returns:
      the window size
    • getSocket

      public Socket getSocket()
      Gets the socket.
      Returns:
      the socket
    • setLocalEcho

      public void setLocalEcho(boolean echo)
      Sets the local echo. Sets the local echo.
      Specified by:
      setLocalEcho in class TelnetClientHandler
      Parameters:
      echo - the new local echo
    • setTerminalType

      public void setTerminalType(String terminal)
      Sets the terminal type.
      Parameters:
      terminal - the new terminal type
    • setWindowSize

      public void setWindowSize(int X, int Y)
      Sets the window size.
      Parameters:
      X - the x
      Y - the y