|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.JobList
The JobList class represents a list of OS/400 jobs. By default, all jobs are selected. To filter the list,
use the addJobSelectionCriteria()
method.
Field Summary | |
static java.lang.String |
ALL
Deprecated. Use the selection constant that corresponds to the particular job selection criteria you are filtering. For example, to select jobs for all job names, do:
JobList list = new JobList(system);
list.addJobSelectionCriteria(JobList.SELECTION_JOB_NAME, JobList.SELECTION_JOB_NAME_ALL);
For backwards compatibility, this has the same effect:
JobList list = new JobList(system);
list.setName(JobList.SELECTION_JOB_NAME_ALL);
|
static int |
SELECTION_ACTIVE_JOB_STATUS
Selection type used for job selection based on active job status. |
static int |
SELECTION_INITIAL_USER
Selection type used for job selection based on the user name for a job's initial thread. |
static int |
SELECTION_JOB_NAME
Selection type used for job selection based on job name. |
static java.lang.String |
SELECTION_JOB_NAME_ALL
Selection value indicating all jobs will be selected regardless of the job name. |
static java.lang.String |
SELECTION_JOB_NAME_CURRENT
Selection value indicating all jobs with the current job's name will be selected. |
static java.lang.String |
SELECTION_JOB_NAME_ONLY
Selection value indicating only the job in which this program is running will be selected. |
static int |
SELECTION_JOB_NUMBER
Selection type used for job selection based on job number. |
static java.lang.String |
SELECTION_JOB_NUMBER_ALL
Selection value indicating all jobs with the specified job name and user name will be selected, regardless of the job number. |
static int |
SELECTION_JOB_QUEUE
Selection type used for job selection based on job queue. |
static int |
SELECTION_JOB_QUEUE_STATUS_HELD
Selection type used for job selection based on a job's status on the job queue. |
static int |
SELECTION_JOB_QUEUE_STATUS_READY
Selection type used for job selection based on a job's status on the job queue. |
static int |
SELECTION_JOB_QUEUE_STATUS_SCHEDULE
Selection type used for job selection based on a job's status on the job queue. |
static int |
SELECTION_JOB_TYPE
Selection type used for job selection based on job type. |
static java.lang.String |
SELECTION_JOB_TYPE_ALL
Selection value indicating all job types will be selected. |
static int |
SELECTION_JOB_TYPE_ENHANCED
Selection type used for job selection based on the enhanced job type. |
static java.lang.Integer |
SELECTION_JOB_TYPE_ENHANCED_ALL_BATCH
Selection value indicating all the batch job types will be selected. |
static java.lang.Integer |
SELECTION_JOB_TYPE_ENHANCED_ALL_INTERACTIVE
Selection value indicating all the interactive job types will be selected. |
static java.lang.Integer |
SELECTION_JOB_TYPE_ENHANCED_ALL_PRESTART
Selection value indicating all the prestart job types will be selected. |
static int |
SELECTION_PRIMARY_JOB_STATUS_ACTIVE
Selection type used for job selection based on primary job status. |
static int |
SELECTION_PRIMARY_JOB_STATUS_JOBQ
Selection type used for job selection based on primary job status. |
static int |
SELECTION_PRIMARY_JOB_STATUS_OUTQ
Selection type used for job selection based on primary job status. |
static int |
SELECTION_SERVER_TYPE
Selection type used for job selection based on the server type. |
static java.lang.String |
SELECTION_SERVER_TYPE_ALL
Selection value indicating all jobs with a server type will be selected. |
static java.lang.String |
SELECTION_SERVER_TYPE_BLANK
Selection value indicating all jobs without a server type will be selected. |
static int |
SELECTION_USER_NAME
Selection type used for job selection based on user name. |
static java.lang.String |
SELECTION_USER_NAME_ALL
Selection value indicating all jobs that use the specified job name will be selected, regardless of the user name. |
static java.lang.String |
SELECTION_USER_NAME_CURRENT
Selection value indicating all jobs that use the current job's user profile will be selected. |
Constructor Summary | |
JobList()
Constructs a JobList object. |
|
JobList(AS400 system)
Constructs a JobList object. |
Method Summary | |
void |
addJobAttributeToRetrieve(int attribute)
Adds a job attribute that will be retrieved for each job in this job list. |
void |
addJobAttributeToSortOn(int attribute,
boolean sortOrder)
Adds a job attribute used to sort the list. |
void |
addJobSelectionCriteria(int selectionType,
java.lang.Object selectionValue)
Adds a selection type and value to be used to filter the list of jobs. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a VetoableChangeListener. |
void |
clearJobAttributesToRetrieve()
Clears the job attributes to be retrieved. |
void |
clearJobAttributesToSortOn()
Clears the job attributes used to sort the list. |
void |
clearJobSelectionCriteria()
Clears the selection types and values used to filter the list of jobs. |
void |
close()
Closes the job list on the system. |
protected void |
finalize()
Closes the job list on the system when this object is garbage collected. |
java.util.Enumeration |
getJobs()
Returns the list of jobs in the job list. |
Job[] |
getJobs(int listOffset,
int number)
Returns a subset of the list of jobs in the job list. |
int |
getLength()
Returns the number of jobs in the list. |
java.lang.String |
getName()
Returns the job name that describes which jobs are returned. |
java.lang.String |
getNumber()
Returns the job number that describes which jobs are returned. |
AS400 |
getSystem()
Returns the system. |
java.lang.String |
getUser()
Returns the user name that describes which jobs are returned. |
void |
load()
Loads the list of jobs on the system. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a VetoableChangeListener. |
void |
setName(java.lang.String name)
Sets the job name that describes which jobs are returned. |
void |
setNumber(java.lang.String number)
Sets the job number that describes which jobs are returned. |
void |
setSystem(AS400 system)
Sets the system. |
void |
setUser(java.lang.String user)
Sets the user name value that describes which jobs are returned. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ALL
JobList list = new JobList(system);
list.addJobSelectionCriteria(JobList.SELECTION_JOB_NAME, JobList.SELECTION_JOB_NAME_ALL);
For backwards compatibility, this has the same effect:
JobList list = new JobList(system);
list.setName(JobList.SELECTION_JOB_NAME_ALL);
public static final int SELECTION_JOB_NAME
SELECTION_JOB_NAME_ALL
SELECTION_JOB_NAME_CURRENT
SELECTION_JOB_NAME_ONLY
SELECTION_JOB_NAME_ALL
.setName(java.lang.String)
,
Job.JOB_NAME
public static final java.lang.String SELECTION_JOB_NAME_ALL
SELECTION_JOB_NAME
public static final java.lang.String SELECTION_JOB_NAME_CURRENT
SELECTION_JOB_NAME
public static final java.lang.String SELECTION_JOB_NAME_ONLY
SELECTION_JOB_NAME
public static final int SELECTION_USER_NAME
SELECTION_USER_NAME_ALL
SELECTION_USER_NAME_CURRENT
SELECTION_USER_NAME_ALL
.setUser(java.lang.String)
,
Job.USER_NAME
public static final java.lang.String SELECTION_USER_NAME_ALL
SELECTION_USER_NAME
public static final java.lang.String SELECTION_USER_NAME_CURRENT
SELECTION_USER_NAME
public static final int SELECTION_JOB_NUMBER
SELECTION_JOB_NUMBER_ALL
SELECTION_JOB_NUMBER_ALL
.setNumber(java.lang.String)
,
Job.JOB_NUMBER
public static final java.lang.String SELECTION_JOB_NUMBER_ALL
SELECTION_JOB_NUMBER
public static final int SELECTION_JOB_TYPE
SELECTION_JOB_TYPE_ALL
SELECTION_JOB_TYPE_ALL
.Job.JOB_TYPE
public static final java.lang.String SELECTION_JOB_TYPE_ALL
SELECTION_JOB_TYPE
public static final int SELECTION_PRIMARY_JOB_STATUS_ACTIVE
Job.JOB_STATUS
public static final int SELECTION_PRIMARY_JOB_STATUS_JOBQ
Job.JOB_STATUS
public static final int SELECTION_PRIMARY_JOB_STATUS_OUTQ
Job.JOB_STATUS
public static final int SELECTION_ACTIVE_JOB_STATUS
Job.ACTIVE_JOB_STATUS
for allowed values.
By default no selection values are specified for this selection type.
This value is only used when the value for SELECTION_PRIMARY_JOB_STATUS_ACTIVE is true.SELECTION_PRIMARY_JOB_STATUS_ACTIVE
,
Job.ACTIVE_JOB_STATUS
public static final int SELECTION_JOB_QUEUE_STATUS_SCHEDULE
SELECTION_PRIMARY_JOB_STATUS_JOBQ
,
Job.JOB_QUEUE_STATUS
public static final int SELECTION_JOB_QUEUE_STATUS_HELD
SELECTION_PRIMARY_JOB_STATUS_JOBQ
,
Job.JOB_QUEUE_STATUS
public static final int SELECTION_JOB_QUEUE_STATUS_READY
SELECTION_PRIMARY_JOB_STATUS_JOBQ
,
Job.JOB_QUEUE_STATUS
public static final int SELECTION_JOB_QUEUE
SELECTION_PRIMARY_JOB_STATUS_JOBQ
,
QSYSObjectPathName
,
Job.JOB_QUEUE
public static final int SELECTION_INITIAL_USER
public static final int SELECTION_SERVER_TYPE
Job.SERVER_TYPE
.
SELECTION_SERVER_TYPE_ALL
SELECTION_SERVER_TYPE_BLANK
Job.SERVER_TYPE
public static final java.lang.String SELECTION_SERVER_TYPE_ALL
SELECTION_SERVER_TYPE
public static final java.lang.String SELECTION_SERVER_TYPE_BLANK
SELECTION_SERVER_TYPE
public static final int SELECTION_JOB_TYPE_ENHANCED
SELECTION_JOB_TYPE_ENHANCED_ALL_BATCH
SELECTION_JOB_TYPE_ENHANCED_ALL_INTERACTIVE
SELECTION_JOB_TYPE_ENHANCED_ALL_PRESTART
Job.JOB_TYPE_ENHANCED_AUTOSTART
Job.JOB_TYPE_ENHANCED_BATCH
Job.JOB_TYPE_ENHANCED_BATCH_IMMEDIATE
Job.JOB_TYPE_ENHANCED_BATCH_MRT
Job.JOB_TYPE_ENHANCED_BATCH_ALTERNATE_SPOOL_USER
Job.JOB_TYPE_ENHANCED_COMM_PROCEDURE_START_REQUEST
Job.JOB_TYPE_ENHANCED_INTERACTIVE
Job.JOB_TYPE_ENHANCED_INTERACTIVE_GROUP
Job.JOB_TYPE_ENHANCED_INTERACTIVE_SYSREQ
Job.JOB_TYPE_ENHANCED_INTERACTIVE_SYSREQ_AND_GROUP
Job.JOB_TYPE_ENHANCED_PRESTART
Job.JOB_TYPE_ENHANCED_PRESTART_BATCH
Job.JOB_TYPE_ENHANCED_PRESTART_COMM
Job.JOB_TYPE_ENHANCED_READER
Job.JOB_TYPE_ENHANCED_SUBSYSTEM
Job.JOB_TYPE_ENHANCED_SYSTEM
Job.JOB_TYPE_ENHANCED_WRITER
Job.JOB_TYPE_ENHANCED
public static final java.lang.Integer SELECTION_JOB_TYPE_ENHANCED_ALL_BATCH
SELECTION_JOB_TYPE_ENHANCED
,
Job.JOB_TYPE_ENHANCED_BATCH
,
Job.JOB_TYPE_ENHANCED_BATCH_IMMEDIATE
,
Job.JOB_TYPE_ENHANCED_BATCH_MRT
,
Job.JOB_TYPE_ENHANCED_BATCH_ALTERNATE_SPOOL_USER
public static final java.lang.Integer SELECTION_JOB_TYPE_ENHANCED_ALL_INTERACTIVE
SELECTION_JOB_TYPE_ENHANCED
,
Job.JOB_TYPE_ENHANCED_INTERACTIVE
,
Job.JOB_TYPE_ENHANCED_INTERACTIVE_GROUP
,
Job.JOB_TYPE_ENHANCED_INTERACTIVE_SYSREQ
,
Job.JOB_TYPE_ENHANCED_INTERACTIVE_SYSREQ_AND_GROUP
public static final java.lang.Integer SELECTION_JOB_TYPE_ENHANCED_ALL_PRESTART
SELECTION_JOB_TYPE_ENHANCED
,
Job.JOB_TYPE_ENHANCED_PRESTART
,
Job.JOB_TYPE_ENHANCED_PRESTART_BATCH
,
Job.JOB_TYPE_ENHANCED_PRESTART_COMM
Constructor Detail |
public JobList()
setSystem(com.ibm.as400.access.AS400)
public JobList(AS400 system)
system
- The system.Method Detail |
public void addJobAttributeToRetrieve(int attribute)
Job.getValue()
does not result in another API call back to the server
for each job in the list.
The list of job attributes is maintained internally even when this JobList is closed and re-used.
To start over with a new set of job attributes to retrieve, call clearJobAttributesToRetrieve()
.
attribute
- The job attribute to retrieve.
Possible values are all job attributes contained in the Job
class,
excluding the following:
clearJobAttributesToRetrieve()
,
Job
public void addJobSelectionCriteria(int selectionType, java.lang.Object selectionValue) throws java.beans.PropertyVetoException
The list of job selection criteria is maintained internally even when this JobList is closed and re-used.
To start over with a new set of job selection criteria, call clearJobSelectionCriteria()
.
selectionType
- The constant indicating which selection type used to filter the list.
Possible values are:
SELECTION_JOB_NAME
SELECTION_USER_NAME
SELECTION_JOB_NUMBER
SELECTION_JOB_TYPE
SELECTION_PRIMARY_JOB_STATUS_ACTIVE
SELECTION_PRIMARY_JOB_STATUS_JOBQ
SELECTION_PRIMARY_JOB_STATUS_OUTQ
SELECTION_ACTIVE_JOB_STATUS
SELECTION_JOB_QUEUE_STATUS_SCHEDULE
SELECTION_JOB_QUEUE_STATUS_READY
SELECTION_JOB_QUEUE_STATUS_HELD
SELECTION_JOB_QUEUE
SELECTION_INITIAL_USER
SELECTION_SERVER_TYPE
SELECTION_JOB_TYPE_ENHANCED
selectionValue
- The value for the selection type. See the individual selection type
constants for the appropriate object or constant to use. Some selection types allow multiple
selection values to be added.clearJobSelectionCriteria()
,
Job
public void addJobAttributeToSortOn(int attribute, boolean sortOrder)
The list of job attributes to sort on is maintained internally even when this JobList is closed and re-used.
To start over with a new set of job attributes to sort on, call clearJobAttributesToSortOn()
.
attribute
- The job attribute on which to sort.
Possible values are all job attributes contained in the Job
class,
excluding the following:
sortOrder
- true to sort ascending; false to sort descending.clearJobAttributesToSortOn()
,
Job
public void clearJobAttributesToSortOn()
addJobAttributeToSortOn(int, boolean)
public void clearJobAttributesToRetrieve()
addJobAttributeToRetrieve(int)
public void clearJobSelectionCriteria() throws java.beans.PropertyVetoException
addJobSelectionCriteria(int, java.lang.Object)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public void close() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
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.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
public java.util.Enumeration getJobs() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Job
objects.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.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 AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.ServerStartupException
- If the AS/400 server cannot be started.java.net.UnknownHostException
- If the AS/400 system cannot be located.Job
public Job[] getJobs(int listOffset, int number) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
load()
is made (either implicitly or explicitly),
then the jobs at a given offset will change, so a subsequent call to
getJobs() with the same listOffset and number
will most likely not return the same Jobs as the previous call.listOffset
- The offset into the list of jobs. This value must be greater than 0 and
less than the list length, or specify -1 to retrieve all of the jobs.number
- The number of jobs to retrieve out of the list, starting at the specified
listOffset. This value must be greater than or equal to 0 and less than or equal
to the list length.Job
objects.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.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.Job
public int getLength()
load()
if it has not already been called.load()
public java.lang.String getName()
setName(java.lang.String)
public java.lang.String getNumber()
setNumber(java.lang.String)
public AS400 getSystem()
setSystem(com.ibm.as400.access.AS400)
public java.lang.String getUser()
setUser(java.lang.String)
public void load() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
getJobs()
will retrieve the actual job information
and attributes for each job in the list from the system.
This method updates the list length.
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.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 object does not exist on the system.ServerStartupException
- If the server cannot be started.java.net.UnknownHostException
- If the system cannot be located.getLength()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setName(java.lang.String name) throws java.beans.PropertyVetoException
name
- The job name, or SELECTION_JOB_NAME_ALL
for all job names.java.beans.PropertyVetoException
- If the change is vetoed.addJobSelectionCriteria(int, java.lang.Object)
,
getName()
public void setNumber(java.lang.String number) throws java.beans.PropertyVetoException
number
- The job number, or SELECTION_JOB_NUMBER_ALL
for all job numbers.java.beans.PropertyVetoException
- If the change is vetoed.addJobSelectionCriteria(int, java.lang.Object)
,
getNumber()
public void setSystem(AS400 system) throws java.beans.PropertyVetoException
system
- The system.java.beans.PropertyVetoException
- If the property change is vetoed.getSystem()
public void setUser(java.lang.String user) throws java.beans.PropertyVetoException
user
- The user name, or SELECTION_USER_NAME_ALL
for all user names.java.beans.PropertyVetoException
- If the change is vetoed.addJobSelectionCriteria(int, java.lang.Object)
,
getUser()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |