|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.resource.Resource | +--com.ibm.as400.resource.ChangeableResource | +--com.ibm.as400.access.NetServerShare | +--com.ibm.as400.access.NetServerPrintShare
The NetServerPrintShare class represents a NetServer print server share.
NetServerPrintShare objects are created and returned by NetServer.listPrintShares()
.
Note: This class uses API fields that are available only the release of OS/400 that follows V4R5.
The following attribute IDs are supported:
Use any of the above attribute IDs with
getAttributeValue
and
setAttributeValue
to access the attribute values for a NetServerPrintShare.
Note: For the above attributes, getAttributeValue() should never return null.
For String-valued attributes, if the current actual value of the corresponding property on the server is blank, getAttributeValue() will return "" (an empty String).
NetServerPrintShare
import com.ibm.as400.access.*;
import com.ibm.as400.resource.*;
// Create a NetServer object for a specific server system.
AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD");
NetServer ns = new NetServer(system);
try
{
// List all current print shares.
System.out.println("Print shares:");
ResourceList shareList = ns.listPrintShares();
shareList.waitForComplete();
for (int i=0; i<shareList.getListLength(); i++)
{
NetServerPrintShare share = (NetServerPrintShare)shareList.resourceAt(i);
System.out.println(share.getName() + ": " +
(String)share.getAttributeValue(NetServerPrintShare.OUTPUT_QUEUE_NAME) + ": " +
(String)share.getAttributeValue(NetServerPrintShare.DESCRIPTION) + "; " +
((Integer)share.getAttributeValue(NetServerFileShare.USER_COUNT))
.intValue() );
}
}
catch (ResourceException e) {
e.printStackTrace();
}
finally {
if (system != null) system.disconnectAllServices();
}
NetServer.listPrintShares()
, Serialized Form
Field Summary | |
static java.lang.String |
OUTPUT_QUEUE_LIBRARY
Attribute ID for "output queue library". |
static java.lang.String |
OUTPUT_QUEUE_NAME
Attribute ID for "output queue name". |
static java.lang.String |
PRINT_DRIVER_TYPE
Attribute ID for "print driver type". |
static java.lang.String |
SPOOLED_FILE_TYPE
Attribute ID for "spooled file type". |
static java.lang.Integer |
SPOOLED_FILE_TYPE_AFP
Attribute value indicating spooled file type "Advanced Function Printing". |
static java.lang.Integer |
SPOOLED_FILE_TYPE_AUTO_DETECT
Attribute value indicating "Automatic type sensing". |
static java.lang.Integer |
SPOOLED_FILE_TYPE_SCS
Attribute value indicating spooled file type "SNA character string". |
static java.lang.Integer |
SPOOLED_FILE_TYPE_USER_ASCII
Attribute value indicating spooled file type "User ASCII". |
Fields inherited from class com.ibm.as400.access.NetServerShare |
DESCRIPTION,
USER_COUNT |
Constructor Summary | |
NetServerPrintShare()
Constructs a NetServerPrintShare object. |
|
NetServerPrintShare(AS400 system,
java.lang.String name)
Constructs a NetServerPrintShare object. |
Method Summary | |
void |
add()
Adds this print server share to the NetServer. |
protected void |
establishConnection()
Establishes the connection to the server. |
Methods inherited from class com.ibm.as400.access.NetServerShare |
commitAttributeChanges,
freezeProperties,
getAttributeUnchangedValue,
getName,
listConnections,
refreshAttributeValues,
remove,
setName |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String OUTPUT_QUEUE_LIBRARY
OUTPUT_QUEUE_NAME
public static final java.lang.String OUTPUT_QUEUE_NAME
OUTPUT_QUEUE_LIBRARY
public static final java.lang.String PRINT_DRIVER_TYPE
public static final java.lang.String SPOOLED_FILE_TYPE
SPOOLED_FILE_TYPE_USER_ASCII
- User ASCII.
SPOOLED_FILE_TYPE_AFP
- Advanced Function Printing.
SPOOLED_FILE_TYPE_SCS
- SNA character string.
SPOOLED_FILE_TYPE_AUTO_DETECT
- Automatic type sensing.
SPOOLED_FILE_TYPE_AUTO_DETECT
.public static final java.lang.Integer SPOOLED_FILE_TYPE_USER_ASCII
SPOOLED_FILE_TYPE
public static final java.lang.Integer SPOOLED_FILE_TYPE_AFP
SPOOLED_FILE_TYPE
public static final java.lang.Integer SPOOLED_FILE_TYPE_SCS
SPOOLED_FILE_TYPE
public static final java.lang.Integer SPOOLED_FILE_TYPE_AUTO_DETECT
SPOOLED_FILE_TYPE
Constructor Detail |
public NetServerPrintShare()
public NetServerPrintShare(AS400 system, java.lang.String name)
system
- The system.name
- The name of the share.Method Detail |
public void add() throws ResourceException
OUTPUT_QUEUE_NAME
and OUTPUT_QUEUE_LIBRARY
attributes must be set before this method is called.
commitAttributeChanges
must not be called before this method.protected void establishConnection() throws ResourceException
The method is called by the resource framework automatically when the connection needs to be established.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |