Class JobList
- java.lang.Object
-
- com.ibm.as400.access.JobList
-
- All Implemented Interfaces:
- java.io.Serializable
public class JobList extends java.lang.Object implements java.io.Serializable
Represents a list of jobs on the system. By default, all jobs are selected. To filter the list, use theaddJobSelectionCriteria()
method.- See Also:
Job
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description 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
Constructors Constructor and Description JobList()
Constructs a JobList object.JobList(AS400 system)
Constructs a JobList object.
-
Method Summary
Methods Modifier and Type Method and Description 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 list on the system when this object is garbage collected.java.util.Enumeration
getJobs()
Returns an Enumeration that wraps the list of jobs on the system.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 object representing the system on which the jobs exist.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 the PropertyChangeListener.void
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the 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 object representing the system on which the jobs exist.void
setUser(java.lang.String user)
Sets the user name value that describes which jobs are returned.
-
-
-
Field Detail
-
ALL
public static final 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);
Constant indicating that all the jobs are returned.- See Also:
- Constant Field Values
-
SELECTION_JOB_NAME
public static final int SELECTION_JOB_NAME
Selection type used for job selection based on job name. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a String. Possible values are:- A specific job name.
- A generic name.
SELECTION_JOB_NAME_ALL
SELECTION_JOB_NAME_CURRENT
SELECTION_JOB_NAME_ONLY
SELECTION_JOB_NAME_ALL
.
-
SELECTION_JOB_NAME_ALL
public static final java.lang.String SELECTION_JOB_NAME_ALL
Selection value indicating all jobs will be selected regardless of the job name. The user name and job type fields must be specified.- See Also:
SELECTION_JOB_NAME
, Constant Field Values
-
SELECTION_JOB_NAME_CURRENT
public static final java.lang.String SELECTION_JOB_NAME_CURRENT
Selection value indicating all jobs with the current job's name will be selected.- See Also:
SELECTION_JOB_NAME
, Constant Field Values
-
SELECTION_JOB_NAME_ONLY
public static final java.lang.String SELECTION_JOB_NAME_ONLY
Selection value indicating only the job in which this program is running will be selected. The user name and job type fields must be blank.- See Also:
SELECTION_JOB_NAME
, Constant Field Values
-
SELECTION_USER_NAME
public static final int SELECTION_USER_NAME
Selection type used for job selection based on user name. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a String. Possible values are:- A specific user profile name.
- A generic name.
SELECTION_USER_NAME_ALL
SELECTION_USER_NAME_CURRENT
SELECTION_USER_NAME_ALL
.
-
SELECTION_USER_NAME_ALL
public static final 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. The job name and job number fields must be specified.- See Also:
SELECTION_USER_NAME
, Constant Field Values
-
SELECTION_USER_NAME_CURRENT
public static final java.lang.String SELECTION_USER_NAME_CURRENT
Selection value indicating all jobs that use the current job's user profile will be selected.- See Also:
SELECTION_USER_NAME
, Constant Field Values
-
SELECTION_JOB_NUMBER
public static final int SELECTION_JOB_NUMBER
Selection type used for job selection based on job number. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a String. Possible values are:- A specific job number.
SELECTION_JOB_NUMBER_ALL
SELECTION_JOB_NUMBER_ALL
.
-
SELECTION_JOB_NUMBER_ALL
public static final 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. The job name and user name fields must be specified.- See Also:
SELECTION_JOB_NUMBER
, Constant Field Values
-
SELECTION_JOB_TYPE
public static final int SELECTION_JOB_TYPE
Selection type used for job selection based on job type. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a String. Possible values are:SELECTION_JOB_TYPE_ALL
- One of the following job types:
SELECTION_JOB_TYPE_ALL
.- See Also:
Job.JOB_TYPE
, Constant Field Values
-
SELECTION_JOB_TYPE_ALL
public static final java.lang.String SELECTION_JOB_TYPE_ALL
Selection value indicating all job types will be selected.- See Also:
SELECTION_JOB_TYPE
, Constant Field Values
-
SELECTION_PRIMARY_JOB_STATUS_ACTIVE
public static final int SELECTION_PRIMARY_JOB_STATUS_ACTIVE
Selection type used for job selection based on primary job status. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a Boolean. The default is true.- See Also:
Job.JOB_STATUS
, Constant Field Values
-
SELECTION_PRIMARY_JOB_STATUS_JOBQ
public static final int SELECTION_PRIMARY_JOB_STATUS_JOBQ
Selection type used for job selection based on primary job status. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a Boolean. The default is true.- See Also:
Job.JOB_STATUS
, Constant Field Values
-
SELECTION_PRIMARY_JOB_STATUS_OUTQ
public static final int SELECTION_PRIMARY_JOB_STATUS_OUTQ
Selection type used for job selection based on primary job status. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a Boolean. The default is true.- See Also:
Job.JOB_STATUS
, Constant Field Values
-
SELECTION_ACTIVE_JOB_STATUS
public static final int SELECTION_ACTIVE_JOB_STATUS
Selection type used for job selection based on active job status. Multiple selection values are allowed for this selection type. The selection value corresponding to this selection type is a String. SeeJob.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_JOB_QUEUE_STATUS_SCHEDULE
public static final int SELECTION_JOB_QUEUE_STATUS_SCHEDULE
Selection type used for job selection based on a job's status on the job queue. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a Boolean. The default is true. This value is only used when the value for SELECTION_PRIMARY_JOB_STATUS_JOBQ is true.
-
SELECTION_JOB_QUEUE_STATUS_HELD
public static final int SELECTION_JOB_QUEUE_STATUS_HELD
Selection type used for job selection based on a job's status on the job queue. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a Boolean. The default is true. This value is only used when the value for SELECTION_PRIMARY_JOB_STATUS_JOBQ is true.
-
SELECTION_JOB_QUEUE_STATUS_READY
public static final int SELECTION_JOB_QUEUE_STATUS_READY
Selection type used for job selection based on a job's status on the job queue. Only one selection value is allowed for this selection type. The selection value corresponding to this selection type is a Boolean. The default is true. This value is only used when the value for SELECTION_PRIMARY_JOB_STATUS_JOBQ is true.
-
SELECTION_JOB_QUEUE
public static final int SELECTION_JOB_QUEUE
Selection type used for job selection based on job queue. Multiple selection values are allowed for this selection type. The selection value corresponding to this selection type is a String representing the fully-qualified integrated file system name for a server job queue. By default no selection values are specified for this selection type. This value is only used when the value for SELECTION_PRIMARY_JOB_STATUS_JOBQ is true.
-
SELECTION_INITIAL_USER
public static final int SELECTION_INITIAL_USER
Selection type used for job selection based on the user name for a job's initial thread. Multiple selection values are allowed for this selection type. The selection value corresponding to this selection type is a String. By default no selection values are specified for this selection type.- See Also:
- Constant Field Values
-
SELECTION_SERVER_TYPE
public static final int SELECTION_SERVER_TYPE
Selection type used for job selection based on the server type. Multiple selection values are allowed for this selection type. The selection value corresponding to this selection type is a String. By default no selection values are specified for this selection type. Possible values are:- A server type. See
Job.SERVER_TYPE
. - A generic value.
SELECTION_SERVER_TYPE_ALL
SELECTION_SERVER_TYPE_BLANK
- See Also:
Job.SERVER_TYPE
, Constant Field Values
- A server type. See
-
SELECTION_SERVER_TYPE_ALL
public static final java.lang.String SELECTION_SERVER_TYPE_ALL
Selection value indicating all jobs with a server type will be selected.- See Also:
SELECTION_SERVER_TYPE
, Constant Field Values
-
SELECTION_SERVER_TYPE_BLANK
public static final java.lang.String SELECTION_SERVER_TYPE_BLANK
Selection value indicating all jobs without a server type will be selected.- See Also:
SELECTION_SERVER_TYPE
, Constant Field Values
-
SELECTION_JOB_TYPE_ENHANCED
public static final int SELECTION_JOB_TYPE_ENHANCED
Selection type used for job selection based on the enhanced job type. Multiple selection values are allowed for this selection type. The selection value corresponding to this selection type is an Integer. By default no selection values are specified for this selection type. Possible values are:SELECTION_JOB_TYPE_ENHANCED_ALL_BATCH
SELECTION_JOB_TYPE_ENHANCED_ALL_INTERACTIVE
SELECTION_JOB_TYPE_ENHANCED_ALL_PRESTART
- Any of the enhanced job types:
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
- See Also:
Job.JOB_TYPE_ENHANCED
, Constant Field Values
-
SELECTION_JOB_TYPE_ENHANCED_ALL_BATCH
public static final java.lang.Integer SELECTION_JOB_TYPE_ENHANCED_ALL_BATCH
Selection value indicating all the batch job types will be selected.
-
SELECTION_JOB_TYPE_ENHANCED_ALL_INTERACTIVE
public static final java.lang.Integer SELECTION_JOB_TYPE_ENHANCED_ALL_INTERACTIVE
Selection value indicating all the interactive job types will be selected.
-
SELECTION_JOB_TYPE_ENHANCED_ALL_PRESTART
public static final java.lang.Integer SELECTION_JOB_TYPE_ENHANCED_ALL_PRESTART
Selection value indicating all the prestart job types will be selected.
-
-
Constructor Detail
-
JobList
public JobList()
Constructs a JobList object. The system must be set before retrieving the list of jobs.
-
JobList
public JobList(AS400 system)
Constructs a JobList object.- Parameters:
system
- The system object representing the system on which the jobs exist.
-
-
Method Detail
-
addJobAttributeToRetrieve
public void addJobAttributeToRetrieve(int attribute)
Adds a job attribute that will be retrieved for each job in this job list. This method allows the Job objects that are retrieved from this JobList to have some of their attributes already filled in, so that a call toJob.getValue()
does not result in another API call back to the system 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()
.- Parameters:
attribute
- The job attribute to retrieve. Possible values are all job attributes contained in theJob
class, excluding the following:- Job.CLIENT_IP_ADDRESS
- Job.CURRENT_LIBRARY
- Job.CURRENT_LIBRARY_EXISTENCE
- Job.ELAPSED_CPU_PERCENT_USED
- Job.ELAPSED_CPU_PERCENT_USED_FOR_DATABASE
- Job.ELAPSED_CPU_TIME_USED
- Job.ELAPSED_CPU_TIME_USED_FOR_DATABASE
- Job.ELAPSED_DISK_IO
- Job.ELAPSED_DISK_IO_ASYNCH
- Job.ELAPSED_DISK_IO_SYNCH
- Job.ELAPSED_INTERACTIVE_RESPONSE_TIME
- Job.ELAPSED_INTERACTIVE_TRANSACTIONS
- Job.ELAPSED_LOCK_WAIT_TIME
- Job.ELAPSED_PAGE_FAULTS
- Job.ELAPSED_TIME
- Job.PRODUCT_LIBRARIES
- Job.SUBMITTED_BY_JOB_NUMBER
- Job.SUBMITTED_BY_USER
- Job.SYSTEM_LIBRARY_LIST
- Job.USER_LIBRARY_LIST
Job.resetStatistics()
andJob.loadStatistics()
methods.- See Also:
clearJobAttributesToRetrieve()
,Job
-
addJobAttributeToSortOn
public void addJobAttributeToSortOn(int attribute, boolean sortOrder)
Adds a job attribute used to sort the list.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()
.- Parameters:
attribute
- The job attribute on which to sort. Possible values are all job attributes contained in theJob
class, excluding the following:- Job.CLIENT_IP_ADDRESS
- Job.CURRENT_LIBRARY
- Job.CURRENT_LIBRARY_EXISTENCE
- Job.ELAPSED_CPU_PERCENT_USED
- Job.ELAPSED_CPU_PERCENT_USED_FOR_DATABASE
- Job.ELAPSED_CPU_TIME_USED
- Job.ELAPSED_CPU_TIME_USED_FOR_DATABASE
- Job.ELAPSED_DISK_IO
- Job.ELAPSED_DISK_IO_ASYNCH
- Job.ELAPSED_DISK_IO_SYNCH
- Job.ELAPSED_INTERACTIVE_RESPONSE_TIME
- Job.ELAPSED_INTERACTIVE_TRANSACTIONS
- Job.ELAPSED_LOCK_WAIT_TIME
- Job.ELAPSED_PAGE_FAULTS
- Job.ELAPSED_TIME
- Job.PRODUCT_LIBRARIES
- Job.SUBMITTED_BY_JOB_NUMBER
- Job.SUBMITTED_BY_USER
- Job.SYSTEM_LIBRARY_LIST
- Job.USER_LIBRARY_LIST
sortOrder
- true to sort ascending; false to sort descending.- See Also:
clearJobAttributesToSortOn()
,Job
-
addJobSelectionCriteria
public void addJobSelectionCriteria(int selectionType, java.lang.Object selectionValue) throws java.beans.PropertyVetoException
Adds a selection type and value to be used to filter the list of jobs. If a selection type supports only one value, then the selection value used will be the one that was passed on the most recent call to this method for that selection type.By default, all jobs are selected, because most of the filter criteria settings default to true. To filter the list further, the job selection criteria should be set to false. For example, to retrieve a list of only active jobs, you would do:
JobList list = new JobList(system); list.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_ACTIVE, Boolean.TRUE); list.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_JOBQ, Boolean.FALSE); list.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_OUTQ, Boolean.FALSE); Enumeration jobs = list.getJobs();
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()
.- Parameters:
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.- Throws:
java.beans.PropertyVetoException
- If the recipient wishes the property change to be rolled back.- See Also:
clearJobSelectionCriteria()
,Job
-
clearJobAttributesToRetrieve
public void clearJobAttributesToRetrieve()
Clears the job attributes to be retrieved. This removes all of the job attributes that would be retrieved. Some attributes are always retrieved, regardless if they are in this list or not, such as job name, job number, and user name.- See Also:
addJobAttributeToRetrieve(int)
-
clearJobAttributesToSortOn
public void clearJobAttributesToSortOn()
Clears the job attributes used to sort the list. This resets all of the job sort parameters to their default values.
-
clearJobSelectionCriteria
public void clearJobSelectionCriteria() throws java.beans.PropertyVetoException
Clears the selection types and values used to filter the list of jobs. This resets all of the job selection parameters to their default values.- Throws:
java.beans.PropertyVetoException
- If the recipient wishes the property change to be rolled back.- See Also:
addJobSelectionCriteria(int, java.lang.Object)
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange() method will be called each time the value of any bound property is changed.- Parameters:
listener
- The listener.- See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)
-
addVetoableChangeListener
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a VetoableChangeListener. The specified VetoableChangeListener's vetoableChange() method will be called each time the value of any constrained property is changed.- Parameters:
listener
- The listener.- See Also:
removeVetoableChangeListener(java.beans.VetoableChangeListener)
-
close
public void close() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Closes the job list on the system. This releases any system resources previously in use by this job list. This will not close the connection to the Host Server job held by the associated AS400 object.- Throws:
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.- See Also:
load()
-
finalize
protected void finalize() throws java.lang.Throwable
Closes the list on the system when this object is garbage collected.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
getJobs
public java.util.Enumeration getJobs() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Returns an Enumeration that wraps the list of jobs on the system. This method callsload()
implicitly if needed. The Enumeration retrieves jobs from the system in blocks as needed when nextElement() is called. This JobList should not be closed until the program is done processing elements out of the Enumeration. That is, this method does not retrieve all of the jobs from the system up front -- it retrieves them as needed, which allows for a lower memory footprint versus more calls to the system. The block size used internally by the Enumeration is set to 1000 jobs.- Returns:
- An Enumeration of
Job
objects. - Throws:
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.- See Also:
Job
-
getJobs
public Job[] getJobs(int listOffset, int number) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Returns a subset of the list of jobs in the job list. This method allows the user to retrieve the job list from the system in pieces. If a call toload()
is made (either implicitly or explicitly), then the jobs at a given list 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.- Parameters:
listOffset
- The offset in the list of jobs (0-based). This value must be greater than or equal to 0 and less than the list length; or specify -1 to retrieve all of the jobs. Note: Prior to JTOpen 7.2, this parameter was incorrectly described.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. If the listOffset is -1, this parameter is ignored.- Returns:
- The array of retrieved
Job
objects. The length of this array may not necessarily be equal to number, depending upon the size of the list on the system, and the specified listOffset. - Throws:
AS400Exception
- If an error occurs.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.- See Also:
Job
-
getLength
public int getLength()
Returns the number of jobs in the list. This method implicitly callsload()
if it has not already been called.- Returns:
- The number of jobs, or 0 if no list was retrieved.
- See Also:
load()
-
getName
public java.lang.String getName()
Returns the job name that describes which jobs are returned.- Returns:
- The job name.
- See Also:
setName(java.lang.String)
-
getNumber
public java.lang.String getNumber()
Returns the job number that describes which jobs are returned.- Returns:
- The job number.
- See Also:
setNumber(java.lang.String)
-
getSystem
public AS400 getSystem()
Returns the system object representing the system on which the jobs exist.- Returns:
- The system object representing the system on which the jobs exist. If the system has not been set, null is returned.
-
getUser
public java.lang.String getUser()
Returns the user name that describes which jobs are returned.- Returns:
- The user name.
- See Also:
setUser(java.lang.String)
-
load
public void load() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Loads the list of jobs on the system. This method informs the system to build a list of jobs given the previously added job attributes to select, retrieve, and sort. This method blocks until the system returns the total number of jobs it has compiled. A subsequent call togetJobs()
will retrieve the actual job information and attributes for each job in the list from the system.This method updates the list length.
- Throws:
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.- See Also:
getLength()
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the PropertyChangeListener. If the PropertyChangeListener is not on the list, nothing is done.- Parameters:
listener
- The listener object.
-
removeVetoableChangeListener
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the VetoableChangeListener. If the VetoableChangeListener is not on the list, nothing is done.- Parameters:
listener
- The listener object.
-
setName
public void setName(java.lang.String name) throws java.beans.PropertyVetoException
Sets the job name that describes which jobs are returned. The default is SELECTION_JOB_NAME_ALL. This takes effect the next time the list of jobs is retrieved or refreshed.- Parameters:
name
- The job name, orSELECTION_JOB_NAME_ALL
for all job names.- Throws:
java.beans.PropertyVetoException
- If any of the registered listeners vetos the property change.- See Also:
addJobSelectionCriteria(int, java.lang.Object)
,getName()
-
setNumber
public void setNumber(java.lang.String number) throws java.beans.PropertyVetoException
Sets the job number that describes which jobs are returned. The default is SELECTION_JOB_NUMBER_ALL. This takes effect the next time the list of jobs is retrieved or refreshed.- Parameters:
number
- The job number, orSELECTION_JOB_NUMBER_ALL
for all job numbers.- Throws:
java.beans.PropertyVetoException
- If any of the registered listeners vetos the property change.- See Also:
addJobSelectionCriteria(int, java.lang.Object)
,getNumber()
-
setSystem
public void setSystem(AS400 system) throws java.beans.PropertyVetoException
Sets the system object representing the system on which the jobs exist. The system cannot be changed once a connection to the system has been established.- Parameters:
system
- The system object representing the system on which the jobs exists.- Throws:
java.beans.PropertyVetoException
- If any of the registered listeners vetos the property change.
-
setUser
public void setUser(java.lang.String user) throws java.beans.PropertyVetoException
Sets the user name value that describes which jobs are returned. The default is SELECTION_USER_NAME_ALL. This takes effect the next time the list of jobs is retrieved or refreshed.- Parameters:
user
- The user name, orSELECTION_USER_NAME_ALL
for all user names.- Throws:
java.beans.PropertyVetoException
- If any of the registered listeners vetos the property change.- See Also:
addJobSelectionCriteria(int, java.lang.Object)
,getUser()
-
-