NetServer

NetServer™ has been deprecated and replaced by class ISeriesNetServer.

The NetServer class represents the NetServer service on an iSeries™ server. NetServer objects allow you to query and modify the state and configuration of the NetServer service.

For example, you can use the NetServer class to:

Note: In order to use the NetServer class, you need a server user profile that has *IOSYSCFG authority.

The NetServer class is an extension of ChangeableResource and Resource, so it provides a collection of "attributes" to represent the various NetServer values and settings. You query or change the attributes in order to access or change the configuration of your NetServer. Some of the NetServer attributes are:

Pending attributes

Many of the NetServer attributes are pending (for example, NAME_PENDING). Pending attributes represent NetServer values that take effect the next time you start (or restart) the NetServer on the server.

When you have a pair of related attributes and one attribute is pending while the other is nonpending:

Other NetServer classes

Related NetServer classes allow you to get and set detailed information about specific connections, sessions, file shares, and print shares:

Example: Using a NetServer object to change the name of the NetServer

Note: Read the Code example disclaimer for important legal information.
     // Create a system object to represent the iSeries server.
     AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWD");

     // Create an object with which to query and modify the NetServer.
     NetServer nServer = new NetServer(system);

     // Set the "pending name" to NEWNAME.
     nServer.setAttributeValue(NetServer.NAME_PENDING, "NEWNAME");

     // Commit the changes.  This sends the changes to the server.
     nServer.commitAttributeChanges();

     // The NetServer name will get set to NEWNAME the next time the NetServer
     // is ended and started.