|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.resource.ResourceList | +--com.ibm.as400.resource.BufferedResourceList | +--com.ibm.as400.resource.SystemResourceList | +--com.ibm.as400.resource.RPrinterList
The RPrinterList class represents a list of AS/400 printers.
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 RPrinterList.
RPrinterList objects generate RPrinter objects.
// Create an RPrinterList object to represent a list of printers.
AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD");
RPrinterList printerList = new RPrinterList(system);
// Set the selection so that only printers which are selecting
// spooled files from the listed output queues are included
// in the list.
printerList.setSelectionValue(RPrinterList.OUTPUT_QUEUES,
new String[] { "/QSYS.LIB/MYLIB.LIB/MYOUTQ1.OUTQ1",
"/QSYS.LIB/MYLIB.LIB/MYOUTQ2.OUTQ2" });
// Open the list and wait for it to complete.
printerList.open();
printerList.waitForComplete();
// Read and print the device names and statuses
// for the printers in the list.
long numberOfPrinters = printerList.getListLength();
for(long i = 0; i < numberOfPrinters; ++i)
{
RPrinter printer = (RPrinter)printerList.resourceAt(i);
System.out.println(printer.getAttributeValue(RPrinter.DEVICE_NAME));
System.out.println(printer.getAttributeValue(RPrinter.DEVICE_STATUS));
System.out.println();
}
// Close the list.
printerList.close();
RPrinter
, Serialized Form
Field Summary | |
static java.lang.String |
OUTPUT_QUEUES
Selection ID for output queues. |
static java.lang.String |
PRINTER_NAMES
Selection ID for printer names. |
Constructor Summary | |
RPrinterList()
Constructs an RPrinterList object. |
|
RPrinterList(AS400 system)
Constructs an RPrinterList 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String PRINTER_NAMES
public static final java.lang.String OUTPUT_QUEUES
Constructor Detail |
public RPrinterList()
public RPrinterList(AS400 system)
system
- The system.Method Detail |
protected void establishConnection() throws ResourceException
The method is called by the resource framework automatically when the connection needs to be established.
establishConnection
in class ResourceList
ResourceException
- If an error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |