com.ibm.ftt.jes.util.core
Interface IJESJobUtil

All Known Subinterfaces:
IJESJobUtilExtension
All Known Implementing Classes:
JesJobUtil

public interface IJESJobUtil

Job submission interface. Implementations of this interface can be used to submit jobs to the Job Entry Subsystem, and query their status.


Field Summary
static String COPY_RIGHT
           
 
Method Summary
 InputStream getJobContents(String jobId)
          Return the contents of the spool data sets associated with the specified job.
 InputStream getJobContents(String jobId, String stepnameDdname)
          Return the contents of the spool data set associated with the specified stepname/ddname and job.
 List getJobDDNames(String jobId)
          Return a list containing the stepnames/ddnames identifying the spool data sets associated with a specific JES job.
 String getJobReturnCode(String jobId)
          Get the return code for the job identified by jobId.
 boolean hasJobFinishedExecuting(String jobId)
          Determines whether the job with the specified job id has finished execution.
 boolean isConnected()
          Determines whether the system associated with this IJESJobUtil instance is connected.
 String submit(Object resource)
          Submits the specified resource to the system associated with this IJESJobUtil instance.
 

Field Detail

COPY_RIGHT

static final String COPY_RIGHT
See Also:
Constant Field Values
Method Detail

submit

String submit(Object resource)
              throws Exception
Submits the specified resource to the system associated with this IJESJobUtil instance. The contents of the resource should be JCL.

Parameters:
resource - the resource object to be submitted; the resource can be a data set member or a workstation file
Returns:
the job id as a result of the submit operation, or null if the job id returned by the server is not valid
Throws:
Exception - if job submit fails

isConnected

boolean isConnected()
Determines whether the system associated with this IJESJobUtil instance is connected.

Returns:
true if connected, false otherwise

hasJobFinishedExecuting

boolean hasJobFinishedExecuting(String jobId)
Determines whether the job with the specified job id has finished execution.

Parameters:
jobId - the job id to check
Returns:
true if the job has finished, false if still running

getJobContents

InputStream getJobContents(String jobId)
                           throws OperationFailedException
Return the contents of the spool data sets associated with the specified job. The job is identified by the job id which is returned by submit().

Parameters:
jobId - the job id whose contents are to be returned
Returns:
the contents of the JES job spool data sets, or null if job contents are not available. Contents are encoded as UTF-8 bytes.
Throws:
OperationFailedException - if the job associated with job id cannot be found or if the job has not finished executing

getJobContents

InputStream getJobContents(String jobId,
                           String stepnameDdname)
                           throws OperationFailedException
Return the contents of the spool data set associated with the specified stepname/ddname and job.

The job is identified by the job id which is returned by submit().

The stepname/ddname is of the form STEPNAME.DDNAME, or simply DDNAME if no stepname applies. This is the same form as returned by IJESJobUtil.getJobDDNames(String).

Parameters:
jobId - the job id which identifies the JES job whose contents are to be returned
stepnameDdname - the stepname/ddname
Returns:
the contents of the JES job spool data set, or null if job output is not available. Contents are encoded as UTF-8 bytes.
Throws:
OperationFailedException - if the job associated with jobId cannot be found or if the job has not finished executing

getJobDDNames

List getJobDDNames(String jobId)
                   throws OperationFailedException
Return a list containing the stepnames/ddnames identifying the spool data sets associated with a specific JES job.

The job is identified by the job id which is returned by submit().

The stepnames/ddnames are of the form STEPNAME.DDNAME, or simply DDNAME if no stepname applies.

Parameters:
jobId - the job id which identifies the JES job whose spool data set DDNames are to be returned
Returns:
a list containing the DDNames of the spool data sets for the specified job
Throws:
OperationFailedException - if the job associated with jobId cannot be found or if the job has not finished executing

getJobReturnCode

String getJobReturnCode(String jobId)
                        throws OperationFailedException
Get the return code for the job identified by jobId. The most common conventional values are: U0000 = all OK U0004 = minor errors or problems U0008 = significant errors or problems U0012 = major errors or problems, the results (e.g. files or reports produced) should not be trusted. U0016 = very serious problems, do not use the results!

Parameters:
jobId - the Job Id whose return code is to be returned
Returns:
the return code assigned to the job by the remote system or null if no return code has been assigned
Throws:
OperationFailedException - if the job associated with jobId cannot be found or if the job has not finished executing