Class Ssh

    • Constructor Summary

      Constructors 
      Constructor Description
      Ssh()
      Constructor for Ssh.
      Ssh​(java.net.InetAddress address)
      Constructor for Ssh.
      Ssh​(java.net.InetAddress address, int port)
      Constructor for Ssh.
      Ssh​(java.net.InetAddress address, int port, int timeout)
      Constructor for Ssh.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void disconnect()
      disconnect
      java.net.InetAddress getAddress()
      Get the address to connect to.
      java.lang.String getClientBanner()
      Get the banner string used when connecting
      protected java.lang.Throwable getError()
      getError
      java.lang.String getPassword()
      Get the password to connect with.
      int getPort()
      Get the port to connect to.
      java.lang.String getServerBanner()
      Get the SSH server version banner.
      java.lang.String getUsername()
      Get the username to connect as.
      PollStatus poll​(TimeoutTracker tracker)
      poll
      void setAddress​(java.net.InetAddress address)
      Set the address to connect to.
      void setClientBanner​(java.lang.String banner)
      Set the banner string to use when connecting
      protected void setError​(java.lang.Throwable t)
      setError
      void setPassword​(java.lang.String password)
      Set the password to connect with.
      void setPort​(int port)
      Set the port to connect to.
      void setUsername​(java.lang.String username)
      Set the username to connect as.
      protected boolean tryConnect()
      Attempt to connect, based on the parameters which have been set in the object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_PORT

        public static final int DEFAULT_PORT
        Constant DEFAULT_PORT=22
        See Also:
        Constant Field Values
      • DEFAULT_CLIENT_BANNER

        public static final java.lang.String DEFAULT_CLIENT_BANNER
        Constant DEFAULT_CLIENT_BANNER="SSH-1.99-OpenNMS_1.5"
        See Also:
        Constant Field Values
      • m_port

        protected int m_port
      • m_username

        protected java.lang.String m_username
      • m_password

        protected java.lang.String m_password
      • m_banner

        protected java.lang.String m_banner
      • m_serverBanner

        protected java.lang.String m_serverBanner
      • m_address

        protected java.net.InetAddress m_address
      • m_error

        protected java.lang.Throwable m_error
    • Constructor Detail

      • Ssh

        public Ssh()

        Constructor for Ssh.

      • Ssh

        public Ssh​(java.net.InetAddress address)

        Constructor for Ssh.

        Parameters:
        address - a InetAddress object.
      • Ssh

        public Ssh​(java.net.InetAddress address,
                   int port)

        Constructor for Ssh.

        Parameters:
        address - a InetAddress object.
        port - a int.
      • Ssh

        public Ssh​(java.net.InetAddress address,
                   int port,
                   int timeout)

        Constructor for Ssh.

        Parameters:
        address - a InetAddress object.
        port - a int.
        timeout - a int.
    • Method Detail

      • setAddress

        public void setAddress​(java.net.InetAddress address)
        Set the address to connect to.
        Parameters:
        address - the address
      • getAddress

        public java.net.InetAddress getAddress()
        Get the address to connect to.
        Returns:
        the address
      • setPort

        public void setPort​(int port)
        Set the port to connect to.
        Parameters:
        port - the port
      • getPort

        public int getPort()
        Get the port to connect to.
        Returns:
        the port
      • setUsername

        public void setUsername​(java.lang.String username)
        Set the username to connect as.
        Parameters:
        username - the username
      • getUsername

        public java.lang.String getUsername()
        Get the username to connect as.
        Returns:
        the username
      • setPassword

        public void setPassword​(java.lang.String password)
        Set the password to connect with.
        Parameters:
        password - the password
      • getPassword

        public java.lang.String getPassword()
        Get the password to connect with.
        Returns:
        the password
      • setClientBanner

        public void setClientBanner​(java.lang.String banner)
        Set the banner string to use when connecting
        Parameters:
        banner - the banner
      • getClientBanner

        public java.lang.String getClientBanner()
        Get the banner string used when connecting
        Returns:
        the banner
      • getServerBanner

        public java.lang.String getServerBanner()
        Get the SSH server version banner.
        Returns:
        the version string
      • setError

        protected void setError​(java.lang.Throwable t)

        setError

        Parameters:
        t - a Throwable object.
      • getError

        protected java.lang.Throwable getError()

        getError

        Returns:
        a Throwable object.
      • disconnect

        protected void disconnect()

        disconnect