public class JobDescription
extends java.lang.Object
implements java.io.Serializable
Note that calling any of the attribute getters for the first time will
result in an implicit call to refresh()
.
If any exception is thrown by an implicit call to refresh(),
it will be logged to Trace.ERROR
and rethrown as a java.lang.RuntimeException.
However, should an exception occur during an
explicit call to refresh(), the exception will be thrown as-is to the caller.
Implementation note: This class internally calls the Retrieve Job Description (QWDRJOBD) API.
This class was inspired by a prototype submitted by Kendall Coolidge.
Constructor and Description |
---|
JobDescription(AS400 system,
QSYSObjectPathName path)
Constructs a JobDescription.
|
JobDescription(AS400 system,
java.lang.String library,
java.lang.String name)
Constructs a JobDescription.
|
Modifier and Type | Method and Description |
---|---|
boolean |
exists()
Determines if the Job Description currently exists on the system.
|
java.lang.String |
getAccountingCode()
Returns the accounting code associated with this job description.
|
java.lang.String |
getCYMDJobDate()
Returns the job date in CYMD format.
|
java.lang.String |
getDDMConversation()
Returns whether Distributed Data Management conversations are kept or dropped when they are not being used.
|
java.lang.String |
getDeviceRecoveryAction()
Returns the action to take when an I/O error occurs for the
interactive job's requesting program device.
|
int |
getEndSeverity()
Returns the message severity level of escape messages that can cause a batch job to end.
|
java.lang.String[] |
getInitialASPGroupNames()
Returns the list of initial ASP groups for jobs that use this job description.
|
java.lang.String[] |
getInitialLibraryList()
Returns the initial library list that is used for jobs that use this job
description.
|
java.lang.String |
getInquiryMessageReply()
Indicates how inquiry messages are answered for jobs that use this job description.
|
java.lang.String |
getJobDateString()
Returns the date that will be assigned to jobs using this job description
when they are started.
|
java.lang.String |
getJobLogOutput()
Indicates how the job log will be produced when the job completes.
|
java.lang.String |
getJobMessageQueueFullAction()
Returns the action to be taken when the job message queue becomes full.
|
int |
getJobMessageQueueMaximumSize()
Returns the maximum size (in megabytes) of the job message queue.
|
java.lang.String |
getJobQueueLibraryName()
Returns the library of the job queue into which batch jobs using this job description are placed.
|
java.lang.String |
getJobQueueName()
Returns the name of the job queue into which batch jobs using this job description are placed.
|
int |
getJobQueuePriority()
Returns the scheduling priority of each job that uses this job description.
|
byte |
getJobSwitches()
Returns the initial settings for a group of eight job switches used by jobs that
use this job description.
|
java.lang.String |
getLibraryName()
Returns name of the library in which the job description resides.
|
int |
getMessageLoggingLevel()
Returns the type of information logged.
|
int |
getMessageLoggingSeverity()
Returns the severity level that is used in conjunction with the logging level to determine which error messages are logged in the job log.
|
java.lang.String |
getMessageLoggingText()
Returns the level of message text that is written in the job log when a message
is logged according to the logging level and logging severity.
|
java.lang.String |
getName()
Returns name of the job description about which information is being returned.
|
ObjectDescription |
getObjectDescription()
Returns an ObjectDescription instance representing the job description.
|
java.lang.String |
getOutputQueueLibraryName()
Returns the name of the library in which the output queue resides.
|
java.lang.String |
getOutputQueueName()
Returns the name of the default output queue that is used for spooled
output produced by jobs that use this job description.
|
int |
getOutputQueuePriority()
Returns the output priority for spooled files that are produced by jobs using this
job description.
|
java.lang.String |
getPrinterDeviceName()
Returns the name of the printer device or the source for the name of the printer
device that is used for all spooled files created by jobs that use this job description.
|
java.lang.String |
getPrintText()
Returns the line of text (if any) that is printed at the bottom of each page of
printed output for jobs using this job description.
|
java.lang.String |
getRoutingData()
Returns the routing data that is used with this job description to start jobs.
|
java.lang.String |
getSpooledFileAction()
Returns the value that specifies whether spooled files can be accessed through
job interfaces once a job has completed its normal activity.
|
int |
getSyntaxCheckSeverity()
Returns whether requests placed on the job's message queue are checked for syntax
as CL commands, and the message severity that causes a syntax error to end
processing of a job.
|
AS400 |
getSystem()
Returns the system where the job description is located.
|
java.lang.String |
getTextDescription()
Returns the user text, if any, used to briefly describe the job description.
|
java.lang.String |
getTimeSliceEndPool()
Returns whether interactive jobs using this job description should be moved to
another main storage pool when they reach time-slice end.
|
java.lang.String |
getUserName()
Returns the name of the user profile associated with this job description.
|
boolean |
isAllowMultipleThreads()
Returns whether or not the job is allowed to run with
multiple user threads.
|
boolean |
isHoldOnJobQueue()
Returns whether jobs using this job description are put on the job queue in the
hold condition.
|
boolean |
isLoggingOfCLPrograms()
Returns whether or not commands are logged for CL programs that are run.
|
void |
refresh()
Refreshes the values for all attributes of the job description.
|
void |
setLibraryName(java.lang.String library)
Sets the library where the job description is located.
|
void |
setName(java.lang.String name)
Sets the job description name.
|
void |
setSystem(AS400 system)
Sets the system.
|
public JobDescription(AS400 system, java.lang.String library, java.lang.String name)
system
- The system where the job description resides.name
- The name of the job description to retrieve.library
- The library containing the job description.public JobDescription(AS400 system, QSYSObjectPathName path)
system
- The system where the job description resides.path
- The fully qualified IFS path to the job description.public void refresh() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, ObjectDoesNotExistException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.ObjectDoesNotExistException
- If the object does not exist on the system.java.io.IOException
- If an error occurs while communicating with the system.public java.lang.String getAccountingCode()
An identifier assigned to jobs that use this job description. This code is used to collect system resource use information. If the special value *USRPRF is specified, the accounting code used for jobs using this job description is obtained from the job's user profile.
public boolean isAllowMultipleThreads()
This attribute does not prevent the operating system from creating system threads in the job. This attribute is not allowed to be changed once a job starts. This attribute applies to autostart jobs, prestart jobs, batch jobs submitted from job schedule entries, and jobs started by using the Submit Job (SBMJOB) and Batch Job (BCHJOB) commands. This attribute is ignored when starting all other types of jobs. This attribute should be set to true only in job descriptions that are used exclusively with functions that create multiple user threads.
public java.lang.String getCYMDJobDate()
The date that will be assigned to jobs using this job description when they are started. The possible values are:
public java.lang.String getDeviceRecoveryAction()
public java.lang.String getDDMConversation()
public int getEndSeverity()
public boolean isHoldOnJobQueue()
public java.lang.String[] getInitialLibraryList()
public java.lang.String getInquiryMessageReply()
public java.lang.String[] getInitialASPGroupNames()
public java.lang.String getJobDateString()
public java.lang.String getLibraryName()
public java.lang.String getName()
public java.lang.String getJobLogOutput()
public java.lang.String getJobMessageQueueFullAction()
public int getJobMessageQueueMaximumSize()
public java.lang.String getJobQueueLibraryName()
public java.lang.String getJobQueueName()
public int getJobQueuePriority()
public byte getJobSwitches()
public boolean isLoggingOfCLPrograms()
public int getMessageLoggingLevel()
public int getMessageLoggingSeverity()
public java.lang.String getMessageLoggingText()
public java.lang.String getOutputQueueLibraryName()
public java.lang.String getOutputQueueName()
public int getOutputQueuePriority()
public java.lang.String getPrinterDeviceName()
public java.lang.String getPrintText()
public java.lang.String getRoutingData()
public java.lang.String getSpooledFileAction()
public int getSyntaxCheckSeverity()
public AS400 getSystem()
public java.lang.String getTextDescription()
public java.lang.String getTimeSliceEndPool()
public java.lang.String getUserName()
public void setLibraryName(java.lang.String library)
library
- The name of the librarypublic void setName(java.lang.String name)
name
- The job description namepublic void setSystem(AS400 system)
system
- The system where the job description resides.public boolean exists() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the system API (that queries job description information) is missing.public ObjectDescription getObjectDescription()