Interface ClientChannel

    • Method Detail

      • getChannelType

        String getChannelType()
        Returns:
        The type of channel reported when it was created
      • getInvertedIn

        OutputStream getInvertedIn()
        Access to an output stream to send data directly to the remote channel. This can be used instead of using setIn(java.io.InputStream) method and having the channel polling for data in that stream.
        Returns:
        an OutputStream to be used to send data
      • setIn

        void setIn​(InputStream in)
        Set an input stream that will be read by this channel and forwarded to the remote channel. Note that using such a stream will create an additional thread for pumping the stream which will only be able to end when that stream is actually closed or some data is read. It is recommended to use the getInvertedIn() method instead and write data directly.
        Parameters:
        in - an InputStream to be polled and forwarded
      • setRedirectErrorStream

        void setRedirectErrorStream​(boolean redirectErrorStream)
        Parameters:
        redirectErrorStream - If true then STDERR stream is set to be the same as STDOUT unless setErr(OutputStream) was called. Note: the call must occur before channel is opened. Calling it afterwards has no effect - i.e., the last state before opening the stream determines the channel's behavior.
      • getExitStatus

        Integer getExitStatus()
        Returns:
        The signaled exit status via "exit-status" request - null if not signaled
      • getExitSignal

        String getExitSignal()
        Returns:
        The signaled exit signal via "exit-signal" - null if not signaled
      • validateCommandExitStatusCode

        static void validateCommandExitStatusCode​(String command,
                                                  Integer exitStatus)
                                           throws RemoteException
        Makes sure remote command exit status has been provided and it is zero
        Parameters:
        command - The command string - used only for exception text
        exitStatus - The exit status value
        Throws:
        RemoteException - If exitStatus is null or non-zero