Class TelnetHandler

java.lang.Object
ecmwf.common.telnet.TelnetHandler

public final class TelnetHandler extends Object
The Class TelnetHandler.
  • Field Details

  • Constructor Details

    • TelnetHandler

      public TelnetHandler(Socket socket) throws IOException
      Instantiates a new telnet handler.
      Parameters:
      socket - the socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • TelnetHandler

      public TelnetHandler(InputStream in, OutputStream out) throws IOException
      Instantiates a new telnet handler.
      Parameters:
      in - the in
      out - the out
      Throws:
      IOException - Signals that an I/O exception has occurred.
  • Method Details

    • close

      public void close()
      Close.
    • nextChar

      public char nextChar() throws IOException
      Next char.
      Returns:
      the char
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • flush

      public void flush() throws IOException
      Flush.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • send

      public void send(char c) throws IOException
      Sends the.
      Parameters:
      c - the c
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • print

      public void print(char c) throws IOException
      Prints the.
      Parameters:
      c - the c
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • println

      public void println() throws IOException
      Println.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • print

      public void print(String s) throws IOException
      Prints the.
      Parameters:
      s - the s
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • println

      public void println(String s) throws IOException
      Println.
      Parameters:
      s - the s
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • sendOption

      public void sendOption(char option, boolean state) throws IOException
      Sends the option.
      Parameters:
      option - the option
      state - the state
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • sendOptionRequest

      public void sendOptionRequest(char option, boolean state) throws IOException
      Sends the option request.
      Parameters:
      option - the option
      state - the state
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getInputStream

      public InputStream getInputStream() throws IOException
      Gets the input stream.
      Returns:
      the input stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Gets the output stream.
      Returns:
      the output stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getSocket

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

      public String getTerminal()
      Gets the terminal.
      Returns:
      the terminal
    • setTerminal

      public void setTerminal(String terminal)
      Sets the terminal.
      Parameters:
      terminal - the new terminal
    • getWindowSize

      public Dimension getWindowSize()
      Gets the window size.
      Returns:
      the window size
    • setWindowSize

      public void setWindowSize(Dimension windowSize)
      Sets the window size.
      Parameters:
      windowSize - the new window size
    • readLine

      public String readLine(int size, String set) throws IOException
      Read line.
      Parameters:
      size - the size
      set - the set
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readLine

      public String readLine(int echo, int size, String set) throws IOException
      Read line.
      Parameters:
      echo - the echo
      size - the size
      set - the set
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readString

      public String readString(String message, int size, String set) throws IOException
      Read string.
      Parameters:
      message - the message
      size - the size
      set - the set
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readString

      public String readString(String message, int size, String set, String[] values) throws IOException
      Read string.
      Parameters:
      message - the message
      size - the size
      set - the set
      values - the values
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readString

      public String readString(String message, int size, String set, String[] values, int defaultPos) throws IOException
      Read string.
      Parameters:
      message - the message
      size - the size
      set - the set
      values - the values
      defaultPos - the default pos
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getPassword

      public String getPassword(int size, String set, String message, File help) throws IOException
      Gets the password.
      Parameters:
      size - the size
      set - the set
      message - the message
      help - the help
      Returns:
      the password
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getPassword

      public String getPassword(int size, String set, String message, String verify, File help) throws IOException
      Gets the password.
      Parameters:
      size - the size
      set - the set
      message - the message
      verify - the verify
      help - the help
      Returns:
      the password
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readChar

      public char readChar(String message, String[] values) throws IOException
      Read char.
      Parameters:
      message - the message
      values - the values
      Returns:
      the char
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readString

      public String readString(String message, int size, String[] values, int defaultValue) throws IOException
      Read string.
      Parameters:
      message - the message
      size - the size
      values - the values
      defaultValue - the default value
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • subNegotiation

      public void subNegotiation(char option, char param) throws IOException
      Sub negotiation.
      Parameters:
      option - the option
      param - the param
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • subNegotiation

      public void subNegotiation(char option, char[] params) throws IOException
      Sub negotiation.
      Parameters:
      option - the option
      params - the params
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • display

      public void display(File file, boolean wait)
      Display.
      Parameters:
      file - the file
      wait - the wait