com.ibm.as400.resource
Class RJobList

java.lang.Object
  |
  +--com.ibm.as400.resource.ResourceList
        |
        +--com.ibm.as400.resource.BufferedResourceList
              |
              +--com.ibm.as400.resource.SystemResourceList
                    |
                    +--com.ibm.as400.resource.RJobList
All Implemented Interfaces:
java.io.Serializable

public class RJobList
extends SystemResourceList

The RJobList class represents a list of AS/400 jobs.

The following selection IDs are supported:

Use one or more of these selection IDs with getSelectionValue() and setSelectionValue() to access the selection values for an RJobList.

The following sort IDs are supported:

Use one or more of these sort IDs with getSortValue() and setSortValue() to access the sort values for an RJobList.

RJobList objects generate RJob objects.

// Create an RJobList object to represent a list of jobs.
AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD");
RJobList jobList = new RJobList(system);

// Set the selection so that only active jobs with the name // "QZDASOINIT" are included in the list. jobList.setSelectionValue(RJobList.PRIMARY_JOB_STATUSES, new String[] { RJob.JOB_STATUS_ACTIVE }); jobList.setSelectionValue(RJobList.JOB_NAME, "QZDASOINIT");
// Set the sort value so that the list is sorted by // user name and job type. Object[] sortValue = new Object[] { RJob.USER_NAME, RJob.JOB_TYPE }; jobList.setSortValue(sortValue);
// Open the list and wait for it to complete. jobList.open(); jobList.waitForComplete();
// Read and print the job numbers for the jobs in the list. long numberOfJobs = jobList.getListLength(); for(long i = 0; i < numberOfJobs; ++i) { RJob job = (RJob)jobList.resourceAt(i); System.out.println(job.getAttributeValue(RJob.JOB_NUMBER)); }
// Close the list. jobList.close();

See Also:
RJob, Serialized Form

Field Summary
static java.lang.String ALL
          Constant indicating that all jobs are returned.
static java.lang.String BLANK
          Constant indicating that a blank value is used.
static java.lang.String CURRENT
          Constant indicating that the current value is used.
static java.lang.String JOB_NAME
          Selection ID for job name.
static java.lang.String JOB_NUMBER
          Selection ID for job number.
static java.lang.String JOB_TYPE
          Selection ID for job type.
static java.lang.String PRIMARY_JOB_STATUSES
          Selection ID for jobs on primary job statuses.
static java.lang.String USER_NAME
          Selection ID for user name.
 
Constructor Summary
RJobList()
          Constructs an RJobList object.
RJobList(AS400 system)
          Constructs an RJobList object.
 
Method Summary
protected  void establishConnection()
          Establishes the connection to the AS/400.
 
Methods inherited from class com.ibm.as400.resource.SystemResourceList
close, isBidiEnabled, isResourceAvailable, open, refreshContents, refreshStatus, resourceAt, setSelectionValue, waitForComplete, waitForResource
 
Methods inherited from class com.ibm.as400.resource.BufferedResourceList
fireResourceAdded, getNumberOfPages, getPageSize, setNumberOfPages, setPageSize
 
Methods inherited from class com.ibm.as400.resource.ResourceList
addActiveStatusListener, addPropertyChangeListener, addResourceListListener, addVetoableChangeListener, arePropertiesFrozen, fireBusy, fireIdle, fireLengthChanged, fireListClosed, fireListCompleted, fireListInError, fireListOpened, firePropertyChange, fireVetoableChange, freezeProperties, getAttributeMetaData, getAttributeMetaData, getListLength, getPresentation, getSelectionMetaData, getSelectionMetaData, getSelectionValue, getSelectionValue, getSortMetaData, getSortMetaData, getSortOrder, getSortValue, getSystem, isComplete, isConnectionEstablished, isInError, isOpen, removeActiveStatusListener, removePropertyChangeListener, removeResourceListListener, removeVetoableChangeListener, resources, setAttributeMetaData, setPresentation, setSelectionValue, setSortOrder, setSortValue, setSystem, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL

public static final java.lang.String ALL
Constant indicating that all jobs are returned.

BLANK

public static final java.lang.String BLANK
Constant indicating that a blank value is used.

CURRENT

public static final java.lang.String CURRENT
Constant indicating that the current value is used.

JOB_NAME

public static final java.lang.String JOB_NAME
Selection ID for job name. This identifies a String selection, which represents a specific job name. Possible values are: The default is ALL.

JOB_NUMBER

public static final java.lang.String JOB_NUMBER
Selection ID for job number. This identifies a String selection, which represents a specific job number. Possible values are: The default is ALL.

JOB_TYPE

public static final java.lang.String JOB_TYPE
Selection ID for job type. This identifies a String selection, which represents the type of job to be listed. Possible values are: The default is ALL.

PRIMARY_JOB_STATUSES

public static final java.lang.String PRIMARY_JOB_STATUSES
Selection ID for jobs on primary job statuses. This identifies a String array selection, which represents the primary statuses of the jobs to be included in the list. Possible values for each element of the array are:

USER_NAME

public static final java.lang.String USER_NAME
Selection ID for user name. This identifies a String selection, which represents a specific user profile name. Possible values are: The default is ALL.
Constructor Detail

RJobList

public RJobList()
Constructs an RJobList object.

RJobList

public RJobList(AS400 system)
Constructs an RJobList object.
Parameters:
system - The system.
Method Detail

establishConnection

protected void establishConnection()
                            throws ResourceException
Establishes the connection to the AS/400.

The method is called by the resource framework automatically when the connection needs to be established.

Overrides:
establishConnection in class ResourceList
Throws:
ResourceException - If an error occurs.