com.ibm.as400.access
Class NetServerShare

java.lang.Object
  |
  +--com.ibm.as400.resource.Resource
        |
        +--com.ibm.as400.resource.ChangeableResource
              |
              +--com.ibm.as400.access.NetServerShare
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NetServerFileShare, NetServerPrintShare

public abstract class NetServerShare
extends ChangeableResource

The NetServerShare class represents a NetServer share.

See Also:
NetServer.listFileShares(), NetServer.listPrintShares(), Serialized Form

Field Summary
static java.lang.String DESCRIPTION
          Attribute ID for "description".
static java.lang.String USER_COUNT
          Attribute ID for "user count".
 
Method Summary
abstract  void add()
          Adds the server share to the NetServer.
protected  void commitAttributeChanges(java.lang.Object[] attributeIDs, java.lang.Object[] values)
          Commits the specified attribute changes.
protected abstract  void establishConnection()
          Establishes the connection to the server.
protected  void freezeProperties()
          Freezes any property changes.
 java.lang.Object getAttributeUnchangedValue(java.lang.Object attributeID)
          Returns the value of an attribute, disregarding any uncommitted changes.
 java.lang.String getName()
          Returns the network name of the share.
 ResourceList listConnections()
          Lists the connections currently associated with this share.
 void refreshAttributeValues()
          Refreshes the values for all attributes.
 void remove()
          Removes this share from the NetServer.
 void setName(java.lang.String name)
          Sets the network name of the share.
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DESCRIPTION

public static final java.lang.String DESCRIPTION
Attribute ID for "description". This identifies a String attribute, which represents the text description of a share.

USER_COUNT

public static final java.lang.String USER_COUNT
Attribute ID for "user count". This identifies a read-only Integer attribute, which represents the number of connections that are currently made to a share.
Method Detail

add

public abstract void add()
                  throws ResourceException
Adds the server share to the NetServer. This method fires a resourceCreated() ResourceEvent.
Throws:
ResourceException - If an error occurs.

commitAttributeChanges

protected void commitAttributeChanges(java.lang.Object[] attributeIDs,
                                      java.lang.Object[] values)
                               throws ResourceException
Commits the specified attribute changes.
This method requires *IOSYSCFG special authority on the server. This method fires an attributeChangesCommitted() ResourceEvent.
Overrides:
commitAttributeChanges in class ChangeableResource
Throws:
ResourceException - If an error occurs.

establishConnection

protected abstract void establishConnection()
                                     throws ResourceException
Establishes the connection to the server.

The method is called by the resource framework automatically when the connection needs to be established.

Overrides:
establishConnection in class Resource
Throws:
ResourceException - If an error occurs.

freezeProperties

protected void freezeProperties()
                         throws ResourceException
Freezes any property changes. After this is called, property changes should not be made. Properties are not the same thing as attributes. Properties are basic pieces of information which must be set to make the object usable, such as the system, job name, job number, and user name.

The method is called by the resource framework automatically when the properties need to be frozen.

Overrides:
freezeProperties in class Resource
Throws:
ResourceException - If an error occurs.

getAttributeUnchangedValue

public java.lang.Object getAttributeUnchangedValue(java.lang.Object attributeID)
                                            throws ResourceException
Returns the value of an attribute, disregarding any uncommitted changes.
Overrides:
getAttributeUnchangedValue in class ChangeableResource
Parameters:
attributeID - Identifies the attribute.
Returns:
The attribute value, or null if the attribute value is not available.
Throws:
ResourceException - If an error occurs.

getName

public java.lang.String getName()
Returns the network name of the share.
Note: All share names are uppercase on the server.
Returns:
The share name.

listConnections

public ResourceList listConnections()
                             throws ResourceException
Lists the connections currently associated with this share. The returned ResourceList contains NetServerConnection objects.
Returns:
The current connections to the share.
Throws:
ResourceException - If an error occurs.
See Also:
NetServerConnection

refreshAttributeValues

public void refreshAttributeValues()
                            throws ResourceException
Refreshes the values for all attributes. This does not cancel uncommitted changes. This method fires an attributeValuesRefreshed() ResourceEvent.
Overrides:
refreshAttributeValues in class ChangeableResource
Throws:
ResourceException - If an error occurs.

remove

public void remove()
            throws ResourceException
Removes this share from the NetServer.
To use this method, the user profile must either have *IOSYSCFG special authority, or own the integrated file system directory or output queue that the share references.
This method fires a resourceDeleted() ResourceEvent.
Throws:
ResourceException - If an error occurs.

setName

public void setName(java.lang.String name)
Sets the network name of the share.
Note: All share names are uppercase on the server. Share names are limited to 12 characters in length. This method fires a PropertyChangeEvent.
Parameters:
name - The name of the share.