Interface ClientChannel

    • Method Detail

      • getChannelType

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

        java.io.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
      • getInvertedOut

        java.io.InputStream getInvertedOut()
      • getInvertedErr

        java.io.InputStream getInvertedErr()
      • setIn

        void setIn​(java.io.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
      • setOut

        void setOut​(java.io.OutputStream out)
      • setErr

        void setErr​(java.io.OutputStream err)
      • open

        OpenFuture open()
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • waitFor

        java.util.Set<ClientChannelEvent> waitFor​(java.util.Collection<ClientChannelEvent> mask,
                                                  long timeout)
        Waits until any of the specified events in the mask is signaled
        Parameters:
        mask - The ClientChannelEvents mask
        timeout - The timeout to wait (msec.) - if non-positive then forever
        Returns:
        The actual signaled event - includes ClientChannelEvent.TIMEOUT if timeout expired before the expected event was signaled
      • getExitStatus

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

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

        static void validateCommandExitStatusCode​(java.lang.String command,
                                                  java.lang.Integer exitStatus)
                                           throws java.rmi.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:
        java.rmi.RemoteException - If exitStatus is null or non-zero