Package: io.vertx.groovy.ext.shell.system

## [Groovy] Class Job

- io.vertx.groovy.ext.shell.system.Job

- A job executed in a JobController, grouping one or several process.

  The job life cycle can be controlled with the Job.run, Job.resume and Job.suspend and Job.interrupt methods.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `Job (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `java.lang.Object` | `getDelegate()`
    `int` | `id()` @return the job id
    `boolean` | `interrupt()` Attempt to interrupt the job.
    `long` | `lastStopped()` @return when the job was last stopped
    `java.lang.String` | `line()` @return the execution line of the job, i.e the shell command line that launched this job
    `Process` | `process()` @return the first process in the job
    `Job` | `resume()` Resume the job to foreground.
    `Job` | `resume(boolean foreground)` Resume the job.
    `Job` | `run()` Run the job, before running the job a must be set.
    `Job` | `setSession(Session session)` Set a session on the job.
    `Job` | `setTty(Tty tty)` Set a tty on the job.
    `ExecStatus` | `status()` @return the job exec status
    `Job` | `statusUpdateHandler(io.vertx.core.Handler<ExecStatus> handler)` Set an handler called when the job terminates.
    `Job` | `suspend()` Resume the job.
    `void` | `terminate()` Terminate the job.
    `Job` | `toBackground()` Send the job to background.
    `Job` | `toForeground()` Send the job to foreground.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### Job(java.lang.Object delegate)

  - ### Method Detail

    - #### java.lang.Object getDelegate()

    - #### int id()

      Returns:
        the job id

    - #### boolean interrupt()

      Attempt to interrupt the job.

      Returns:
        true if the job is actually interrupted

    - #### long lastStopped()

      Returns:
        when the job was last stopped

    - #### java.lang.String line()

      Returns:
        the execution line of the job, i.e the shell command line that launched this job

    - #### Process process()

      Returns:
        the first process in the job

    - #### Job resume()

      Resume the job to foreground.

      Returns:

    - #### Job resume(boolean foreground)

      Resume the job.

      Returns:
      Parameters:
        `foreground` - true when the job is resumed in foreground

    - #### Job run()

      Run the job, before running the job a must be set.

      Returns:
        this object

    - #### Job setSession(Session session)

      Set a session on the job.

      Returns:
        this object
      Parameters:
        `session` - the session to use

    - #### Job setTty(Tty tty)

      Set a tty on the job.

      Returns:
        this object
      Parameters:
        `tty` - the tty to use

    - #### ExecStatus status()

      Returns:
        the job exec status

    - #### Job statusUpdateHandler(io.vertx.core.Handler<ExecStatus> handler)

      Set an handler called when the job terminates.

      Returns:
        this object
      Parameters:
        `handler` - the terminate handler

    - #### Job suspend()

      Resume the job.

      Returns:
        this object

    - #### void terminate()

      Terminate the job.

    - #### Job toBackground()

      Send the job to background.

      Returns:
        this object

    - #### Job toForeground()

      Send the job to foreground.

      Returns:
        this object