Interface IJESCommandProvider
-
public interface IJESCommandProviderCommand provider for JES related functions.Regarding parameter validation for the methods within this class:
A dataset name is considered invalid if:
- The total length of the name is 0 or is greater than 44 characters.
- The length of any qualifier within the name is 0 or is greater than 8 characters.
- Qualifiers are delimited by anything other than a '.' character.
- Any characters outside of the code page 1047 hex values for A-Z, a-z, 0-9, @, #, $, or - are present.
- Any qualifier (and hence the name itself) starts with a digit (0-9) or a hyphen (-).
A PDS member name is considered invalid if:
- The length of the name is 0 or is greater than 8 characters.
- Any characters outside of the code page 1047 hex values for A-Z, a-z, 0-9, @, #, or $ are present.
- The name starts with a digit (0-9).
Examples:
To obtain anIJESCommandProvider:IZOSHostConnection zosHostConnection = ... // get the JES command provider from a z/OS host connection // note: the command provider will only be usable while the z/OS host // connection is connected to its z/OS host IJESCommandProvider commandProvider = zosHostConnection .getJESCommandProvider();To submit a job from a JCL partitioned dataset member using anIPartitionedDataSetMember:IJESCommandProvider commandProvider = ... IPartitionedDataSetMember member = ... try { // submit the job (the returned JobInfo may be used to // retrieve/monitor the job's status, or to cancel the job) JobInfo jobInfo = commandProvider.submit(member); } catch (DataSetAccessException e) { // the user does not have access to the partitioned dataset ... } catch (DataSetInUseException e) { // the partitioned dataset is enqueued by another user or job ... } catch (DataSetMigratedException e) { // the partitioned dataset has been migrated since it was first // retrieved ... } catch (DataSetNotFoundException e) { // the partitioned dataset can no longer be found ... } catch (MemberNotFoundException e) { // the partitioned dataset member can no longer be found ... }To submit a job from a JCL partitioned dataset member using a partitioned dataset name and member name:IJESCommandProvider commandProvider = ... String pdsName = ... String memberName = ... try { // submit the job (the returned JobInfo may be used to // retrieve/monitor the job's status, or to cancel the job) JobInfo jobInfo = commandProvider.submit(pdsName, memberName); } catch (DataSetAccessException e) { // the user does not have access to the dataset ... } catch (DataSetInUseException e) { // the dataset is enqueued by another user or job ... } catch (DataSetMigratedException e) { // the dataset is migrated ... } catch (DataSetNotFoundException e) { // the dataset could not be found or is not a partitioned dataset ... } catch (MemberNotFoundException e) { // the member could not be found ... }To submit a job from a JCL sequential dataset using anISequentialDataSet:IJESCommandProvider commandProvider = ... ISequentialDataSet sequentialDataSet = ... try { // submit the job (the returned JobInfo may be used to // retrieve/monitor the job's status, or to cancel the job) JobInfo jobInfo = commandProvider.submit(sequentialDataSet); } catch (DataSetAccessException e) { // the user does not have access to the sequential dataset ... } catch (DataSetInUseException e) { // the sequential dataset is enqueued by another user or job ... } catch (DataSetMigratedException e) { // the sequential dataset has been migrated since it was first // retrieved ... } catch (DataSetNotFoundException e) { // the sequential dataset can no longer be found ... }To submit a job from a JCL sequential dataset using a sequential dataset name:IJESCommandProvider commandProvider = ... String sequentialDataSetName = ... try { // submit the job (the returned JobInfo may be used to // retrieve/monitor the job's status, or to cancel the job) JobInfo jobInfo = commandProvider.submit(sequentialDataSetName); } catch (DataSetAccessException e) { // the user does not have access to the dataset ... } catch (DataSetInUseException e) { // the dataset is enqueued by another user or job ... } catch (DataSetMigratedException e) { // the dataset is migrated ... } catch (DataSetNotFoundException e) { // the dataset could not be found or is not a sequential dataset ... }To submit a job from a list ofStringrecords:IJESCommandProvider commandProvider = ... List<String> jclRecords = ... // submit the job (the returned JobInfo may be used to // retrieve/monitor the job's status, or to cancel the job) JobInfo jobInfo = commandProvider.submit(jclRecords);
To check a job's status:IJESCommandProvider commandProvider = ... JobInfo jobInfo = ... // get the job status from the JES command provider JobStatus jobStatus = commandProvider.getJobStatus(jobInfo);
To obtain anISystemLogDataDefinitionfor the active system log (use aJobOutputReaderto read the content of the system log):IJESCommandProvider commandProvider = ... ISystemLogDataDefinition dataDefinition = commandProvider.getActiveSystemLog();
To get a list ofISystemLogDataDefinitioninstances for all available system logs:IJESCommandProvider commandProvider = ... List<ISystemLogDataDefinition> dataDefinitions = commandProvider.getSystemLogs(limit)
To cancel a job in the JES queue:IJESCommandProvider commandProvider = ... commandProvider.cancelJob(jobInfo)
For examples on how to connect to a z/OS host with anIZOSHostConnectionseeIZOSHostConnection.
For examples on how to retrieveIJobs seeIJob.
For examples on how to retrieve a job'sISysoutDataDefinitions seeISysoutDataDefinition.
For examples on how to retrieveISequentialDataSets seeISequentialDataSet.
For examples on how to retrieveIPartitionedDataSetMembers seeIPartitionedDataSetMember.- Since:
- 1.0.0
- Version:
- 2.4.0
- See Also:
IZOSHostConnection,ISequentialDataSet,IPartitionedDataSetMember,IJob,ISysoutDataDefinition,ISystemLogDataDefinition,JobInfo,JobStatus- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancelJob(JobInfo jobInfo, boolean dumpFlag)Cancels the specified job.List<ISysoutDataDefinition>fetchSysoutDataDefinitions(JobInfo jobInfo)Retrieves the current list of sysout data definitions (DDs) for a job with the specified job information.List<IJob>findJobs(String jobNameFilter, String ownerFilter)Returns the list of jobs that match the specified job name filter and/or owner filter.List<IJob>findJobs(String jobNameFilter, String ownerFilter, int jesLimit)Returns the list of jobs that match the specified job name filter and/or owner filter.List<IJob>findJobs(String jobNameFilter, String ownerFilter, int jesLimit, boolean includePrintQueue, boolean includeExecutionQueue)Returns the list of jobs that match the specified job name filter and/or owner filter that are on one of the specified JES queues.ISystemLogDataDefinitiongetActiveSystemLog()Retrieves information for the currently active system log.JobStatusgetJobStatus(JobInfo jobInfo)Retrieves the current status of the job with the specified job information.List<ISystemLogDataDefinition>getSystemLogs(int jesLimit)Retrieves information for available system logs.IZOSHostConnectiongetZOSHostConnection()Returns the z/OS host connection associated with this command provider.JobInfosubmit(IPartitionedDataSetMember member)Submits the content of the specified partitioned dataset (PDS) member as JCL and returns information about the associated job.JobInfosubmit(ISequentialDataSet sequentialDataSet)Submits the content of the specified sequential dataset as JCL and returns information about the associated job.JobInfosubmit(String sequentialDataSetName)Submits the content of a sequential dataset of the specified name as JCL and returns information about the associated job.JobInfosubmit(String pdsName, String memberName)Submits the content a partitioned dataset member with the specified partitioned dataset name and member name as JCL and returns information about the associated job.JobInfosubmit(List<String> jclRecords)Submits the specified list of records as JCL and returns information about the associated job.
-
-
-
Method Detail
-
getZOSHostConnection
IZOSHostConnection getZOSHostConnection()
Returns the z/OS host connection associated with this command provider.- Returns:
- the z/OS host connection
- Since:
- 1.0.0
-
submit
JobInfo submit(IPartitionedDataSetMember member) throws DataSetAccessException, DataSetInUseException, DataSetMigratedException, DataSetNotFoundException, MemberNotFoundException
Submits the content of the specified partitioned dataset (PDS) member as JCL and returns information about the associated job.- Parameters:
member- the partitioned dataset member- Returns:
- the job info
- Throws:
IllegalArgumentException- ifmemberisnullDeniedByUserExitException- if the user site's exit has denied this submissionJobCardException- if a valid job card can not be foundZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occursDataSetAccessException- if the user's credentials do not grant access authority for the parent partitioned datasetDataSetInUseException- if an exclusive enqueue exists on the parent partitioned datasetDataSetMigratedException- if the parent partitioned dataset is migrated (this may occur if the dataset is migrated after it is retrieved from the z/OS host)DataSetNotFoundException- if the parent partitioned dataset no longer exists (this may occur if the dataset is deleted after it is retrieved from the z/OS host)MemberNotFoundException- if the partitioned dataset member no longer exists (this may occur if the member is deleted after it is retrieved from the z/OS host)- Since:
- 1.0.0
-
submit
JobInfo submit(String pdsName, String memberName) throws DataSetAccessException, DataSetInUseException, DataSetMigratedException, DataSetNotFoundException, MemberNotFoundException
Submits the content a partitioned dataset member with the specified partitioned dataset name and member name as JCL and returns information about the associated job.- Parameters:
pdsName- the partitioned dataset namememberName- the member name- Returns:
- the job info
- Throws:
IllegalArgumentException- ifpdsNameisnullor invalid or ifmemberNameisnullor invalidDeniedByUserExitException- if the user site's exit has denied this submissionJobCardException- if a valid job card cannot be foundZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occursDataSetAccessException- if the user's credentials do not grant access authority for the parent partitioned datasetDataSetInUseException- if an exclusive enqueue exists on the parent partitioned datasetDataSetMigratedException- if the parent partitioned dataset is migratedDataSetNotFoundException- if the parent partitioned dataset does not existMemberNotFoundException- if the partitioned dataset member does not exist- Since:
- 1.0.0
-
submit
JobInfo submit(ISequentialDataSet sequentialDataSet) throws DataSetAccessException, DataSetInUseException, DataSetMigratedException, DataSetNotFoundException
Submits the content of the specified sequential dataset as JCL and returns information about the associated job.- Parameters:
sequentialDataSet- the sequential dataset- Returns:
- the job info
- Throws:
IllegalArgumentException- ifsequentialDataSetisnullDeniedByUserExitException- if the user site's exit has denied this submissionJobCardException- if a valid job card cannot be foundZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occursDataSetAccessException- if the user's credentials do not grant access authority for the sequential datasetDataSetInUseException- if an exclusive enqueue exists on the sequential datasetDataSetMigratedException- if the sequential dataset is migrated (this may occur if the dataset is migrated after it is retrieved from the z/OS host)DataSetNotFoundException- if the sequential dataset no longer exists (this may occur if the dataset is deleted after it is retrieved from the z/OS host)- Since:
- 1.0.0
-
submit
JobInfo submit(String sequentialDataSetName) throws DataSetAccessException, DataSetInUseException, DataSetMigratedException, DataSetNotFoundException
Submits the content of a sequential dataset of the specified name as JCL and returns information about the associated job.- Parameters:
sequentialDataSetName- the sequential dataset name- Returns:
- the job info
- Throws:
IllegalArgumentException- ifsequentialDataSetNameisnullor invalidDeniedByUserExitException- if the user site's exit has denied this submissionJobCardException- if a valid job card cannot be foundZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occursDataSetAccessException- if the user's credentials do not grant access authority for the sequential datasetDataSetInUseException- if an exclusive enqueue exists on the sequential datasetDataSetMigratedException- if the sequential dataset is migratedDataSetNotFoundException- if the sequential dataset does not exist- Since:
- 1.0.0
-
submit
JobInfo submit(List<String> jclRecords)
Submits the specified list of records as JCL and returns information about the associated job.- Parameters:
jclRecords- the JCL records- Returns:
- the job info
- Throws:
IllegalArgumentException- ifjclRecordsisnullor emptyDeniedByUserExitException- if the user site's exit has denied this submissionJobCardException- if a valid job card cannot be foundZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occurs- Since:
- 1.0.0
-
getJobStatus
JobStatus getJobStatus(JobInfo jobInfo)
Retrieves the current status of the job with the specified job information.The various submit job methods return
JobInfoobjects that can be used with this method.- Parameters:
jobInfo- the job info- Returns:
- the job status
- Throws:
IllegalArgumentException- ifjobInfoisnullZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occurs- Since:
- 1.0.0
- See Also:
submit(IPartitionedDataSetMember),submit(String, String),submit(ISequentialDataSet),submit(String),submit(List)
-
findJobs
List<IJob> findJobs(String jobNameFilter, String ownerFilter)
Returns the list of jobs that match the specified job name filter and/or owner filter. This method will return all matching jobs on bothPRINTandEXECUTIONJES queues with no JES limit.An empty list will be returned if no jobs match the specified criteria.
A job name filter or an owner filter must be specified. Both may be specified.
Both job name and owner filters can use "*" to match any string of characters.
Examples:
"ABC*" will match on anything that starts with "ABC" "*DEF" will match on anything that ends with "DEF" "*XYZ*" will match on anything that contains "XYZ" "*" will match anything
- Parameters:
jobNameFilter- the job name filterownerFilter- the owner filter- Returns:
- the list of matching jobs
- Throws:
IllegalArgumentException- if bothjobNameFilterandownerFilterisnullor emptyZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occurs- Since:
- 2.2.0
- See Also:
findJobs(String, String, int),findJobs(String, String, int, boolean, boolean)
-
findJobs
List<IJob> findJobs(String jobNameFilter, String ownerFilter, int jesLimit)
Returns the list of jobs that match the specified job name filter and/or owner filter. This method will return all matching jobs on bothPRINTandEXECUTIONJES queues.An empty list will be returned if no jobs match the specified criteria.
A job name filter or an owner filter must be specified. Both may be specified.
Both job name and owner filters can use "*" to match any string of characters.
Examples:
"ABC*" will match on anything that starts with "ABC" "*DEF" will match on anything that ends with "DEF" "*XYZ*" will match on anything that contains "XYZ" "*" will match anything
- Parameters:
jobNameFilter- the job name filterownerFilter- the owner filterjesLimit- the max JES limit of how many jobs to return (use 0 to indicate no limit)- Returns:
- the list of matching jobs
- Throws:
IllegalArgumentException- if bothjobNameFilterandownerFilterisnullor empty, or ifjesLimitis less than 0ZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occurs- Since:
- 2.2.0
- See Also:
findJobs(String, String),findJobs(String, String, int, boolean, boolean)
-
findJobs
List<IJob> findJobs(String jobNameFilter, String ownerFilter, int jesLimit, boolean includePrintQueue, boolean includeExecutionQueue)
Returns the list of jobs that match the specified job name filter and/or owner filter that are on one of the specified JES queues.An empty list will be returned if no jobs match the specified criteria.
A job name filter or an owner filter must be specified. Both may be specified.
Both job name and owner filters can use "*" to match any string of characters.
Examples:
"ABC*" will match on anything that starts with "ABC" "*DEF" will match on anything that ends with "DEF" "*XYZ*" will match on anything that contains "XYZ" "*" will match anything
- Parameters:
jobNameFilter- the job name filterownerFilter- the owner filterjesLimit- the max JES limit of how many jobs to return (use 0 to indicate no limit)includePrintQueue-trueto include jobs on the print queue, otherwisefalseincludeExecutionQueue-trueto include jobs on the execution queue, otherwisefalse- Returns:
- the list of matching jobs
- Throws:
IllegalArgumentException- if bothjobNameFilterandownerFilterarenullor empty, ifjesLimitis less than 0, or if bothincludePrintQueueandincludeExecutionQueuearefalseZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occurs- Since:
- 2.2.0
- See Also:
findJobs(String, String),findJobs(String, String, int)
-
fetchSysoutDataDefinitions
List<ISysoutDataDefinition> fetchSysoutDataDefinitions(JobInfo jobInfo)
Retrieves the current list of sysout data definitions (DDs) for a job with the specified job information.The various submit job methods return
JobInfoobjects that can be used with this method.- Parameters:
jobInfo- the job info- Returns:
- the job's sysout data definitions
- Throws:
IllegalArgumentException- ifjobInfoisnullZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occurs- Since:
- 2.2.0
-
getActiveSystemLog
ISystemLogDataDefinition getActiveSystemLog()
Retrieves information for the currently active system log.- Returns:
ISystemLogDataDefinitionfor the currently active system log. Returnsnullif the active system log could not be found.- Since:
- 2.3.0
-
getSystemLogs
List<ISystemLogDataDefinition> getSystemLogs(int jesLimit)
Retrieves information for available system logs.- Parameters:
jesLimit-intcontaining the maximum number of system logs to return. 0 returns information for all available system logs.- Returns:
List<ISystemOutLogDataDefinition>containing information for available system logs. May return anemptylist, but will never return null.- Since:
- 2.3.0
-
cancelJob
void cancelJob(JobInfo jobInfo, boolean dumpFlag)
Cancels the specified job.- Parameters:
jobInfo-JobInfodescribing the job.dumpFlag-booleanflag indicating if a dump of the job should be generated.- Throws:
IllegalArgumentException- ifjobInfoisnullZOSSystemException- if a z/OS system error occursZOSAbendException- if a z/OS ABEND occurs- Since:
- 2.4.0
-
-