Package com.sas.lsaf.execution.job

## Interface JobSubmissionService

-     public interface JobSubmissionService

  The service that provides methods to execute jobs in the repository and in the user's workspace and to get the status of the submitted job.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `JobSubmission` | `getJobSubmission​(java.lang.String id)` | Gets the current job submission for a specific submission of a job.
    `JobSubmission` | `getJobSubmissionBySession​(java.lang.String sessionId)` | Gets the `JobSubmission`, which contains job information and the job execution status for the job that created the session.
    `java.util.List<JobSubmission>` | `getJobSubmissionsByJobPath​(java.lang.String path)` | Gets job submission entries for the repository job by the job path.
    `JobSubmissionStatus` | `getJobSubmissionStatus​(java.lang.String jobSubmissionId)` | Gets the current job submission status for a specific submission of a job.
    `JobSubmission` | `getLatestJobSubmissionByJobPath​(java.lang.String path)` | Gets the latest job submission entry for the repository job by the job path.
    `Manifest` | `getManifestByJobSubmission​(java.lang.String jobSubmissionId)` | Gets the job manifest file for the job submission.
    `Manifest` | `getManifestByRepositoryPath​(java.lang.String path, java.lang.String version)` | Gets the job manifest file at the path and version in the repository.
    `Manifest` | `getManifestByWorkspacePath​(java.lang.String path)` | Gets the job manifest file at the path in the workspace.
    `JobSubmission` | `submitAndPopulateWorkspaceJob​(java.lang.String path, java.util.List<ParameterValue> parameterValues, boolean useRelativePaths)` | Submits the job in the workspace and updates the input and output specifications in the job based on inputs and outputs that are accessed during the job run.
    `JobSubmission` | `submitRepositoryJob​(java.lang.String path, java.lang.String version, java.util.List<ParameterValue> parameterValues)` | Submits the job in the repository.
    `JobSubmission` | `submitTestJob​(java.lang.String path, java.util.List<ParameterValue> parameterValues)` | Submits the job as it would for a published job, which accesses items in the repository, but outputs are not checked in.
    `JobSubmission` | `submitWorkspaceJob​(java.lang.String path, java.util.List<ParameterValue> parameterValues)` | Submits the job in the current user's workspace.

- - ### Method Detail

    - #### submitWorkspaceJob

          JobSubmission submitWorkspaceJob​(java.lang.String path,
                                           java.util.List<ParameterValue> parameterValues)

      Submits the job in the current user's workspace. For the job to execute successfully, all of the locations for input files and folder output that are referenced by the job must be available in the user's workspace. The job runs using the versions of the files that exist in the user's workspace.
      Parameters:
        `path` - The path to the job.
        `parameterValues` - The values that override the default values of the JobParameters that are defined in the job. For parameters of type FILE and FOLDER, the value must be a `JobInput`. The values of CHARACTER and NUMERIC parameters must be Strings. The values of DATE parameter type must be java.util.Date. If no parameters are specified, the default values that are defined in the job are used.
      Returns:
        Information about the submitted job to use as a token to get the job submission status.

    - #### submitTestJob

          JobSubmission submitTestJob​(java.lang.String path,
                                      java.util.List<ParameterValue> parameterValues)

      Submits the job as it would for a published job, which accesses items in the repository, but outputs are not checked in. Any outputs from the job submission are written to the current user's workspace. The test submission checks that the job is set up correctly in the repository and the items that are required to run the job are accessible. A manifest file is generated to indicate the inputs that were referenced and the outputs that were generated.
      Parameters:
        `path` - The path to the job.
        `parameterValues` - The values that override the default values of the JobParameters that are defined in the job. For parameters of type FILE and FOLDER, the value must be a `JobInput`. The values of CHARACTER and NUMERIC parameters must be Strings. The values of DATE parameter type must be java.util.Date. If no parameters are specified, the default values defined in the job are used.
      Returns:
        Information about the submitted job to use as a token to get the test job submission status.

    - #### submitRepositoryJob

          JobSubmission submitRepositoryJob​(java.lang.String path,
                                            java.lang.String version,
                                            java.util.List<ParameterValue> parameterValues)

      Submits the job in the repository. The job execution uses an independent transient workspace that is cleaned up after successful completion. Inputs and outputs that are specified in the job, and the file or folder locations that are specified in the job parameter values are copied into the transient workspace according to the item specifications that are provided. Output files are checked into the repository after the job execution completes successfully.
      Parameters:
        `path` - The path to the job.
        `version` - The version of the repository job to run. Specifying null uses the latest version of the job.
        `parameterValues` - The override values of the default values of the JobParameters that are defined in the job. For parameters of type FILE and FOLDER, the value must be a `JobInput`. The values of CHARACTER and NUMERIC parameters must be Strings. The date parameter values must be java.util.Date. If no parameters are specified, the default values in the job are used.
      Returns:
        Information about the submitted job to use as a token to get the job submission status.

    - #### getJobSubmission

          JobSubmission getJobSubmission​(java.lang.String id)
                                  throws JobSubmissionNotFoundException

      Gets the current job submission for a specific submission of a job. The job submission provides a summary status that indicates that the job submission is in progress or has completed. It also provides a detailed status that indicates whether there are execution errors or warnings, check-in errors, or the job completed successfully.
      Parameters:
        `id` - The JobSubmission identifier for a specific job submission.
      Returns:
        Information about the current status of the job submission.
      Throws:
        `JobSubmissionNotFoundException` - Thrown when the job submission with the identifier does not exist.

    - #### getJobSubmissionStatus

          JobSubmissionStatus getJobSubmissionStatus​(java.lang.String jobSubmissionId)
                                              throws JobSubmissionNotFoundException

      Gets the current job submission status for a specific submission of a job. The status provides a summary status that indicates that the job submission is in progress or has completed. It also provides a detailed status that indicates whether there are execution errors or warnings, check-in errors, or the job completed successfully. See `JobSubmissionStatus` for status details.
      Parameters:
        `jobSubmissionId` - The identifier of the job submission that is returned from submitting the job.
      Returns:
        Information about the current status of the job submission.
      Throws:
        `JobSubmissionNotFoundException` - Thrown when the job submission with the identifier does not exist.

    - #### submitAndPopulateWorkspaceJob

          JobSubmission submitAndPopulateWorkspaceJob​(java.lang.String path,
                                                      java.util.List<ParameterValue> parameterValues,
                                                      boolean useRelativePaths)

      Submits the job in the workspace and updates the input and output specifications in the job based on inputs and outputs that are accessed during the job run. If the job runs with errors, the job is not updated. If the job runs successfully or with warnings, the job is updated, and replaces any existing input and output definitions that are in the job.
      Parameters:
        `path` - The path of workspace job.
        `parameterValues` - The override values of the default values of the JobParameters that are defined in the job. For parameters of type FILE and FOLDER, the value must be a `JobInput`. The values of CHARACTER and NUMERIC parameters must be Strings. The date parameter values must be java.util.Date. If no parameters are specified, the default values in the job are used.
        `useRelativePaths` - Indicates whether to use relative paths to update the inputs and outputs of the job.
      Returns:
        Information about the submitted job to use as a token to get the job submission status.

    - #### getJobSubmissionBySession

          JobSubmission getJobSubmissionBySession​(java.lang.String sessionId)
                                           throws JobSubmissionNotFoundException

      Gets the `JobSubmission`, which contains job information and the job execution status for the job that created the session.
      Parameters:
        `sessionId` - The identifier that represents the session.
      Returns:
        Job information and job execution status for the job that created the session.
      Throws:
        `JobSubmissionNotFoundException` - Thrown when a job submission does not exist for the session.

    - #### getManifestByRepositoryPath

          Manifest getManifestByRepositoryPath​(java.lang.String path,
                                               java.lang.String version)
                                        throws ResultsNotFoundException

      Gets the job manifest file at the path and version in the repository. If the version is null, the latest version is returned.
      Parameters:
        `path` - The path to the job manifest file.
        `version` - The version of the manifest file. If null, the latest version is returned.
      Returns:
        The object that represents the manifest file.
      Throws:
        `ResultsNotFoundException` - Thrown when the job manifest file or the version does not exist at the path.

    - #### getManifestByWorkspacePath

          Manifest getManifestByWorkspacePath​(java.lang.String path)
                                       throws ResultsNotFoundException

      Gets the job manifest file at the path in the workspace.
      Parameters:
        `path` - The path to the job manifest file.
      Returns:
        The object that represents the manifest file.
      Throws:
        `ResultsNotFoundException` - Thrown when the job manifest file does not exist.

    - #### getManifestByJobSubmission

          Manifest getManifestByJobSubmission​(java.lang.String jobSubmissionId)
                                       throws ResultsNotFoundException

      Gets the job manifest file for the job submission.
      Parameters:
        `jobSubmissionId` - The identifier of the job submission.
      Returns:
        The details of the files that are involved in the job submission.
      Throws:
        `ResultsNotFoundException` - Thrown when the job manifest file does not exist for the job submission.

    - #### getJobSubmissionsByJobPath

          java.util.List<JobSubmission> getJobSubmissionsByJobPath​(java.lang.String path)

      Gets job submission entries for the repository job by the job path. If the path does not exist or is not valid, an empty list is returned. Requires read access to the job.
      Parameters:
        `path` - The path of the job.
      Returns:
        A list of JobSubmission objects that contains submissions of the job.

    - #### getLatestJobSubmissionByJobPath

          JobSubmission getLatestJobSubmissionByJobPath​(java.lang.String path)

      Gets the latest job submission entry for the repository job by the job path. Requires read access to the job.
      Parameters:
        `path` - The path of the job.
      Returns:
        A JobSubmission object that contains the information about the latest submission of the job.
      Throws:
        `JobSubmissionNotFoundException` - Thrown when a job submission is not found for the repository job path.