Class NetServerPrintShare
- java.lang.Object
-
- com.ibm.as400.resource.Resource
-
- com.ibm.as400.resource.ChangeableResource
-
- com.ibm.as400.access.NetServerShare
-
- com.ibm.as400.access.NetServerPrintShare
-
- All Implemented Interfaces:
- java.io.Serializable
Deprecated.This class has been replaced by theISeriesNetServerPrintShare
class and may be removed in a future release.
public class NetServerPrintShare extends NetServerShare
The NetServerPrintShare class represents a NetServer print server share. NetServerPrintShare objects are created and returned byNetServer.listPrintShares()
.Note: This class uses some API fields that are not available prior to OS/400 V5R1.
The following attribute IDs are supported:
Use any of the above attribute IDs with
getAttributeValue
andsetAttributeValue
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 system is blank, getAttributeValue() will return "" (an empty String).Note: Typically, methods which add, change, or remove a NetServerPrintShare require that the system user profile has *IOSYSCFG special authority, or that the user owns the output queue on the system.
import com.ibm.as400.access.*; import com.ibm.as400.resource.*; // Create a NetServer object for a specific 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(); }
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
OUTPUT_QUEUE_LIBRARY
Deprecated.Attribute ID for "output queue library".static java.lang.String
OUTPUT_QUEUE_NAME
Deprecated.Attribute ID for "output queue name".static java.lang.String
PRINT_DRIVER_TYPE
Deprecated.Attribute ID for "print driver type".static java.lang.String
SPOOLED_FILE_TYPE
Deprecated.Attribute ID for "spooled file type".static java.lang.Integer
SPOOLED_FILE_TYPE_AFP
Deprecated.SPOOLED_FILE_TYPE
attribute value indicating spooled file type "Advanced Function Printing".static java.lang.Integer
SPOOLED_FILE_TYPE_AUTO_DETECT
Deprecated.SPOOLED_FILE_TYPE
attribute value indicating "Automatic type sensing".static java.lang.Integer
SPOOLED_FILE_TYPE_SCS
Deprecated.SPOOLED_FILE_TYPE
attribute value indicating spooled file type "SNA character string".static java.lang.Integer
SPOOLED_FILE_TYPE_USER_ASCII
Deprecated.SPOOLED_FILE_TYPE
attribute value indicating spooled file type "User ASCII".-
Fields inherited from class com.ibm.as400.access.NetServerShare
DESCRIPTION, USER_COUNT
-
-
Constructor Summary
Constructors Constructor and Description NetServerPrintShare()
Deprecated.Constructs a NetServerPrintShare object.NetServerPrintShare(AS400 system, java.lang.String name)
Deprecated.Constructs a NetServerPrintShare object.
-
Method Summary
Methods Modifier and Type Method and Description void
add()
Deprecated.Adds this print server share to the NetServer.protected void
establishConnection()
Deprecated.Establishes the connection to the system.-
Methods inherited from class com.ibm.as400.access.NetServerShare
commitAttributeChanges, freezeProperties, getAttributeUnchangedValue, getName, listConnections, refreshAttributeValues, remove, setName
-
Methods inherited from class com.ibm.as400.resource.ChangeableResource
cancelAttributeChanges, commitAttributeChanges, commitAttributeChanges, fireAttributeChangesCanceled, fireAttributeChangesCommitted, fireAttributeValueChanged, fireResourceCreated, fireResourceDeleted, getAttributeUnchangedValue, getAttributeValue, getAttributeValue, hasUncommittedAttributeChanges, initializeAttributeValue, setAttributeValue, setAttributeValue
-
Methods inherited from class com.ibm.as400.resource.Resource
addActiveStatusListener, addPropertyChangeListener, addResourceListener, addVetoableChangeListener, arePropertiesFrozen, equals, fireAttributeValuesRefreshed, fireBusy, fireIdle, firePropertyChange, fireVetoableChange, getAttributeMetaData, getAttributeMetaData, getPresentation, getResourceKey, getSystem, isBidiEnabled, isConnectionEstablished, removeActiveStatusListener, removePropertyChangeListener, removeResourceListener, removeVetoableChangeListener, setPresentation, setResourceKey, setSystem, toString
-
-
-
-
Field Detail
-
OUTPUT_QUEUE_LIBRARY
public static final java.lang.String OUTPUT_QUEUE_LIBRARY
Deprecated.Attribute ID for "output queue library". This identifies a String attribute, which represents the library that contains the output queue associated with a print share.- See Also:
OUTPUT_QUEUE_NAME
, Constant Field Values
-
OUTPUT_QUEUE_NAME
public static final java.lang.String OUTPUT_QUEUE_NAME
Deprecated.Attribute ID for "output queue name". This identifies a String attribute, which represents the name of the output queue associated with a print share.- See Also:
OUTPUT_QUEUE_LIBRARY
, Constant Field Values
-
PRINT_DRIVER_TYPE
public static final java.lang.String PRINT_DRIVER_TYPE
Deprecated.Attribute ID for "print driver type". This identifies a String attribute, which represents the type of printer driver for a share.
The print driver type is a text string that identifies the print driver appropriate for a share. When personal computers connect to this shared printer, this identifies the print driver that they should use. This text should match the name of a print driver known to the personal computer operating system.- See Also:
- Constant Field Values
-
SPOOLED_FILE_TYPE
public static final java.lang.String SPOOLED_FILE_TYPE
Deprecated.Attribute ID for "spooled file type". This identifies an Integer attribute, which represents the spooled file type for a share.
The spooled file type specifies the type of spooled files that will be created using this share.
Valid values are: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
.- See Also:
- Constant Field Values
-
SPOOLED_FILE_TYPE_USER_ASCII
public static final java.lang.Integer SPOOLED_FILE_TYPE_USER_ASCII
Deprecated.SPOOLED_FILE_TYPE
attribute value indicating spooled file type "User ASCII".
-
SPOOLED_FILE_TYPE_AFP
public static final java.lang.Integer SPOOLED_FILE_TYPE_AFP
Deprecated.SPOOLED_FILE_TYPE
attribute value indicating spooled file type "Advanced Function Printing".
-
SPOOLED_FILE_TYPE_SCS
public static final java.lang.Integer SPOOLED_FILE_TYPE_SCS
Deprecated.SPOOLED_FILE_TYPE
attribute value indicating spooled file type "SNA character string".
-
SPOOLED_FILE_TYPE_AUTO_DETECT
public static final java.lang.Integer SPOOLED_FILE_TYPE_AUTO_DETECT
Deprecated.SPOOLED_FILE_TYPE
attribute value indicating "Automatic type sensing".
-
-
Constructor Detail
-
NetServerPrintShare
public NetServerPrintShare()
Deprecated.Constructs a NetServerPrintShare object. The system and share name must be set before the object is used.
-
NetServerPrintShare
public NetServerPrintShare(AS400 system, java.lang.String name)
Deprecated.Constructs a NetServerPrintShare object.- Parameters:
system
- The system.name
- The name of the share.
-
-
Method Detail
-
add
public void add() throws ResourceException
Deprecated.Adds this print server share to the NetServer. This method fires a resourceCreated() ResourceEvent.
The system and share name be set before this method is called.
TheOUTPUT_QUEUE_NAME
andOUTPUT_QUEUE_LIBRARY
attributes must be set before this method is called.commitAttributeChanges
must not be called prior to this method.
This method requires *IOSYSCFG special authority on the system, or that the user owns the output queue on the system.- Specified by:
add
in classNetServerShare
- Throws:
ResourceException
- If an error occurs.
-
establishConnection
protected void establishConnection() throws ResourceException
Deprecated.Establishes the connection to the system.The method is called by the resource framework automatically when the connection needs to be established.
- Specified by:
establishConnection
in classNetServerShare
- Throws:
ResourceException
- If an error occurs.
-
-