ISeriesNetServer
and may be removed in a future release.public class NetServer extends ChangeableResource
Note: Many of the attributes of NetServer are "pending". These attributes represent NetServer values that will take effect the next time the NetServer is (re)started. Wherever there is a pair of related attributes, where one is pending and one is non-pending, the "pending" attribute is read/write, while the non-pending attribute is read-only.
For example, to change the name of the NetServer, using a com.ibm.as400.access.NetServer
object named "netServer":
If the NetServer job on the IBM i system is not started, the listXxx
methods may return incomplete results. To determine if the NetServer job is started, use the isStarted
method. To start the NetServer, use one of the start
methods. These methods will also attempt to start the QSERVER subsystem if it is not running.
Note: Typically, methods which change the state or attributes of the NetServer require that the system user profile has *IOSYSCFG special authority. For example, starting or ending the NetServer requires *IOSYSCFG authority.
Note: This class uses some API fields that are not available prior to OS/400 V5R1.
The following attribute IDs are supported:
ALLOW_SYSTEM_NAME
ALLOW_SYSTEM_NAME_PENDING
AUTHENTICATION_METHOD
AUTHENTICATION_METHOD_PENDING
AUTOSTART
BROWSING_INTERVAL
BROWSING_INTERVAL_PENDING
CCSID
CCSID_PENDING
DESCRIPTION
DESCRIPTION_PENDING
DOMAIN
DOMAIN_PENDING
GUEST_USER_PROFILE
GUEST_USER_PROFILE_PENDING
IDLE_TIMEOUT
IDLE_TIMEOUT_PENDING
LOGON_SUPPORT
LOGON_SUPPORT_PENDING
NAME
NAME_PENDING
WINS_ENABLEMENT
WINS_ENABLEMENT_PENDING
WINS_PRIMARY_ADDRESS
WINS_PRIMARY_ADDRESS_PENDING
WINS_SCOPE_ID
WINS_SCOPE_ID_PENDING
WINS_SECONDARY_ADDRESS
WINS_SECONDARY_ADDRESS_PENDING
Use any of the above attribute IDs with
getAttributeValue
and
setAttributeValue
to access the attribute values for a NetServer.
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).
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 { // Get the name of the NetServer. System.out.println("Name: " + (String)ns.getAttributeValue(NetServer.NAME)); // Get the CCSID of the NetServer. System.out.println("CCSID: " + ((Integer)ns.getAttributeValue(NetServer.CCSID)).intValue()); // Get the pending CCSID of the NetServer. System.out.println("Pending CCSID: " + ((Integer)ns.getAttributeValue(NetServer.CCSID_PENDING)).intValue()); // Get the "allow system name" value of the NetServer. System.out.println("'Allow system name': " + ((Boolean)ns.getAttributeValue(NetServer.ALLOW_SYSTEM_NAME)).booleanValue()); // Set the (pending) description of the NetServer. // Note: Changes to "pending" attributes take effect after the NetServer // is ended and restarted. ns.setAttributeValue(NetServer.DESCRIPTION_PENDING, "The NetServer"); ns.commitAttributeChanges(); // Set the (pending) CCSID of the NetServer to 13488. ns.setAttributeValue(NetServer.CCSID_PENDING, new Integer(13488)); // Set the (pending) "allow system name" value of the NetServer to true. ns.setAttributeValue(NetServer.ALLOW_SYSTEM_NAME_PENDING, new Boolean(true)); // Commit the attribute changes (send them to the system). ns.commitAttributeChanges(); // Print all the attribute values of the NetServer object. ResourceMetaData[] attributeMetaData = ns.getAttributeMetaData(); for(int i = 0; i<attributeMetaData.length; i++) { Object attributeID = attributeMetaData[i].getID(); Object value = resource.getAttributeValue(attributeID); System.out.println("Attribute " + attributeID + " = " + value); } } catch (ResourceException e) { e.printStackTrace(); } finally { if (system != null) system.disconnectAllServices(); }
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALLOW_SYSTEM_NAME
Deprecated.
Attribute ID for "allow system name".
|
static java.lang.String |
ALLOW_SYSTEM_NAME_PENDING
Deprecated.
Attribute ID for "allow system name (pending)".
|
static java.lang.String |
AUTHENTICATION_METHOD
Deprecated.
Attribute ID for "authentication method".
|
static java.lang.String |
AUTHENTICATION_METHOD_PENDING
Deprecated.
Attribute ID for "authentication method (pending)".
|
static java.lang.String |
AUTOSTART
Deprecated.
Attribute ID for "autostart".
|
static java.lang.String |
BROWSING_INTERVAL
Deprecated.
Attribute ID for "browsing interval".
|
static java.lang.String |
BROWSING_INTERVAL_PENDING
Deprecated.
Attribute ID for "browsing interval (pending)".
|
static java.lang.String |
CCSID
Deprecated.
Attribute ID for "server CCSID".
|
static java.lang.String |
CCSID_PENDING
Deprecated.
Attribute ID for "server CCSID (pending)".
|
static java.lang.String |
DESCRIPTION
Deprecated.
Attribute ID for "description".
|
static java.lang.String |
DESCRIPTION_PENDING
Deprecated.
Attribute ID for "description (pending)".
|
static java.lang.String |
DOMAIN
Deprecated.
Attribute ID for "domain name".
|
static java.lang.String |
DOMAIN_PENDING
Deprecated.
Attribute ID for "domain name (pending)".
|
static java.lang.String |
GUEST_USER_PROFILE
Deprecated.
Attribute ID for "guest user profile".
|
static java.lang.String |
GUEST_USER_PROFILE_PENDING
Deprecated.
Attribute ID for "guest profile (pending)".
|
static java.lang.String |
IDLE_TIMEOUT
Deprecated.
Attribute ID for "idle timeout".
|
static java.lang.String |
IDLE_TIMEOUT_PENDING
Deprecated.
Attribute ID for "idle timeout (pending)".
|
static java.lang.String |
LOGON_SUPPORT
Deprecated.
Attribute ID for "logon support".
|
static java.lang.String |
LOGON_SUPPORT_PENDING
Deprecated.
Attribute ID for "logon support (pending)".
|
static java.lang.String |
NAME
Deprecated.
Attribute ID for "name".
|
static java.lang.String |
NAME_PENDING
Deprecated.
Attribute ID for "name (pending)".
|
static java.lang.String |
WINS_ENABLEMENT
Deprecated.
Attribute ID for "WINS enablement".
|
static java.lang.String |
WINS_ENABLEMENT_PENDING
Deprecated.
Attribute ID for "WINS enabled (pending)".
|
static java.lang.String |
WINS_PRIMARY_ADDRESS
Deprecated.
Attribute ID for "WINS primary address".
|
static java.lang.String |
WINS_PRIMARY_ADDRESS_PENDING
Deprecated.
Attribute ID for "WINS primary address (pending)".
|
static java.lang.String |
WINS_SCOPE_ID
Deprecated.
Attribute ID for "WINS scope ID".
|
static java.lang.String |
WINS_SCOPE_ID_PENDING
Deprecated.
Attribute ID for "WINS scope ID (pending)".
|
static java.lang.String |
WINS_SECONDARY_ADDRESS
Deprecated.
Attribute ID for "WINS secondary address".
|
static java.lang.String |
WINS_SECONDARY_ADDRESS_PENDING
Deprecated.
Attribute ID for "WINS secondary address (pending)".
|
Constructor and Description |
---|
NetServer()
Deprecated.
Constructs a NetServer object.
|
NetServer(AS400 system)
Deprecated.
Constructs a NetServer object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
commitAttributeChanges(java.lang.Object[] attributeIDs,
java.lang.Object[] values)
Deprecated.
Commits the specified attribute changes.
|
void |
end()
Deprecated.
Ends the NetServer job on the IBM i system.
|
protected void |
establishConnection()
Deprecated.
Establishes the connection to the system.
|
protected void |
freezeProperties()
Deprecated.
Freezes any property changes.
|
java.lang.Object |
getAttributeUnchangedValue(java.lang.Object attributeID)
Deprecated.
Returns the value of an attribute, disregarding any uncommitted
changes.
|
boolean |
isStarted()
Deprecated.
Indicates whether or not the NetServer job on the IBM i system is started.
|
ResourceList |
listFileShares()
Deprecated.
Lists all file server shares currently associated with the NetServer.
|
ResourceList |
listFileShares(java.lang.String shareName)
Deprecated.
Lists file server shares currently associated with the NetServer.
|
ResourceList |
listPrintShares()
Deprecated.
Lists all print server shares currently associated with the NetServer.
|
ResourceList |
listPrintShares(java.lang.String shareName)
Deprecated.
Lists print server shares currently associated with the NetServer.
|
ResourceList |
listSessionConnections()
Deprecated.
Lists all session connections currently associated with the NetServer.
|
ResourceList |
listSessions()
Deprecated.
Lists all sessions currently associated with the NetServer.
|
ResourceList |
listShareConnections()
Deprecated.
Lists all share connections currently associated with the NetServer.
|
void |
refreshAttributeValues()
Deprecated.
Refreshes the values for all attributes.
|
void |
start()
Deprecated.
Starts the NetServer job on the IBM i system.
|
void |
start(boolean reset)
Deprecated.
Starts the NetServer job on the IBM i system, and (optionally) resets it.
|
cancelAttributeChanges, commitAttributeChanges, commitAttributeChanges, fireAttributeChangesCanceled, fireAttributeChangesCommitted, fireAttributeValueChanged, fireResourceCreated, fireResourceDeleted, getAttributeUnchangedValue, getAttributeValue, getAttributeValue, hasUncommittedAttributeChanges, initializeAttributeValue, setAttributeValue, setAttributeValue
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
public static final java.lang.String ALLOW_SYSTEM_NAME
public static final java.lang.String ALLOW_SYSTEM_NAME_PENDING
public static final java.lang.String AUTHENTICATION_METHOD
public static final java.lang.String AUTHENTICATION_METHOD_PENDING
public static final java.lang.String AUTOSTART
false
, regardless of the actual setting on the system.public static final java.lang.String BROWSING_INTERVAL
public static final java.lang.String BROWSING_INTERVAL_PENDING
public static final java.lang.String CCSID
This is the CCSID that is used for all
clients connected to the system.
The default value for this field is the
associated ASCII CCSID for the CCSID of the job
used to start the system.
Note: A value of 0 indicates that the user would
like to use the associated ASCII CCSID for the
CCSID of the job used to start the system.
public static final java.lang.String CCSID_PENDING
public static final java.lang.String DESCRIPTION
public static final java.lang.String DESCRIPTION_PENDING
public static final java.lang.String DOMAIN
public static final java.lang.String DOMAIN_PENDING
public static final java.lang.String GUEST_USER_PROFILE
Note: Guest support allows customers to have users accessing files and printers on the system, without the requirement of a user profile on the system. It limits access to data and allows customers to support a set of users who may only need print support but do not otherwise need system access.
public static final java.lang.String GUEST_USER_PROFILE_PENDING
public static final java.lang.String IDLE_TIMEOUT
public static final java.lang.String IDLE_TIMEOUT_PENDING
public static final java.lang.String LOGON_SUPPORT
public static final java.lang.String LOGON_SUPPORT_PENDING
public static final java.lang.String NAME
public static final java.lang.String NAME_PENDING
public static final java.lang.String WINS_ENABLEMENT
public static final java.lang.String WINS_ENABLEMENT_PENDING
public static final java.lang.String WINS_PRIMARY_ADDRESS
public static final java.lang.String WINS_PRIMARY_ADDRESS_PENDING
public static final java.lang.String WINS_SCOPE_ID
public static final java.lang.String WINS_SCOPE_ID_PENDING
public static final java.lang.String WINS_SECONDARY_ADDRESS
public static final java.lang.String WINS_SECONDARY_ADDRESS_PENDING
public NetServer()
public NetServer(AS400 system)
system
- The system with which the NetServer is associated.protected void commitAttributeChanges(java.lang.Object[] attributeIDs, java.lang.Object[] values) throws ResourceException
commitAttributeChanges
in class ChangeableResource
attributeIDs
- The attribute IDs for the specified attribute changes.values
- The specified attribute changesResourceException
- If an error occurs.public void end() throws ResourceException
ResourceException
- If an error occurs.protected void establishConnection() throws ResourceException
The method is called by the resource framework automatically when the connection needs to be established.
establishConnection
in class Resource
ResourceException
- If an error occurs.protected void freezeProperties() throws ResourceException
The method is called by the resource framework automatically when the properties need to be frozen.
freezeProperties
in class Resource
ResourceException
- If an error occurs.public java.lang.Object getAttributeUnchangedValue(java.lang.Object attributeID) throws ResourceException
getAttributeUnchangedValue
in class ChangeableResource
attributeID
- Identifies the attribute.ResourceException
- If an error occurs.public boolean isStarted() throws ResourceException
true
if the NetServer job is started; false
otherwise.ResourceException
- If an error occurs.public ResourceList listFileShares() throws ResourceException
NetServerFileShare
objects.ResourceException
- If an error occurs.public ResourceList listFileShares(java.lang.String shareName) throws ResourceException
NetServerFileShare
objects.shareName
- Name of shares to list. Can include wildcard ("*").ResourceException
- If an error occurs.public ResourceList listPrintShares() throws ResourceException
NetServerPrintShare
objects.ResourceException
- If an error occurs.public ResourceList listPrintShares(java.lang.String shareName) throws ResourceException
NetServerPrintShare
objects.shareName
- Name of shares to list. Can include wildcard ("*").ResourceException
- If an error occurs.public ResourceList listSessionConnections() throws ResourceException
NetServerConnection
objects.ResourceException
- If an error occurs.public ResourceList listSessions() throws ResourceException
NetServerSession
objects.ResourceException
- If an error occurs.public ResourceList listShareConnections() throws ResourceException
NetServerConnection
objects.ResourceException
- If an error occurs.public void refreshAttributeValues() throws ResourceException
refreshAttributeValues
in class ChangeableResource
ResourceException
- If an error occurs.public void start() throws ResourceException
ResourceException
- If an error occurs.public void start(boolean reset) throws ResourceException
Note: Reset is used when the NetServer fails to start normally on the system. It is on the NetServer context menu so an administrator can use it. The reset does some under-the-covers cleanup, and is used infrequently. The times it would be used is if the system ended abnormally and there may be jobs or objects hanging around that need to be cleaned up before the system can start again. The reset does that.
reset
- Whether or not the system is to be reset when started.ResourceException
- If an error occurs.