Package dev.galasa.zosbatch
Interface IZosBatchJob
public interface IZosBatchJob
Represents a zOS Batch Job.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancel the batch jobgetJobId()
The jobid for this Job.TheIZosBatchJobname
associated with this jobgetOwner()
The owner for this Job.The batch job completion return code, e.g.
"CC 0000", "CC 0020", "JCL ERROR", "ABEND S0C4" etc.getSpoolFile
(String ddname) Convenience method to retrieve the content of a spool file from the batch job given the ddname.The batch job valueThe batch job value as aString
, e.g.
"INPUT", "ACTIVE", "OUTPUT" etc.
Returns "????????" if the job has not been submittedgetType()
The type for this Job, i.e.Provides a list of the batch job spool files as anIZosBatchJobOutput
object without retrieving spool file contentvoid
purge()
Cancel the batch job and purge output from the queueRetrieve the batch job output as anIZosBatchJobOutput
objectRetrieve the batch job output as anString
objectvoid
saveOutputToResultsArchive
(String rasPath) Save the job output to the Results Archive Storevoid
saveSpoolFileToResultsArchive
(IZosBatchJobOutputSpoolFile spoolFile, String rasPath) Save the supplied spool file to the Results Archive Storevoid
setShouldArchive
(boolean shouldArchive) Set flag to control if the job output should be automatically stored to the test output.void
setShouldCleanup
(boolean shouldCleanup) Set flag to control if the job output should be automatically purged from zOS.boolean
Return flag that controls if the job output should be automatically stored to the test outputboolean
Return flag that controls if the job output should be automatically purged from zOSint
Wait for a job to complete.int
waitForJob
(long timeout) Wait for a job to complete.
-
Method Details
-
getJobname
IZosBatchJobname getJobname()TheIZosBatchJobname
associated with this job- Returns:
- batch job name
-
getJobId
String getJobId()The jobid for this Job. Returns "????????" if no jobid has been associated- Returns:
- batch jobid
-
getOwner
String getOwner()The owner for this Job. Returns "????????" if no owner has been associated- Returns:
- batch job owner
-
getType
String getType()The type for this Job, i.e. "JOB", "STC" or "TSU". Returns "???" if no type has been associated- Returns:
- batch job type
-
getStatus
IZosBatchJob.JobStatus getStatus()The batch job value- Returns:
- batch job value
-
getStatusString
String getStatusString()The batch job value as aString
, e.g.
"INPUT", "ACTIVE", "OUTPUT" etc.
Returns "????????" if the job has not been submittedN.B. Values are implementation dependent
- Returns:
- batch job value
-
getRetcode
String getRetcode()The batch job completion return code, e.g.
"CC 0000", "CC 0020", "JCL ERROR", "ABEND S0C4" etc. Returns "????" if the job has not been submitted- Returns:
-
waitForJob
Wait for a job to complete. Return the highest return code for the job. The method will wait for the default resource wait time before timing out. ReturnsInteger.MIN_VALUE
if return code is non numeric. UsegetRetcode()
to get theString
value- Returns:
- highest CC
- Throws:
ZosBatchException
-
waitForJob
Wait for a job to complete. Return the highest return code for the job. The method will wait for the default resource wait time before timing out. ReturnsInteger.MIN_VALUE
if return code is non numeric. UsegetRetcode()
to get theString
value- Parameters:
timeout
- in seconds- Returns:
- highest CC
- Throws:
ZosBatchException
-
listSpoolFiles
Provides a list of the batch job spool files as anIZosBatchJobOutput
object without retrieving spool file content- Returns:
- The job output
- Throws:
ZosBatchException
-
retrieveOutput
Retrieve the batch job output as anIZosBatchJobOutput
object- Returns:
- The job output
- Throws:
ZosBatchException
-
retrieveOutputAsString
Retrieve the batch job output as anString
object- Returns:
- The job output
- Throws:
ZosBatchException
-
getSpoolFile
Convenience method to retrieve the content of a spool file from the batch job given the ddname.NOTE: Returns the first matching instance in the list. If the batch job has multiple steps, there may be multiple instances of the ddname.
- Parameters:
ddname
- of the spool file- Returns:
- the content of the first found spool file with the specified ddname
- Throws:
ZosBatchException
-
cancel
Cancel the batch job- Throws:
ZosBatchException
-
purge
Cancel the batch job and purge output from the queue- Throws:
ZosBatchException
-
saveOutputToResultsArchive
Save the job output to the Results Archive Store- Parameters:
rasPath
- path in Results Archive Store- Throws:
ZosBatchException
-
setShouldArchive
void setShouldArchive(boolean shouldArchive) Set flag to control if the job output should be automatically stored to the test output. Defaults to true -
shouldArchive
boolean shouldArchive()Return flag that controls if the job output should be automatically stored to the test output -
setShouldCleanup
void setShouldCleanup(boolean shouldCleanup) Set flag to control if the job output should be automatically purged from zOS. Defaults to true -
shouldCleanup
boolean shouldCleanup()Return flag that controls if the job output should be automatically purged from zOS -
saveSpoolFileToResultsArchive
void saveSpoolFileToResultsArchive(IZosBatchJobOutputSpoolFile spoolFile, String rasPath) throws ZosBatchException Save the supplied spool file to the Results Archive Store- Parameters:
spoolFile
- the spool file to saverasPath
- path in Results Archive Store- Throws:
ZosBatchException
-