Class AsynchronousCommand

java.lang.Object
org.jenkinsci.main.modules.sshd.AsynchronousCommand
All Implemented Interfaces:
Runnable, org.apache.sshd.server.command.Command, org.apache.sshd.server.command.CommandDirectErrorStreamAware, org.apache.sshd.server.command.CommandDirectInputStreamAware, org.apache.sshd.server.command.CommandDirectOutputStreamAware, org.apache.sshd.server.command.CommandDirectStreamsAware, org.apache.sshd.server.command.CommandLifecycle, org.apache.sshd.server.session.ServerSessionAware

public abstract class AsynchronousCommand extends Object implements org.apache.sshd.server.command.Command, org.apache.sshd.server.session.ServerSessionAware, Runnable
Partial Command implementation that uses a thread to run a command.
Author:
Kohsuke Kawaguchi
  • Constructor Details

  • Method Details

    • setInputStream

      public void setInputStream(InputStream in)
      Specified by:
      setInputStream in interface org.apache.sshd.server.command.CommandDirectInputStreamAware
    • setOutputStream

      public void setOutputStream(OutputStream out)
      Specified by:
      setOutputStream in interface org.apache.sshd.server.command.CommandDirectOutputStreamAware
    • setErrorStream

      public void setErrorStream(OutputStream err)
      Specified by:
      setErrorStream in interface org.apache.sshd.server.command.CommandDirectErrorStreamAware
    • getInputStream

      public InputStream getInputStream()
    • getOutputStream

      public OutputStream getOutputStream()
    • getErrorStream

      public OutputStream getErrorStream()
    • getCmdLine

      public SshCommandFactory.CommandLine getCmdLine()
    • setExitCallback

      public void setExitCallback(org.apache.sshd.server.ExitCallback callback)
      Specified by:
      setExitCallback in interface org.apache.sshd.server.command.Command
    • getSession

      public org.apache.sshd.server.session.ServerSession getSession()
    • setSession

      public void setSession(org.apache.sshd.server.session.ServerSession session)
      Specified by:
      setSession in interface org.apache.sshd.server.session.ServerSessionAware
    • getCurrentUser

      @CheckForNull protected User getCurrentUser()
    • getEnvironment

      public org.apache.sshd.server.Environment getEnvironment()
    • start

      public void start(org.apache.sshd.server.channel.ChannelSession channel, org.apache.sshd.server.Environment env) throws IOException
      Specified by:
      start in interface org.apache.sshd.server.command.CommandLifecycle
      Throws:
      IOException
    • start

      public void start(org.apache.sshd.server.Environment env) throws IOException
      Throws:
      IOException
    • runCommand

      protected abstract int runCommand() throws Exception
      Throws:
      Exception
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • destroy

      public void destroy(org.apache.sshd.server.channel.ChannelSession channel) throws Exception
      Specified by:
      destroy in interface org.apache.sshd.server.command.CommandLifecycle
      Throws:
      Exception
    • destroy

      public void destroy()