Interface JobService


  • public interface JobService
    The service to create, update, and get jobs. Note: Relative paths are supported for files within the job.
    • Method Detail

      • createWorkspaceJob

        Job createWorkspaceJob​(java.lang.String parentPath,
                               java.lang.String jobName,
                               java.util.List<JobProgram> programs,
                               java.util.List<JobParameter> parameters,
                               boolean createParents,
                               boolean useRelativePaths)
                        throws JobExistsException,
                               JobCreateException
        Creates a job in the current user's workspace. Optionally, this method specifies tasks and parameters.
        Parameters:
        parentPath - The parent path in which to create the job.
        jobName - The name of the job.
        programs - The list of files for the job to execute sequentially.
        parameters - The list of the parameters of the job that are defined as variables to be available to executing programs. 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.
        createParents - Indicates whether to create parent paths, if they do not exist.
        useRelativePaths - Indicates whether to use relative paths when adding path-based attributes of job.
        Returns:
        The job that is created in the workspace.
        Throws:
        JobExistsException - Thrown when a job exists at the location.
        JobCreateException - Thrown when the job is not created.
      • createWorkspaceJob

        Job createWorkspaceJob​(Job job,
                               boolean createParents,
                               boolean useRelativePaths)
                        throws JobExistsException,
                               JobCreateException
        Creates the job in the current user's workspace. If the paths that are specified in the job are relative, and useRelativePaths is specified as false, the relative paths remain unchanged.
        Parameters:
        job - The information to create the job.
        createParents - Indicates whether to create parent paths, if they do not exist.
        useRelativePaths - Indicates whether to use relative paths when adding path-based attributes of job.
        Returns:
        The job that is created in the workspace.
        Throws:
        JobExistsException - Thrown when a job exists at the location.
        JobCreateException - Thrown when the job is not created.
      • createRepositoryJob

        Job createRepositoryJob​(Job job,
                                RepositoryCheckinSpecification jobCheckinSpec,
                                boolean createParents,
                                boolean useRelativePaths)
                         throws JobExistsException,
                                JobCreateException
        Creates a job in the repository.
        Parameters:
        job - The information to create the job.
        createParents - Indicates whether to create parent paths, if they do not exist.
        useRelativePaths - Indicates whether to use relative paths when adding path-based attributes of job.
        jobCheckinSpec - The information on the method to check in the new job file, such as the major version or minor version. Specifying null creates an unversioned file.
        Returns:
        The job that is created in the repository.
        Throws:
        JobExistsException - Thrown when a job exists at the location.
        JobCreateException - Thrown when the job is not created.
      • getWorkspaceJob

        Job getWorkspaceJob​(java.lang.String path)
                     throws JobNotFoundException,
                            JobFormatException
        Gets the job from the path in the workspace.
        Parameters:
        path - The full path to the job.
        Returns:
        The job from the job file.
        Throws:
        JobNotFoundException - Thrown when the job does not exist at the path.
        JobFormatException - Thrown when the job file content is not in the proper format.
      • getRepositoryJob

        Job getRepositoryJob​(java.lang.String path,
                             java.lang.String version)
                      throws JobNotFoundException,
                             JobFormatException
        Gets the job from the specified path in the repository.
        Parameters:
        path - The full path to the job.
        version - The specific version of the job. Specifying null gets the latest version.
        Returns:
        The job from the job file.
        Throws:
        JobNotFoundException - Thrown when the job does not exist at the path.
        JobFormatException - Thrown when the job file content is not in the proper format.
      • updateRepositoryJob

        Job updateRepositoryJob​(Job job,
                                RepositoryCheckinSpecification checkinSpec)
                         throws JobNotFoundException,
                                JobUpdateException
        Updates the job in the repository with the information in the job.
        Parameters:
        job - The job that contains the information to update the job.
        checkinSpec - The information on the method to check in the updated job file, such as the major version or minor version. Specifying null defaults to a minor version specification.
        Returns:
        The job from the updated job file.
        Throws:
        JobNotFoundException - Thrown when the job is not found at the location that is specified in the job.
        JobUpdateException - Thrown when there is an issue when updating the job.
      • updateWorkspaceJob

        Job updateWorkspaceJob​(Job job)
                        throws JobNotFoundException,
                               JobUpdateException
        Updates the job in the workspace with the information to the specified job.
        Parameters:
        job - The job that contains the information to update the job.
        Returns:
        The job from the updated job file.
        Throws:
        JobNotFoundException - Thrown when the job is not found at the location that is specified in the job.
        JobUpdateException - Thrown when there is an issue when updating the job.
      • setRunAsOwner

        void setRunAsOwner​(java.lang.String jobPath,
                           boolean value)
                    throws JobNotFoundException
        Sets the repository job to run as the job owner. The default is False.
        Parameters:
        jobPath - The full path to the job.
        value - Indicates whether the job runs as the job owner.
        Throws:
        JobNotFoundException - Thrown when the specified job is not found.
      • getRunAsOwner

        boolean getRunAsOwner​(java.lang.String jobPath)
                       throws JobNotFoundException
        Indicates whether the repository job runs as the job owner.
        Parameters:
        jobPath - The full path of the job.
        Returns:
        True, if job runs as the job owner.
        Throws:
        JobNotFoundException - Thrown when the specified job is not found.