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 an IJESCommandProvider:

     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 an IPartitionedDataSetMember:
     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 an ISequentialDataSet:
     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 of String 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 an ISystemLogDataDefinition for the active system log (use a JobOutputReader to read the content of the system log):
     IJESCommandProvider commandProvider = ...
     ISystemLogDataDefinition dataDefinition = commandProvider.getActiveSystemLog();
     
    To get a list of ISystemLogDataDefinition 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 an IZOSHostConnection see IZOSHostConnection.
    For examples on how to retrieve IJobs see IJob.
    For examples on how to retrieve a job's ISysoutDataDefinitions see ISysoutDataDefinition.
    For examples on how to retrieve ISequentialDataSets see ISequentialDataSet.
    For examples on how to retrieve IPartitionedDataSetMembers see IPartitionedDataSetMember.
    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.