Interface IJESCommandProvider
-
public interface IJESCommandProvider
Command 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 ofString
records: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 anISystemLogDataDefinition
for the active system log (use aJobOutputReader
to read the content of the system log):IJESCommandProvider commandProvider = ... ISystemLogDataDefinition dataDefinition = commandProvider.getActiveSystemLog();
To get a list ofISystemLogDataDefinition
instances 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 anIZOSHostConnection
seeIZOSHostConnection
.
For examples on how to retrieveIJob
s seeIJob
.
For examples on how to retrieve a job'sISysoutDataDefinition
s seeISysoutDataDefinition
.
For examples on how to retrieveISequentialDataSet
s seeISequentialDataSet
.
For examples on how to retrieveIPartitionedDataSetMember
s 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 void
cancelJob(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.ISystemLogDataDefinition
getActiveSystemLog()
Retrieves information for the currently active system log.JobStatus
getJobStatus(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.IZOSHostConnection
getZOSHostConnection()
Returns the z/OS host connection associated with this command provider.JobInfo
submit(IPartitionedDataSetMember member)
Submits the content of the specified partitioned dataset (PDS) member as JCL and returns information about the associated job.JobInfo
submit(ISequentialDataSet sequentialDataSet)
Submits the content of the specified sequential dataset as JCL and returns information about the associated job.JobInfo
submit(String sequentialDataSetName)
Submits the content of a sequential dataset of the specified name as JCL and returns information about the associated job.JobInfo
submit(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.JobInfo
submit(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
- ifmember
isnull
DeniedByUserExitException
- 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
- ifpdsName
isnull
or invalid or ifmemberName
isnull
or 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
- ifsequentialDataSet
isnull
DeniedByUserExitException
- 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
- ifsequentialDataSetName
isnull
or 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
- ifjclRecords
isnull
or 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
JobInfo
objects that can be used with this method.- Parameters:
jobInfo
- the job info- Returns:
- the job status
- Throws:
IllegalArgumentException
- ifjobInfo
isnull
ZOSSystemException
- 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 bothPRINT
andEXECUTION
JES 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 bothjobNameFilter
andownerFilter
isnull
or 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 bothPRINT
andEXECUTION
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)- Returns:
- the list of matching jobs
- Throws:
IllegalArgumentException
- if bothjobNameFilter
andownerFilter
isnull
or empty, or ifjesLimit
is 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
-true
to include jobs on the print queue, otherwisefalse
includeExecutionQueue
-true
to include jobs on the execution queue, otherwisefalse
- Returns:
- the list of matching jobs
- Throws:
IllegalArgumentException
- if bothjobNameFilter
andownerFilter
arenull
or empty, ifjesLimit
is less than 0, or if bothincludePrintQueue
andincludeExecutionQueue
arefalse
ZOSSystemException
- 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
JobInfo
objects that can be used with this method.- Parameters:
jobInfo
- the job info- Returns:
- the job's sysout data definitions
- Throws:
IllegalArgumentException
- ifjobInfo
isnull
ZOSSystemException
- 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:
ISystemLogDataDefinition
for the currently active system log. Returnsnull
if 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
-int
containing 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 anempty
list, but will never return null.- Since:
- 2.3.0
-
cancelJob
void cancelJob(JobInfo jobInfo, boolean dumpFlag)
Cancels the specified job.- Parameters:
jobInfo
-JobInfo
describing the job.dumpFlag
-boolean
flag indicating if a dump of the job should be generated.- Throws:
IllegalArgumentException
- ifjobInfo
isnull
ZOSSystemException
- if a z/OS system error occursZOSAbendException
- if a z/OS ABEND occurs- Since:
- 2.4.0
-
-