Interface ExecutableCommand

All Superinterfaces:
Component
All Known Implementing Classes:
AbstractExecutableCommand, NativeExecutableCommand, ScpCommand

public interface ExecutableCommand extends Component
  • Field Details

  • Method Details

    • init

      void init(SessionChannelServer session)
      Initialize the command. This can be overridden but always call this super method with the command's session.
      Parameters:
      session -
    • getSession

      SessionChannel getSession()
    • createProcess

      boolean createProcess(String[] args, Map<String,String> environment)
      Create the process but wait for the onStart() method before performing any IO.
      Parameters:
      cmd -
      environment -
      Returns:
      boolean
    • start

      void start()
      Start the command.
    • onStart

      void onStart()
      Called once the command has been started. Operations within this method SHOULD NOT block as this will cause the connection to lockup.
    • kill

      void kill()
      Kill the command.
    • getExitCode

      int getExitCode()
      Get the exit code for this process. If the process has not completed return STILL_ACTIVE.
      Returns:
      int
    • getOutputStream

      OutputStream getOutputStream()
      Get the STDOUT OutputStream for this process.
      Returns:
      OutputStream
    • getStderrOutputStream

      OutputStream getStderrOutputStream()
      Get the STDERR OutputStream for this process.
      Returns:
      OutputStream
    • getInputStream

      InputStream getInputStream()
      Get the STDIN InputStream for this process.
      Returns:
      InputStream
    • allocatePseudoTerminal

      boolean allocatePseudoTerminal(String term, int cols, int rows, int width, int height, byte[] modes)