com.sas.hls.job
Interface JobService


public interface JobService

Service for creating, updating, and getting jobs. Note relative paths are supported for files within the job.


Method Summary
 Job createJobInWorkspace(CreateJobInfo jobInfo)
          Creates job in workspace based on information specified on CreateJobInfo
 Job createJobInWorkspace(String parentPath, String jobName, List<ResourceSpecification> tasks, Set<JobParameter> parameters, boolean createParents)
          Creates a job in the current user's workspace while optionally being able to specify tasks and parameters.
 Job createJobInWorkspaceAndRepository(CreateJobInfo jobInfo, NewFileCheckinSpecification jobCheckinSpec)
          Creates job in workspace and checks it into the repository
 Job getJobInRepository(String path, String version)
          Gets the job from the specified path in the repository
 Job getJobInWorkspace(String path)
          Gets the job from the specified path in the workspace
 boolean getRunAsOwner(Job job)
          Get the flag that defines whether the repository job will run as the owner.
 boolean jobExistsInRepository(String path)
          Confirms whether the job exists at the specified path in the repository
 boolean jobExistsInWorkspace(String path)
          Confirms whether the job exists at the specified path in the workspace
 void setRunAsOwner(Job job, boolean value)
          Sets if the repository job will run as the owner.
 Job updateJobInRepository(Job job, ResourceCheckinSpecification checkinSpec)
          Updates the job in the repository with information on the specified Job
 Job updateJobInWorkspace(Job job)
          Updates the job in the workspace with information on the specified Job
 

Method Detail

createJobInWorkspace

Job createJobInWorkspace(String parentPath,
                         String jobName,
                         List<ResourceSpecification> tasks,
                         Set<JobParameter> parameters,
                         boolean createParents)
                         throws JobExistsException,
                                ResourceNotFoundException
Creates a job in the current user's workspace while optionally being able to specify tasks and parameters.

Parameters:
parentPath - the parent path of where to create the job
jobName - name of the job
tasks - list of files for the job to execute sequentially. Files are represented by a ResourceSepcification.
parameters - list of parameters of the job that will be defined as SAS macros. For parameters of type FILE and FOLDER, the value should be specified as a ResourceSpecification. Values of CHARACTER and NUMERIC parameters should be specified as Strings. Date parameter values should be specified as java.util.Date.
createParents - specify true to create parent paths if they do not already exist
Returns:
Job that was created in the workspace
Throws:
JobExistsException - Thrown if the job already exists at that location
ResourceNotFoundException - Thrown if createParents was specified as false and the parentPath does not exist.

createJobInWorkspace

Job createJobInWorkspace(CreateJobInfo jobInfo)
                         throws JobExistsException,
                                ResourceNotFoundException
Creates job in workspace based on information specified on CreateJobInfo

Parameters:
jobInfo - Contains information required to create a job as well other additional job attributes
Returns:
Job that was created in the workspace
Throws:
JobExistsException - Thrown if the job already exists at that location
ResourceNotFoundException - Thrown if createParents was specified as false on CreateJobInfo and the parentPath on CreateJobInfo does not exist.

createJobInWorkspaceAndRepository

Job createJobInWorkspaceAndRepository(CreateJobInfo jobInfo,
                                      NewFileCheckinSpecification jobCheckinSpec)
                                      throws JobExistsException,
                                             ResourceNotFoundException,
                                             RepositoryJobCreateException
Creates job in workspace and checks it into the repository

Parameters:
jobInfo - Contains information required to create a job as well other additional job attributes
jobCheckinSpec - Contains the information on how to check in the new job file (major version, minor version, etc.). Specifying null will default to a major version specification.
Returns:
Job that was created in the workspace and repository
Throws:
JobExistsException - Thrown if the job already exists at that location
ResourceNotFoundException - Thrown if createParents was specified as false on CreateJobInfo and the parentPath on CreateJobInfo does not exist.
RepositoryJobCreateException - Thrown if there was an error creating the job in the repository

jobExistsInWorkspace

boolean jobExistsInWorkspace(String path)
Confirms whether the job exists at the specified path in the workspace

Parameters:
path - Full path of job
Returns:
true if the job exists, otherwise false

jobExistsInRepository

boolean jobExistsInRepository(String path)
Confirms whether the job exists at the specified path in the repository

Parameters:
path - Full path of job
Returns:
true if the job exists, otherwise false

getJobInWorkspace

Job getJobInWorkspace(String path)
                      throws JobNotFoundException,
                             JobFormatException
Gets the job from the specified path in the workspace

Parameters:
path - Full path of job
Returns:
Job from the job file at the specified path in the workspace
Throws:
JobNotFoundException - Thrown if the job does not exist at the path specified
JobFormatException - Thrown if the job file content is not in the proper format

getJobInRepository

Job getJobInRepository(String path,
                       String version)
                       throws JobNotFoundException,
                              JobFormatException
Gets the job from the specified path in the repository

Parameters:
path - Full path of job
version - Specify a specific version of the job to get. Specifying null will get the latest version.
Returns:
Job from the job file at the specified path in the repository
Throws:
JobNotFoundException - Thrown if the job does not exist at the path specified
JobFormatException - Thrown if the job file content is not in the proper format

updateJobInRepository

Job updateJobInRepository(Job job,
                          ResourceCheckinSpecification checkinSpec)
                          throws JobNotFoundException,
                                 AlreadyCheckedoutException
Updates the job in the repository with information on the specified Job

Parameters:
job - Job containing the information in which to update the job
checkinSpec - Contains the information on how to check in the updated job file (major version, minor version, etc.). Specifying null will default to a minor version specification.
Returns:
Job from the updated job file at the specified path in the repository
Throws:
JobNotFoundException - Thrown if the job no longer exists at the location specified in the job
AlreadyCheckedoutException - Thrown if the job attempting to be updated is already checked out

updateJobInWorkspace

Job updateJobInWorkspace(Job job)
                         throws JobNotFoundException
Updates the job in the workspace with information on the specified Job

Parameters:
job - Job containing the information in which to update the job
Returns:
Job from the updated job file at the specified path in the workspace
Throws:
JobNotFoundException - Thrown if the job no longer exists at the location specified in the job

setRunAsOwner

void setRunAsOwner(Job job,
                   boolean value)
                   throws JobNotFoundException
Sets if the repository job will run as the owner. Default is false.

Parameters:
job - The job to update
value - Value indicating if job should run as the job owner.
Throws:
JobNotFoundException - Thrown if the specified job can not be found.

getRunAsOwner

boolean getRunAsOwner(Job job)
                      throws JobNotFoundException
Get the flag that defines whether the repository job will run as the owner.

Parameters:
job -
Returns:
boolean value indicating if job should run as the job owner or not.
Throws:
JobNotFoundException - Thrown if the specified job can not be found.


Copyright (c) 2016, SAS Institute Inc., Cary, NC, USA