Package dev.galasa.zosbatch
Interface IZosBatchJob
public interface IZosBatchJob
Represents a zOS Batch Job.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancel the batch jobgetJobId()The jobid for this Job.TheIZosBatchJobnameassociated 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 anIZosBatchJobOutputobject without retrieving spool file contentvoidpurge()Cancel the batch job and purge output from the queueRetrieve the batch job output as anIZosBatchJobOutputobjectRetrieve the batch job output as anStringobjectvoidsaveOutputToResultsArchive(String rasPath) Save the job output to the Results Archive StorevoidsaveSpoolFileToResultsArchive(IZosBatchJobOutputSpoolFile spoolFile, String rasPath) Save the supplied spool file to the Results Archive StorevoidsetShouldArchive(boolean shouldArchive) Set flag to control if the job output should be automatically stored to the test output.voidsetShouldCleanup(boolean shouldCleanup) Set flag to control if the job output should be automatically purged from zOS.booleanReturn flag that controls if the job output should be automatically stored to the test outputbooleanReturn flag that controls if the job output should be automatically purged from zOSintWait for a job to complete.intwaitForJob(long timeout) Wait for a job to complete.
-
Method Details
-
getJobname
IZosBatchJobname getJobname()TheIZosBatchJobnameassociated 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_VALUEif return code is non numeric. UsegetRetcode()to get theStringvalue- 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_VALUEif return code is non numeric. UsegetRetcode()to get theStringvalue- Parameters:
timeout- in seconds- Returns:
- highest CC
- Throws:
ZosBatchException
-
listSpoolFiles
Provides a list of the batch job spool files as anIZosBatchJobOutputobject without retrieving spool file content- Returns:
- The job output
- Throws:
ZosBatchException
-
retrieveOutput
Retrieve the batch job output as anIZosBatchJobOutputobject- Returns:
- The job output
- Throws:
ZosBatchException
-
retrieveOutputAsString
Retrieve the batch job output as anStringobject- 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
-