Class SshSpawn

    • Constructor Summary

      Constructors 
      Constructor Description
      SshSpawn​(com.jcraft.jsch.Channel channel)
      Takes control over an existing SSH channel.
      SshSpawn​(java.lang.String remoteHostName, int remotePort, java.lang.String username, java.lang.String password)
      Deprecated.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getExitValue()
      Get exit value
      java.io.InputStream getStderr()
      Get the standard error input stream
      java.io.OutputStream getStdin()
      Get the standard in output stream
      java.io.InputStream getStdout()
      Get the standard out input stream
      boolean isClosed()
      Whether if ssh spawn closed
      void start()
      Start ssh spawn
      void stop()
      Stop the ssh spawn
      • Methods inherited from class java.lang.Object

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

      • SshSpawn

        @Deprecated
        public SshSpawn​(java.lang.String remoteHostName,
                        int remotePort,
                        java.lang.String username,
                        java.lang.String password)
        Deprecated.
        Construct a new SSH spawn.
        Parameters:
        remoteHostName - The remote host to connect to.
        remotePort - The remote port to connect to.
        username - The user name with which to authenticate
        password - The password with which to authenticate
      • SshSpawn

        public SshSpawn​(com.jcraft.jsch.Channel channel)
                 throws java.io.IOException
        Takes control over an existing SSH channel.
        Parameters:
        channel - The channel we should control. If this channel isn't already connected, Channel.connect() will be called.
        Throws:
        java.io.IOException - If connecting the channel fails.
    • Method Detail

      • start

        public void start()
                   throws java.io.IOException
        Start ssh spawn
        Specified by:
        start in interface Spawnable
        Throws:
        java.io.IOException - If connecting the channel fails
      • getStdout

        public java.io.InputStream getStdout()
        Get the standard out input stream
        Specified by:
        getStdout in interface Spawnable
        Returns:
        Standard out input stream
        See Also:
        Process.getInputStream()
      • getStdin

        public java.io.OutputStream getStdin()
        Get the standard in output stream
        Specified by:
        getStdin in interface Spawnable
        Returns:
        Standard in output stream
        See Also:
        Process.getOutputStream()
      • getStderr

        public java.io.InputStream getStderr()
        Get the standard error input stream
        Specified by:
        getStderr in interface Spawnable
        Returns:
        Standard error input stream
        See Also:
        Process.getErrorStream()
      • isClosed

        public boolean isClosed()
        Whether if ssh spawn closed
        Specified by:
        isClosed in interface Spawnable
        Returns:
        Whether if ssh spawn closed
      • stop

        public void stop()
        Stop the ssh spawn
        Specified by:
        stop in interface Spawnable