com.ibm.as400.access
Class JobDescription

java.lang.Object
  extended by com.ibm.as400.access.JobDescription
All Implemented Interfaces:
Serializable

public class JobDescription
extends Object
implements Serializable

Represents an IBM i job description.

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.

See Also:
Serialized Form

Constructor Summary
JobDescription(AS400 system, QSYSObjectPathName path)
          Constructs a JobDescription.
JobDescription(AS400 system, String library, String name)
          Constructs a JobDescription.
 
Method Summary
 String getAccountingCode()
          Returns the accounting code associated with this job description.
 String getCYMDJobDate()
          Returns the job date in CYMD format.
 String getDDMConversation()
          Returns whether Distributed Data Management conversations are kept or dropped when they are not being used.
 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.
 String[] getInitialASPGroupNames()
          Returns the list of initial ASP groups for jobs that use this job description.
 String[] getInitialLibraryList()
          Returns the initial library list that is used for jobs that use this job description.
 String getInquiryMessageReply()
          Indicates how inquiry messages are answered for jobs that use this job description.
 String getJobDateString()
          Returns the date that will be assigned to jobs using this job description when they are started.
 String getJobLogOutput()
          Indicates how the job log will be produced when the job completes.
 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.
 String getJobQueueLibraryName()
          Returns the library of the job queue into which batch jobs using this job description are placed.
 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.
 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.
 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.
 String getName()
          Returns name of the job description about which information is being returned.
 String getOutputQueueLibraryName()
          Returns the name of the library in which the output queue resides.
 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.
 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.
 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.
 String getRoutingData()
          Returns the routing data that is used with this job description to start jobs.
 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.
 String getTextDescription()
          Returns the user text, if any, used to briefly describe the job description.
 String getTimeSliceEndPool()
          Returns whether interactive jobs using this job description should be moved to another main storage pool when they reach time-slice end.
 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(String library)
          Sets the library where the job description is located.
 void setName(String name)
          Sets the job description name.
 void setSystem(AS400 system)
          Sets the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobDescription

public JobDescription(AS400 system,
                      String library,
                      String name)
Constructs a JobDescription.

Parameters:
system - The system where the job description resides.
name - The name of the job description to retrieve.
library - The library containing the job description.

JobDescription

public JobDescription(AS400 system,
                      QSYSObjectPathName path)
Constructs a JobDescription.

Parameters:
system - The system where the job description resides.
path - The fully qualified IFS path to the job description.
Method Detail

refresh

public void refresh()
             throws AS400Exception,
                    AS400SecurityException,
                    ErrorCompletingRequestException,
                    InterruptedException,
                    ObjectDoesNotExistException,
                    IOException
Refreshes the values for all attributes of the job description.

Throws:
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.
InterruptedException - If this thread is interrupted.
ObjectDoesNotExistException - If the object does not exist on the system.
IOException - If an error occurs while communicating with the system.

getAccountingCode

public String getAccountingCode()
Returns the accounting code associated with this job description.

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.

Returns:
The accounting code.

isAllowMultipleThreads

public boolean isAllowMultipleThreads()
Returns whether or not the job is allowed to run with multiple user threads.

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.

Returns:
Whether or not the job is allowed to run with multiple user threads. Possible values are:
  • true - Multiple threads allowed.
  • false - Multiple user threads not allowed.

getCYMDJobDate

public String getCYMDJobDate()
Returns the job date in CYMD format.

The date that will be assigned to jobs using this job description when they are started. The possible values are:

Returns:
The job date in CYYMMDD format.

getDeviceRecoveryAction

public String getDeviceRecoveryAction()
Returns the action to take when an I/O error occurs for the interactive job's requesting program device. The possible values are:

Returns:
The device recovery action.

getDDMConversation

public String getDDMConversation()
Returns whether Distributed Data Management conversations are kept or dropped when they are not being used. The possible values are:

Returns:
Whether DDM conversations are kept or dropped.

getEndSeverity

public int getEndSeverity()
Returns the message severity level of escape messages that can cause a batch job to end. The possible values are from 0 through 99.

Returns:
The message severity level of escape messages that can cause a batch job to end.

isHoldOnJobQueue

public boolean isHoldOnJobQueue()
Returns whether jobs using this job description are put on the job queue in the hold condition.

Returns:
Whether jobs using this job description are put on the job queue in the hold condition.

getInitialLibraryList

public String[] getInitialLibraryList()
Returns the initial library list that is used for jobs that use this job description. Only the libraries in the user portion of the library list are included.

Returns:
The initial library list as an array of type String

getInquiryMessageReply

public String getInquiryMessageReply()
Indicates how inquiry messages are answered for jobs that use this job description. The possible values are:

Returns:
The inquiry message reply behavior.

getInitialASPGroupNames

public String[] getInitialASPGroupNames()
Returns the list of initial ASP groups for jobs that use this job description. This does not include the system ASP or basic user ASPs. null if system is pre-V5R2.

Returns:
The list of initial ASP groups. null if system is pre-V5R2.

getJobDateString

public String getJobDateString()
Returns the date that will be assigned to jobs using this job description when they are started. The possible values are:

Returns:
The date that will be assigned to jobs using this job description.

getLibraryName

public String getLibraryName()
Returns name of the library in which the job description resides.

Returns:
The name of the library in which the job description resides.

getName

public String getName()
Returns name of the job description about which information is being returned.

Returns:
The name of the job description about which information is being returned.

getJobLogOutput

public String getJobLogOutput()
Indicates how the job log will be produced when the job completes. The possible values are:

Returns:
The job log output behavior.

getJobMessageQueueFullAction

public String getJobMessageQueueFullAction()
Returns the action to be taken when the job message queue becomes full.
The possible values are:

Returns:
The action to be taken when the job message queue becomes full.

getJobMessageQueueMaximumSize

public int getJobMessageQueueMaximumSize()
Returns the maximum size (in megabytes) of the job message queue.
The possible values are:

Returns:
The maximum size (in megabytes) of the job message queue.

getJobQueueLibraryName

public String getJobQueueLibraryName()
Returns the library of the job queue into which batch jobs using this job description are placed.

Returns:
The library of the job queue into which batch jobs using this job description are placed.

getJobQueueName

public String getJobQueueName()
Returns the name of the job queue into which batch jobs using this job description are placed.

Returns:
The name of the job queue into which batch jobs using this job description are placed.

getJobQueuePriority

public int getJobQueuePriority()
Returns the scheduling priority of each job that uses this job description.
The highest priority is 1 and the lowest priority is 9.

Returns:
The scheduling priority of each job that uses this job description.

getJobSwitches

public byte getJobSwitches()
Returns the initial settings for a group of eight job switches used by jobs that use this job description. These switches can be set or tested in a program and used to control a program's flow.
For each bit position, the possible values are '0' (off) and '1' (on).

Returns:
A bit-map containing the initial settings for the eight job switches.

isLoggingOfCLPrograms

public boolean isLoggingOfCLPrograms()
Returns whether or not commands are logged for CL programs that are run.

Returns:
Whether or not commands are logged for CL programs that are run.

getMessageLoggingLevel

public int getMessageLoggingLevel()
Returns the type of information logged. Possible types are:

Returns:
The type of information logged.

getMessageLoggingSeverity

public 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. The possible values are from 0 through 99.

Returns:
The message logging severity level.

getMessageLoggingText

public 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. The possible values are:

Returns:
The level of message text that is written in the job log.

getOutputQueueLibraryName

public String getOutputQueueLibraryName()
Returns the name of the library in which the output queue resides.

Returns:
The name of the library in which the output queue resides.

getOutputQueueName

public String getOutputQueueName()
Returns the name of the default output queue that is used for spooled output produced by jobs that use this job description. Possible values are:

Returns:
The name of the default output queue.

getOutputQueuePriority

public int getOutputQueuePriority()
Returns the output priority for spooled files that are produced by jobs using this job description. The highest priority is 1, and the lowest priority is 9.

Returns:
The output priority.

getPrinterDeviceName

public 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. Possible values are:

Returns:
The name of the printer device.

getPrintText

public 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.

Returns:
The print text.

getRoutingData

public String getRoutingData()
Returns the routing data that is used with this job description to start jobs. The possible values are:

Returns:
The routing data.

getSpooledFileAction

public String getSpooledFileAction()
Returns the value that specifies whether spooled files can be accessed through job interfaces once a job has completed its normal activity. null if system is pre-V5R2. Possible values are:

Returns:
Spooled file action. null if system is pre-V5R2.

getSyntaxCheckSeverity

public 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. The possible values are:

Returns:
The syntax check severity.

getSystem

public AS400 getSystem()
Returns the system where the job description is located.

Returns:
The system where the job description resides.

getTextDescription

public String getTextDescription()
Returns the user text, if any, used to briefly describe the job description.

Returns:
The text description. "" if no description.

getTimeSliceEndPool

public String getTimeSliceEndPool()
Returns whether interactive jobs using this job description should be moved to another main storage pool when they reach time-slice end. The possible values are:

Returns:
Whether interactive jobs using this job description should be moved to another main storage pool when they reach time-slice end.

getUserName

public String getUserName()
Returns the name of the user profile associated with this job description.

Returns:
The name of the user profile associated with this job description.

setLibraryName

public void setLibraryName(String library)
Sets the library where the job description is located. Cannot be changed if the object has established a connection to the system

Parameters:
library - The name of the library

setName

public void setName(String name)
Sets the job description name. Cannot be changed after the object has established a connection to the system.

Parameters:
name - The job description name

setSystem

public void setSystem(AS400 system)
Sets the system. Cannot be changed after the object has established a connection to the system.

Parameters:
system - The system where the job description resides.