Package zowe.client.sdk.zosjobs
Class GetJobs
- java.lang.Object
-
- zowe.client.sdk.zosjobs.GetJobs
-
public class GetJobs extends Object
Class to handle obtaining of z/OS batch job information- Version:
- 1.0
- Author:
- Frank Giordano
-
-
Constructor Summary
Constructors Constructor Description GetJobs(ZOSConnection connection)GetJobs Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetJcl(String jobName, String jobId)Get JCL from a job.StringgetJclCommon(CommonJobParams params)Get the JCL that was used to submit a job.StringgetJclForJob(Job job)Get JCL from a job.JobgetJob(String jobId)Get a single job object from an input job id.List<Job>getJobs()Get jobs (defaults to the user ID of the session as owner).List<Job>getJobsByOwner(String owner)Get jobs that are owned by a certain user or pattern of users.List<Job>getJobsByOwnerAndPrefix(String owner, String prefix)Get a list of jobs that match an owner and prefix.List<Job>getJobsByPrefix(String prefix)Get jobs that match a job name by prefix.List<Job>getJobsCommon(GetJobParams params)Get jobs filtered by owner and prefix.StringgetSpoolContent(JobFile jobFile)Get spool content from a job (keeping naming convention patter with this duplication function).StringgetSpoolContentById(String jobName, String jobId, int spoolId)Get spool content from a job using the job name, job ID, and spool ID number from z/OSMF.StringgetSpoolContentCommon(JobFile jobFile)Get spool content from a job.List<JobFile>getSpoolFiles(String jobName, String jobId)Get a list of all spool files for a job.List<JobFile>getSpoolFilesCommon(CommonJobParams params)Get a list of all job spool files for a job.List<JobFile>getSpoolFilesForJob(Job job)Get a list of all job spool files for a job.JobgetStatus(String jobName, String jobId)Get the status and other details (e.g.JobgetStatusCommon(CommonJobParams params)Get the status and other details (e.g.JobgetStatusForJob(Job job)Get the status and other details (e.g.StringgetStatusValue(String jobName, String jobId)Get the status value only for a given job name and id.StringgetStatusValueForJob(Job job)Get the status value for a given job object.StringgetUrl()Get url specified for rest processing.
-
-
-
Constructor Detail
-
GetJobs
public GetJobs(ZOSConnection connection)
GetJobs Constructor.- Parameters:
connection- connection information, see ZOSConnection object
-
-
Method Detail
-
getJobs
public List<Job> getJobs() throws Exception
Get jobs (defaults to the user ID of the session as owner).- Returns:
- list of job objects (matching jobs)
- Throws:
Exception- error on getting a list of jobs
-
getJobsByPrefix
public List<Job> getJobsByPrefix(String prefix) throws Exception
Get jobs that match a job name by prefix. Defaults to job(s) owned by the user ID in the session.- Parameters:
prefix- job name prefix for which to list jobs. Supports wildcard e.g. JOBNM*- Returns:
- list of job objects (matching jobs)
- Throws:
Exception- error on getting a list of jobs
-
getJobsByOwner
public List<Job> getJobsByOwner(String owner) throws Exception
Get jobs that are owned by a certain user or pattern of users.- Parameters:
owner- owner for which to get jobs. Supports wildcard e.g. IBMU* returns jobs owned by all users whose ID beings with "IBMU"- Returns:
- list of job objects (matching jobs)
- Throws:
Exception- error on getting a list of jobs
-
getJobsByOwnerAndPrefix
public List<Job> getJobsByOwnerAndPrefix(String owner, String prefix) throws Exception
Get a list of jobs that match an owner and prefix.- Parameters:
owner- owner for which to get jobs. Supports wildcard e.g. IBMU* returns jobs owned by all users whose ID beings with "IBMU"prefix- prefix for which to get jobs. Supports wildcard e.g. JOBNM* returns jobs with names starting with "JOBNM"- Returns:
- list of job objects (matching jobs)
- Throws:
Exception- error on getting a list of jobs
-
getJob
public Job getJob(String jobId) throws Exception
Get a single job object from an input job id.- Parameters:
jobId- job ID for the job for which you want to get status- Returns:
- list of job objects (matching jobs)
- Throws:
Exception- error on getting job
-
getJobsCommon
public List<Job> getJobsCommon(GetJobParams params) throws Exception
Get jobs filtered by owner and prefix.- Parameters:
params- get job parameters, see GetJobParams object- Returns:
- list of job objects (matching jobs)
- Throws:
Exception- error on getting a list of jobs
-
getStatusValue
public String getStatusValue(String jobName, String jobId) throws Exception
Get the status value only for a given job name and id.- Parameters:
jobName- job name for the job for which you want to get statusjobId- job ID for the job for which you want to get status- Returns:
- status value
- Throws:
Exception- error getting job status
-
getStatusValueForJob
public String getStatusValueForJob(Job job) throws Exception
Get the status value for a given job object.- Parameters:
job- job document- Returns:
- status value
- Throws:
Exception- error getting job status
-
getStatus
public Job getStatus(String jobName, String jobId) throws Exception
Get the status and other details (e.g. owner, return code) for a job.- Parameters:
jobName- job name for the job for which you want to get statusjobId- job ID for the job for which you want to get status- Returns:
- job document (matching job)
- Throws:
Exception- error getting job status
-
getStatusForJob
public Job getStatusForJob(Job job) throws Exception
Get the status and other details (e.g. owner, return code) for a job Alternate version of the API that accepts a Job object returned by other APIs such as SubmitJobs. Even though the parameter and return value are of the same type, the Job object returned will have the current status of the job.- Parameters:
job- job document- Returns:
- job document (matching job)
- Throws:
Exception- error getting job status
-
getStatusCommon
public Job getStatusCommon(CommonJobParams params) throws Exception
Get the status and other details (e.g. owner, return code) for a job.- Parameters:
params- common job parameters, see CommonJobParams object- Returns:
- job document (matching job)
- Throws:
Exception- error getting job status
-
getSpoolFiles
public List<JobFile> getSpoolFiles(String jobName, String jobId) throws Exception
Get a list of all spool files for a job.- Parameters:
jobName- job name for the job for which you want to get a list of spool filesjobId- job ID for the job for which you want to get a list of spool files- Returns:
- list of JobFile objects
- Throws:
Exception- error on getting spool files info
-
getSpoolFilesForJob
public List<JobFile> getSpoolFilesForJob(Job job) throws Exception
Get a list of all job spool files for a job. Alternate version of the API that accepts a Job object returned by other APIs such as SubmitJobs.- Parameters:
job- job for which you would like to get a list of job spool files- Returns:
- list of JobFile objects
- Throws:
Exception- error on getting spool files info
-
getSpoolFilesCommon
public List<JobFile> getSpoolFilesCommon(CommonJobParams params) throws Exception
Get a list of all job spool files for a job.- Parameters:
params- common job parameters, see CommonJobParams object- Returns:
- list of JobFile objects
- Throws:
Exception- error on getting spool files info
-
getJcl
public String getJcl(String jobName, String jobId) throws Exception
Get JCL from a job.- Parameters:
jobName- job name for the job for which you want to retrieve JCLjobId- job ID for the job for which you want to retrieve JCL- Returns:
- job document on resolve
- Throws:
Exception- error on getting jcl content
-
getJclForJob
public String getJclForJob(Job job) throws Exception
Get JCL from a job. Alternate version of the API that accepts a Job object returned by other APIs such as SubmitJobs.- Parameters:
job- job for which you would like to retrieve JCL- Returns:
- JCL content
- Throws:
Exception- error on getting jcl content
-
getJclCommon
public String getJclCommon(CommonJobParams params) throws Exception
Get the JCL that was used to submit a job.- Parameters:
params- common job parameters, see CommonJobParams object- Returns:
- JCL content
- Throws:
Exception- error on getting jcl content
-
getSpoolContent
public String getSpoolContent(JobFile jobFile) throws Exception
Get spool content from a job (keeping naming convention patter with this duplication function).- Parameters:
jobFile- spool file for which you want to retrieve the content- Returns:
- spool content
- Throws:
Exception- error on getting spool content
-
getSpoolContentById
public String getSpoolContentById(String jobName, String jobId, int spoolId) throws Exception
Get spool content from a job using the job name, job ID, and spool ID number from z/OSMF.- Parameters:
jobName- job name for the job containing the spool contentjobId- job id for the job containing the spool contentspoolId- id number assigned by zosmf that identifies the particular job spool file (DD)- Returns:
- spool content
- Throws:
Exception- error on getting spool content
-
getSpoolContentCommon
public String getSpoolContentCommon(JobFile jobFile) throws Exception
Get spool content from a job.- Parameters:
jobFile- spool file for which you want to retrieve the content- Returns:
- spool content
- Throws:
Exception- error on getting spool content
-
getUrl
public String getUrl()
Get url specified for rest processing.- Returns:
- url
-
-