Class SSHSession

java.lang.Object
ecmwf.common.ecauth.SSHSession
All Implemented Interfaces:
InteractiveSession

public final class SSHSession extends Object implements InteractiveSession
The Class SSHSession.
  • Constructor Details

    • SSHSession

      public SSHSession(ECtransSetup setup, String hostname, int port, int sessionTimeOut, String login, String password, byte[] token, boolean debug) throws IOException, com.jcraft.jsch.JSchException
      Instantiates a new SSH session.
      Parameters:
      setup - the setup
      hostname - the hostname
      port - the port
      sessionTimeOut - the session time out
      login - the login
      password - the password
      token - the token
      debug - the debug
      Throws:
      IOException - Signals that an I/O exception has occurred.
      com.jcraft.jsch.JSchException - the jsch exception
  • Method Details

    • getDebug

      public boolean getDebug()
      Gets the debug. Gets the debug.
      Specified by:
      getDebug in interface InteractiveSession
      Returns:
      the debug
    • send

      public void send(String cmd) throws IOException
      Sends the. Send.
      Specified by:
      send in interface InteractiveSession
      Parameters:
      cmd - the cmd
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • waitfor

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

      public boolean isConnected()
      Checks if is connected. Checks if is connected.
      Specified by:
      isConnected in interface InteractiveSession
      Returns:
      true, if is connected
    • disconnect

      public void disconnect()
      Disconnect. Disconnect.
      Specified by:
      disconnect in interface InteractiveSession
    • login

      public void login(byte[] token) throws IOException
      Login.
      Parameters:
      token - the token
      Throws:
      IOException - Signals that an I/O exception has occurred.