Serializable
public class SpooledFileOpenList extends OpenList
OpenList
implementation that generates lists of SpooledFileListItem
objects.
AS400 system = new AS400("mySystem", "myUserID", "myPassword"); SpooledFileOpenList list = new SpooledFileOpenList(system); // Get all of myUserID's spooled files. list.setFilterUsers(new String[] { "*CURRENT" } ); // Sort the list by job number in ascending order. list.addSortField(SpooledFileOpenList.JOB_NUMBER, true); list.open(); Enumeration items = list.getItems(); while (items.hasMoreElements()) { SpooledFileListItem item = (SpooledFileListItem)items.nextElement(); System.out.println(item.getJobName() + "/" + item.getJobUser() + "/" + item.getJobNumber() + " - " + item.getName() + ", " + item.getNumber()); } list.close();
Modifier and Type | Field | Description |
---|---|---|
static int |
ASP |
Sorting constant used to sort the list of spooled files by auxiliary storage pool (ASP).
|
static int |
COPIES_LEFT_TO_PRINT |
Sorting constant used to sort the list of spooled files by number of copies left to print.
|
static int |
CURRENT_PAGE |
Sorting constant used to sort the list of spooled files by current page number.
|
static int |
DATE_OPENED |
Sorting constant used to sort the list of spooled files by date.
|
static int |
DEVICE_TYPE |
Sorting constant used to sort the list of spooled files by device type.
|
static int |
FORM_TYPE |
Sorting constant used to sort the list of spooled files by form type.
|
static String |
FORMAT_0100 |
Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the OSPL0100 format of the underlying API.
|
static String |
FORMAT_0200 |
Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the OSPL0200 format of the underlying API.
|
static String |
FORMAT_0300 |
Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the OSPL0300 format of the underlying API.
|
static String |
FORMAT_0400 |
Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the OSPL0400 format of the underlying API.
|
static int |
JOB_NAME |
Sorting constant used to sort the list of spooled files by the job name portion of the job information.
|
static int |
JOB_NUMBER |
Sorting constant used to sort the list of spooled files by the job number portion of the job information.
|
static int |
JOB_SYSTEM |
Sorting constant used to sort the list of spooled files by system.
|
static int |
JOB_USER |
Sorting constant used to sort the list of spooled files by the user name portion of the job information.
|
static int |
NAME |
Sorting constant used to sort the list of spooled files by spooled file name.
|
static int |
NUMBER |
Sorting constant used to sort the list of spooled files by spooled file number.
|
static int |
OUTPUT_QUEUE_LIBRARY |
Sorting constant used to sort the list of spooled files by output queue library.
|
static int |
OUTPUT_QUEUE_NAME |
Sorting constant used to sort the list of spooled files by output queue name.
|
static int |
PRINTER_ASSIGNED |
Sorting constant used to sort the list of spooled files by printer assignment.
|
static int |
PRINTER_NAME |
Sorting constant used to sort the list of spooled files by printer name.
|
static int |
PRIORITY |
Sorting constant used to sort the list of spooled files by priority.
|
static int |
SCHEDULE |
Sorting constant used to sort the list of spooled files by schedule.
|
static int |
SIZE |
Sorting constant used to sort the list of spooled files by size.
|
static int |
STATUS |
Sorting constant used to sort the list of spooled files by status.
|
static int |
TIME_OPENED |
Sorting constant used to sort the list of spooled files by time.
|
static int |
TOTAL_PAGES |
Sorting constant used to sort the list of spooled files by total number of pages.
|
static int |
USER_DATA |
Sorting constant used to sort the list of spooled files by user data.
|
EMPTY_ERROR_CODE_PARM, system_
Constructor | Description |
---|---|
SpooledFileOpenList(AS400 system) |
Constructs a SpooledFileOpenList object with the given system.
|
SpooledFileOpenList(AS400 system,
String format) |
Constructs a SpooledFileOpenList object with the given system and format.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addSortField(int field,
boolean ascending) |
Adds a field on which to sort the list when it is built.
|
protected byte[] |
callOpenListAPI() |
Calls QGY/QGYOLSPL.
|
void |
clearSortFields() |
Clears all sorting information for this list.
|
protected Object[] |
formatOutputData(byte[] data,
int recordsReturned,
int recordLength) |
Formats the data from QGY/QGYOLSPL.
|
protected int |
getBestGuessReceiverSize(int number) |
Returns receiver variable size based on format used.
|
Date |
getFilterCreationDateEnd() |
Returns the end creation date being used to filter the list of spooled files.
|
Date |
getFilterCreationDateStart() |
Returns the start creation date being used to filter the list of spooled files.
|
String[] |
getFilterDevices() |
Returns the printer device names being used to filter the list of spooled files.
|
String |
getFilterFormType() |
Returns the form type being used to filter the list of spooled files.
|
String |
getFilterJobName() |
Returns the job name portion of the job information used to determine which spooled files belong in the list.
|
String |
getFilterJobNumber() |
Returns the job number portion of the job information used to determine which spooled files belong in the list.
|
String |
getFilterJobSystemName() |
Returns the job system name used to determine which spooled files belong in the list.
|
String |
getFilterJobUser() |
Returns the user name portion of the job information used to determine which spooled files belong in the list.
|
String[] |
getFilterOutputQueues() |
Returns the output queue names being used to filter the list of spooled files.
|
String[] |
getFilterStatuses() |
Returns the statuses being used to filter the list of spooled files.
|
String |
getFilterUserData() |
Returns the user data being used to filter the list of spooled files.
|
String[] |
getFilterUsers() |
Returns the user names being used to filter the list of spooled files.
|
String |
getFormat() |
Returns the format currently in use by this open list.
|
void |
setFilterCreationDate(Date filterCreationDateStart,
Date filterCreationDateEnd) |
Sets the creation date range used to filter the list of spooled files.
|
void |
setFilterDevices(String[] devices) |
Sets the printer device names used to filter the list of spooled files.
|
void |
setFilterFormType(String formType) |
Sets the form type used to filter the list of spooled files.
|
void |
setFilterJobInformation(String filterJobName,
String filterJobUser,
String filterJobNumber) |
Sets the qualified job information used to filter the list of spooled files.
|
void |
setFilterJobSystemName(String systemName) |
Sets the job system name used to filter the list of spooled files.
|
void |
setFilterOutputQueues(String[] filterOutputQueues) |
Sets the output queues used to filter the list of spooled files.
|
void |
setFilterStatuses(String[] statuses) |
Sets the statuses used to filter the list of spooled files.
|
void |
setFilterUserData(String userData) |
Sets the user data used to filter the list of spooled files.
|
void |
setFilterUsers(String[] users) |
Sets the user names used to filter the list of spooled files.
|
void |
setFormat(String format) |
Sets the format this list will use on the next call to
open() . |
close, finalize, getEnumerationBlockSize, getItems, getItems, getLength, getSystem, isOpen, open, resetHandle, setEnumerationBlockSize
public static final String FORMAT_0100
setFormat(java.lang.String)
,
Constant Field Valuespublic static final String FORMAT_0200
setFormat(java.lang.String)
,
Constant Field Valuespublic static final String FORMAT_0300
setFormat(java.lang.String)
,
Constant Field Valuespublic static final String FORMAT_0400
setFormat(java.lang.String)
,
Constant Field Valuespublic static final int JOB_NAME
addSortField(int, boolean)
,
Constant Field Valuespublic static final int JOB_USER
addSortField(int, boolean)
,
Constant Field Valuespublic static final int JOB_NUMBER
addSortField(int, boolean)
,
Constant Field Valuespublic static final int NAME
addSortField(int, boolean)
,
Constant Field Valuespublic static final int NUMBER
addSortField(int, boolean)
,
Constant Field Valuespublic static final int STATUS
addSortField(int, boolean)
,
Constant Field Valuespublic static final int DATE_OPENED
addSortField(int, boolean)
,
Constant Field Valuespublic static final int TIME_OPENED
addSortField(int, boolean)
,
Constant Field Valuespublic static final int SCHEDULE
addSortField(int, boolean)
,
Constant Field Valuespublic static final int JOB_SYSTEM
addSortField(int, boolean)
,
Constant Field Valuespublic static final int USER_DATA
addSortField(int, boolean)
,
Constant Field Valuespublic static final int FORM_TYPE
addSortField(int, boolean)
,
Constant Field Valuespublic static final int OUTPUT_QUEUE_NAME
addSortField(int, boolean)
,
Constant Field Valuespublic static final int OUTPUT_QUEUE_LIBRARY
addSortField(int, boolean)
,
Constant Field Valuespublic static final int ASP
addSortField(int, boolean)
,
Constant Field Valuespublic static final int SIZE
addSortField(int, boolean)
,
Constant Field Valuespublic static final int TOTAL_PAGES
addSortField(int, boolean)
,
Constant Field Valuespublic static final int COPIES_LEFT_TO_PRINT
addSortField(int, boolean)
,
Constant Field Valuespublic static final int PRIORITY
addSortField(int, boolean)
,
Constant Field Valuespublic static final int PRINTER_NAME
addSortField(int, boolean)
,
Constant Field Valuespublic static final int PRINTER_ASSIGNED
addSortField(int, boolean)
,
Constant Field Valuespublic static final int CURRENT_PAGE
addSortField(int, boolean)
,
Constant Field Valuespublic static final int DEVICE_TYPE
addSortField(int, boolean)
,
Constant Field Valuespublic SpooledFileOpenList(AS400 system)
FORMAT_0300
.system
- The system object representing the system on which the spooled files exist.public SpooledFileOpenList(AS400 system, String format)
system
- The system object representing the system on which the spooled files exist.format
- The format of the underlying API.setFormat(java.lang.String)
public void addSortField(int field, boolean ascending)
field
- The field used to sort the list. Fields which are not applicable to the format used or the operating system release are silently ignored.ascending
- true to sort in ascending order on this field (e.g. A-Z or 0-9); false for descending.protected byte[] callOpenListAPI() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
callOpenListAPI
in class OpenList
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.public void clearSortFields()
addSortField()
is called to specify which fields to sort on.protected Object[] formatOutputData(byte[] data, int recordsReturned, int recordLength) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
formatOutputData
in class OpenList
data
- The output data from the receiver variable from the call to the QGYGTLE (Get List Entries) API.recordsReturned
- The number of records returned, as reported in the open list information returned on the call to QGYGTLE.recordLength
- The length of a record, in bytes, as reported in the open list information returned on the call to QGYGTLE.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.protected int getBestGuessReceiverSize(int number)
getBestGuessReceiverSize
in class OpenList
number
- The number of records in the list on the system. This is useful if the subclass needs to return a receiver size based on how many records are in the list.public Date getFilterCreationDateEnd()
getFilterCreationDateStart()
public Date getFilterCreationDateStart()
getFilterCreationDateEnd()
public String[] getFilterDevices()
public String getFilterFormType()
public String getFilterJobName()
setFilterJobInformation(java.lang.String, java.lang.String, java.lang.String)
public String getFilterJobNumber()
setFilterJobInformation(java.lang.String, java.lang.String, java.lang.String)
public String getFilterJobSystemName()
setFilterJobSystemName(java.lang.String)
public String getFilterJobUser()
setFilterJobInformation(java.lang.String, java.lang.String, java.lang.String)
public String[] getFilterOutputQueues()
public String[] getFilterStatuses()
public String getFilterUserData()
public String[] getFilterUsers()
public String getFormat()
public void setFilterCreationDate(Date filterCreationDateStart, Date filterCreationDateEnd)
filterCreationDateStart
- The start date. All spooled files with a creation date and time equal to or later than the start date will be selected. Specify null to indicate that the earliest creation date and later will be selected, up to the specified end date.filterCreationDateEnd
- The end date. All spooled files with a creation date and time equal to or earlier than the end date will be selected. Specify null to indicate that the latest creation date and earlier will be selected, down to the specified start date.getFilterCreationDateStart()
,
getFilterCreationDateEnd()
public void setFilterDevices(String[] devices)
devices
- The array of printer device names. Only spooled files that belong to the specified printer devices are returned in the list. Specify null to clear the status filter, so that spooled files in the list are no longer filtered based on device.public void setFilterFormType(String formType)
formType
- The form type. Only spooled files whose form type matches the specified form type are returned in the list. Specify "*STD" for the standard form type. Specify null to clear the form type filter, so that spooled files in the list are no longer filtered based on form type.public void setFilterJobInformation(String filterJobName, String filterJobUser, String filterJobNumber)
filterJobName
- The job name of the job whose spooled files are to be included in the list. Specify "*" for the current job. If "*" is specified, the filterJobUser and filterJobNumber parameters are automatically set to blank.filterJobUser
- The user name of the job whose spooled files are to be included in the list.filterJobNumber
- The job number of the job whose spooled files are to be included in the list.getFilterJobName()
,
getFilterJobUser()
,
getFilterJobNumber()
public void setFilterJobSystemName(String systemName)
systemName
- Only spooled files created on systemNamewill be included in the list. Specify "*CURRENT" to return only spooled files created on the current system.getFilterJobSystemName()
public void setFilterOutputQueues(String[] filterOutputQueues)
filterOutputQueues
- An array of fully-qualified integrated file system path names of output queues. Only spooled files that reside in the specified output queues are returned in the list. Specify null to clear the output queue filter, so that the spooled files in the list are no longer filtered based on output queue.public void setFilterStatuses(String[] statuses)
SpooledFileListItem.STATUS_CLOSED
- "*CLOSED"
SpooledFileListItem.STATUS_DEFERRED
- "*DEFERRED"
SpooledFileListItem.STATUS_SENDING
- "*SENDING"
SpooledFileListItem.STATUS_FINISHED
- "*FINISHED"
SpooledFileListItem.STATUS_HELD
- "*HELD"
SpooledFileListItem.STATUS_MESSAGE_WAIT
- "*MESSAGE"
SpooledFileListItem.STATUS_OPEN
- "*OPEN"
SpooledFileListItem.STATUS_PENDING
- "*PENDING"
SpooledFileListItem.STATUS_PRINTING
- "*PRINTER"
SpooledFileListItem.STATUS_READY
- "*READY"
SpooledFileListItem.STATUS_SAVED
- "*SAVED"
SpooledFileListItem.STATUS_WRITING
- "*WRITING"
statuses
- The array of statuses. Only spooled files whose status matches one of the specified statuses are returned in the list. Specify null to clear the status filter, so that spooled files in the list are no longer filtered based on status.public void setFilterUserData(String userData)
userData
- The user data. Only spooled files whose user data exactly matches the specified user data are returned in the list. Specify null to clear the user data filter, so that spooled files in the list are no longer filtered based on user data.public void setFilterUsers(String[] users)
users
- An array of user names. Only spooled files that were created by the specified users are returned in the list. Specify "*CURRENT" as one of the users to mean the current user profile. Specify null to clear the user filter, so that the spooled files in the list are no longer filtered based on user name.public void setFormat(String format)
open()
. Any SpooledFileListItems generated by this list will have attributes associated with the specified format. The default format is FORMAT_0300.format
- The format of the underlying API. Possible values are:
FORMAT_0100
- This is faster than FORMAT_0200.
FORMAT_0200
- Contains more information than FORMAT_0100.
FORMAT_0300
- This is faster than FORMAT_0100.
FORMAT_0400
- Like FORMAT_0300 but using UTC time.
Copyright © 2024. All rights reserved.