Class Job.Builder

Enclosing class:
Job

public static class Job.Builder extends CommonDTO.Builder<Job.Builder>
A builder to create jobs.
Since:
3.0.0
  • Constructor Details

    • Builder

      public Builder(String name, String user, String version)
      Constructor which has required fields.
      Parameters:
      name - The name to use for the Job
      user - The user to use for the Job
      version - The version to use for the Job
      Since:
      3.3.0
    • Builder

      @Deprecated public Builder(String name, String user, String version, @Nullable String commandArgs)
      Deprecated.
      Constructor which has required fields.

      Deprecated: Command args is optional. Use new constructor. Will be removed in 4.0.0

      Parameters:
      name - The name to use for the Job
      user - The user to use for the Job
      version - The version to use for the Job
      commandArgs - The command arguments used for this job. Max length 10,000 characters
      See Also:
  • Method Details

    • withCommandArgs

      @Deprecated public Job.Builder withCommandArgs(@Nullable String commandArgs)
      Deprecated.
      The command arguments to use in conjunction with the command executable selected for this job.

      DEPRECATED: This API will be removed in 4.0.0 in favor of the List based method for improved control over escaping of arguments.

      Parameters:
      commandArgs - The command args. The max length is 10,000 characters
      Returns:
      The builder
      Since:
      3.3.0
    • withCommandArgs

      public Job.Builder withCommandArgs(@Nullable List<String> commandArgs)
      The command arguments to use in conjunction with the command executable selected for this job.
      Parameters:
      commandArgs - The command args. The maximum combined size of the command args plus 1 space character between each argument must be less than or equal to 10,000 characters
      Returns:
      The builder
      Since:
      3.3.0
    • withClusterName

      public Job.Builder withClusterName(@Nullable String clusterName)
      Set the execution cluster name for this job.
      Parameters:
      clusterName - The execution cluster name
      Returns:
      The builder
    • withCommandName

      public Job.Builder withCommandName(@Nullable String commandName)
      Set the name of the command used to run this job.
      Parameters:
      commandName - The name of the command
      Returns:
      The builder
    • withStatus

      public Job.Builder withStatus(JobStatus status)
      Set the status of the job.
      Parameters:
      status - The status
      Returns:
      The builder
      See Also:
    • withStatusMsg

      public Job.Builder withStatusMsg(@Nullable String statusMsg)
      Set the detailed status message of the job.
      Parameters:
      statusMsg - The status message
      Returns:
      The builder
    • withStarted

      public Job.Builder withStarted(@Nullable Instant started)
      Set the started time of the job.
      Parameters:
      started - The started time of the job
      Returns:
      The builder
    • withFinished

      public Job.Builder withFinished(@Nullable Instant finished)
      Set the finished time of the job.
      Parameters:
      finished - The time the job finished
      Returns:
      The builder
    • withArchiveLocation

      public Job.Builder withArchiveLocation(@Nullable String archiveLocation)
      Set the archive location of the job.
      Parameters:
      archiveLocation - The location where the job results are archived
      Returns:
      The builder
    • withGrouping

      public Job.Builder withGrouping(@Nullable String grouping)
      Set the grouping to use for this job.
      Parameters:
      grouping - The grouping
      Returns:
      The builder
      Since:
      3.3.0
    • withGroupingInstance

      public Job.Builder withGroupingInstance(@Nullable String groupingInstance)
      Set the grouping instance to use for this job.
      Parameters:
      groupingInstance - The grouping instance
      Returns:
      The builder
      Since:
      3.3.0
    • build

      public Job build()
      Build the job.
      Returns:
      Create the final read-only Job instance