com.ibm.ftt.jes.util.core
Class JesJobUtil

java.lang.Object
  extended by com.ibm.ftt.jes.util.core.JesJobUtil
All Implemented Interfaces:
IJESJobUtil

public class JesJobUtil
extends Object
implements IJESJobUtil

Utility class for submitting jobs to JES.


Field Summary
static String COPY_RIGHT
           
 
Constructor Summary
JesJobUtil(IOSImage systemImage)
          Creates a JesJobUtil instance for the specified system.
 
Method Summary
 InputStream getJobContents(String jobId)
          Return the contents of the spool datasets for the specified job.
 InputStream getJobContents(String jobId, String ddName)
          Return the contents of the job output spool dataset associated with a specified DDName, e.g JESMSGLG, JESJCL or JESYSMSG.
 List getJobDDNames(String jobId)
          Return a list containing the DDNames of the output spool datasets for 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPY_RIGHT

public static final String COPY_RIGHT
See Also:
Constant Field Values
Constructor Detail

JesJobUtil

public JesJobUtil(IOSImage systemImage)
Creates a JesJobUtil instance for the specified system.

Parameters:
systemImage - system associated with this utility instance
Method Detail

isConnected

public boolean isConnected()
Description copied from interface: IJESJobUtil
Determines whether the system associated with this IJESJobUtil instance is connected.

Specified by:
isConnected in interface IJESJobUtil
Returns:
true if connected, false otherwise

hasJobFinishedExecuting

public boolean hasJobFinishedExecuting(String jobId)
Description copied from interface: IJESJobUtil
Determines whether the job with the specified Job ID has finished execution.

Specified by:
hasJobFinishedExecuting in interface IJESJobUtil
Parameters:
jobId - the Job Id to check
Returns:
true if the job has finished, false if still running

submit

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

Specified by:
submit in interface IJESJobUtil
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

getJobContents

public InputStream getJobContents(String jobId)
                           throws OperationFailedException
Description copied from interface: IJESJobUtil
Return the contents of the spool datasets for the specified job. The job is identified by the job id which is returned by submit()

Specified by:
getJobContents in interface IJESJobUtil
Parameters:
jobId - the Job Id whose contents are to be returned
Returns:
the contents of the JES job output datasets or null if job output is not available
Throws:
OperationFailedException - if the job associated with jobId cannot be found or if the job has not finished executing.

getJobContents

public InputStream getJobContents(String jobId,
                                  String ddName)
                           throws OperationFailedException
Description copied from interface: IJESJobUtil
Return the contents of the job output spool dataset associated with a specified DDName, e.g JESMSGLG, JESJCL or JESYSMSG. The job is identified by the job id which is returned by submit()

Specified by:
getJobContents in interface IJESJobUtil
Parameters:
jobId - the Job Id which identifies the JES job whose contents are to be returned
ddName - the DDName associated with the job output dataset.
Returns:
the contents of the JES job output dataset or null if job output is not available
Throws:
OperationFailedException - if the job associated with jobId cannot be found or if the job has not finished executing.

getJobDDNames

public List getJobDDNames(String jobId)
                   throws OperationFailedException
Description copied from interface: IJESJobUtil
Return a list containing the DDNames of the output spool datasets for a specific JES job. The job is identified by the job id which is returned by submit()

Specified by:
getJobDDNames in interface IJESJobUtil
Parameters:
jobId - the Job Id which identifies the JES job whose output spool dataset DDNames are to be returned
Returns:
a list containing the DDNames of the output spool datasets for the specified job
Throws:
OperationFailedException - if the job associated with jobId cannot be found or if the job has not finished executing.

getJobReturnCode

public String getJobReturnCode(String jobId)
                        throws OperationFailedException
Description copied from interface: IJESJobUtil
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!

Specified by:
getJobReturnCode in interface IJESJobUtil
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.