com.ibm.as400.access
Class JobList

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

public class JobList
extends Object
implements Serializable

Represents a list of jobs on the system. By default, all jobs are selected. To filter the list, use the addJobSelectionCriteria() method.

See Also:
Job, Serialized Form

Field Summary
Modifier and Type Field and Description
static 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 String SELECTION_JOB_NAME_ALL
          Selection value indicating all jobs will be selected regardless of the job name.
static String SELECTION_JOB_NAME_CURRENT
          Selection value indicating all jobs with the current job's name will be selected.
static 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 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 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 Integer SELECTION_JOB_TYPE_ENHANCED_ALL_BATCH
          Selection value indicating all the batch job types will be selected.
static Integer SELECTION_JOB_TYPE_ENHANCED_ALL_INTERACTIVE
          Selection value indicating all the interactive job types will be selected.
static 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 String SELECTION_SERVER_TYPE_ALL
          Selection value indicating all jobs with a server type will be selected.
static 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 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 String SELECTION_USER_NAME_CURRENT
          Selection value indicating all jobs that use the current job's user profile will be selected.
 
Constructor Summary
Constructor and Description
JobList()
          Constructs a JobList object.
JobList(AS400 system)
          Constructs a JobList object.
 
Method Summary
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, Object selectionValue)
          Adds a selection type and value to be used to filter the list of jobs.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 void addVetoableChangeListener(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.
 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.
 String getName()
          Returns the job name that describes which jobs are returned.
 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.
 String getUser()
          Returns the user name that describes which jobs are returned.
 void load()
          Loads the list of jobs on the system.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the PropertyChangeListener.
 void removeVetoableChangeListener(VetoableChangeListener listener)
          Removes the VetoableChangeListener.
 void setName(String name)
          Sets the job name that describes which jobs are returned.
 void setNumber(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(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

ALL

public static final 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: The default is SELECTION_JOB_NAME_ALL.

See Also:
setName(java.lang.String), Job.JOB_NAME, Constant Field Values

SELECTION_JOB_NAME_ALL

public static final 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 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 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: The default is SELECTION_USER_NAME_ALL.

See Also:
setUser(java.lang.String), Job.USER_NAME, Constant Field Values

SELECTION_USER_NAME_ALL

public static final 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 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: The default is SELECTION_JOB_NUMBER_ALL.

See Also:
setNumber(java.lang.String), Job.JOB_NUMBER, Constant Field Values

SELECTION_JOB_NUMBER_ALL

public static final 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: The default is SELECTION_JOB_TYPE_ALL.

See Also:
Job.JOB_TYPE, Constant Field Values

SELECTION_JOB_TYPE_ALL

public static final 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. See 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.

See Also:
SELECTION_PRIMARY_JOB_STATUS_ACTIVE, Job.ACTIVE_JOB_STATUS, Constant Field Values

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.

See Also:
SELECTION_PRIMARY_JOB_STATUS_JOBQ, Job.JOB_QUEUE_STATUS, Constant Field Values

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.

See Also:
SELECTION_PRIMARY_JOB_STATUS_JOBQ, Job.JOB_QUEUE_STATUS, Constant Field Values

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.

See Also:
SELECTION_PRIMARY_JOB_STATUS_JOBQ, Job.JOB_QUEUE_STATUS, Constant Field Values

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.

See Also:
SELECTION_PRIMARY_JOB_STATUS_JOBQ, QSYSObjectPathName, Job.JOB_QUEUE, Constant Field Values

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:

See Also:
Job.SERVER_TYPE, Constant Field Values

SELECTION_SERVER_TYPE_ALL

public static final 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 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:

See Also:
Job.JOB_TYPE_ENHANCED, Constant Field Values

SELECTION_JOB_TYPE_ENHANCED_ALL_BATCH

public static final Integer SELECTION_JOB_TYPE_ENHANCED_ALL_BATCH
Selection value indicating all the batch job types will be selected.

See Also:
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

SELECTION_JOB_TYPE_ENHANCED_ALL_INTERACTIVE

public static final Integer SELECTION_JOB_TYPE_ENHANCED_ALL_INTERACTIVE
Selection value indicating all the interactive job types will be selected.

See Also:
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

SELECTION_JOB_TYPE_ENHANCED_ALL_PRESTART

public static final Integer SELECTION_JOB_TYPE_ENHANCED_ALL_PRESTART
Selection value indicating all the prestart job types will be selected.

See Also:
SELECTION_JOB_TYPE_ENHANCED, Job.JOB_TYPE_ENHANCED_PRESTART, Job.JOB_TYPE_ENHANCED_PRESTART_BATCH, Job.JOB_TYPE_ENHANCED_PRESTART_COMM
Constructor Detail

JobList

public JobList()
Constructs a JobList object. The system must be set before retrieving the list of jobs.

See Also:
setSystem(com.ibm.as400.access.AS400)

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 to Job.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 the Job 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
To retrieve any of the ELAPSED statistics, use the Job.resetStatistics() and Job.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 the Job 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,
                                    Object selectionValue)
                             throws 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:
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:
PropertyVetoException
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.

See Also:
addJobAttributeToSortOn(int, boolean)

clearJobSelectionCriteria

public void clearJobSelectionCriteria()
                               throws 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:
PropertyVetoException
See Also:
addJobSelectionCriteria(int, java.lang.Object)

addPropertyChangeListener

public void addPropertyChangeListener(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(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,
                  InterruptedException,
                  IOException,
                  ObjectDoesNotExistException
Closes the job list on the system. This releases any system resources previously in use by this job list.

Throws:
AS400SecurityException - If a security or authority error occurs.
ErrorCompletingRequestException - If an error occurs before the request is completed.
InterruptedException - If this thread is interrupted.
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 Throwable
Closes the job list on the system when this object is garbage collected.

Overrides:
finalize in class Object
Throws:
Throwable

getJobs

public Enumeration getJobs()
                    throws AS400SecurityException,
                           ErrorCompletingRequestException,
                           InterruptedException,
                           IOException,
                           ObjectDoesNotExistException
Returns an Enumeration that wraps the list of jobs on the system. This method calls load() 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.
InterruptedException - If this thread is interrupted.
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,
                     InterruptedException,
                     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 to 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.

Parameters:
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. 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:
AS400SecurityException - If a security or authority error occurs.
ErrorCompletingRequestException - If an error occurs before the request is completed.
InterruptedException - If this thread is interrupted.
IOException - If an error occurs while communicating with the system.
ObjectDoesNotExistException - If the object does not exist on the system.
AS400Exception
See Also:
Job

getLength

public int getLength()
Returns the number of jobs in the list. This method implicitly calls load() if it has not already been called.

Returns:
The number of jobs, or 0 if no list was retrieved.
See Also:
load()

getName

public String getName()
Returns the job name that describes which jobs are returned.

Returns:
The job name.
See Also:
setName(java.lang.String)

getNumber

public 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 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,
                 InterruptedException,
                 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 to getJobs() 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.
InterruptedException - If this thread is interrupted.
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(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(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(String name)
             throws 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, or SELECTION_JOB_NAME_ALL for all job names.
Throws:
PropertyVetoException - If any of the registered listeners vetos the property change.
See Also:
addJobSelectionCriteria(int, java.lang.Object), getName()

setNumber

public void setNumber(String number)
               throws 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, or SELECTION_JOB_NUMBER_ALL for all job numbers.
Throws:
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 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:
PropertyVetoException - If any of the registered listeners vetos the property change.

setUser

public void setUser(String user)
             throws 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, or SELECTION_USER_NAME_ALL for all user names.
Throws:
PropertyVetoException - If any of the registered listeners vetos the property change.
See Also:
addJobSelectionCriteria(int, java.lang.Object), getUser()