Serializable
public class RPrinterList extends SystemResourceList
PrinterList
instead, as this package may be removed in the future.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 FormModifier and Type | Field | Description |
---|---|---|
static String |
OUTPUT_QUEUES |
Deprecated.
Selection ID for output queues.
|
static String |
PRINTER_NAMES |
Deprecated.
Selection ID for printer names.
|
Constructor | Description |
---|---|
RPrinterList() |
Deprecated.
Constructs an RPrinterList object.
|
RPrinterList(AS400 system) |
Deprecated.
Constructs an RPrinterList object.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
establishConnection() |
Deprecated.
Establishes the connection to the system.
|
close, isBidiEnabled, isResourceAvailable, open, refreshContents, refreshStatus, resourceAt, setSelectionValue, waitForComplete, waitForResource
fireResourceAdded, getNumberOfPages, getPageSize, setNumberOfPages, setPageSize
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
public static final String PRINTER_NAMES
public static final String OUTPUT_QUEUES
public RPrinterList()
public RPrinterList(AS400 system)
system
- The system.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.Copyright © 2024. All rights reserved.