Class ISeriesNetServer

  • All Implemented Interfaces:

    public class ISeriesNetServer
    extends Object
    implements Serializable
    Represents the NetServer service on a system. This class allows the user to query and modify the state and configuration of the NetServer.

    If the NetServer job on the IBM i system is not started, the "list" methods may return incomplete results. To determine if the NetServer job is started, use the isStarted method. To start the NetServer, use the start method.

    Note: The first call to one of the attribute "getter" methods will cause an implicit call to refresh, if refresh() hasn't yet been explicitly called. If any exceptions are thrown by refresh() during the implicit call, they will be logged to Trace.ERROR and ignored. However, should an exception occur during an explicit call to refresh(), it will be thrown to the caller.

    Note: Typically, methods which change the state or attributes of the NetServer require that the system user profile have *IOSYSCFG special authority. For example, starting or ending the NetServer requires *IOSYSCFG authority.

    Note: This class uses some API fields that are available only when connecting to systems at release V5R1 or higher.

     // Create a NetServer object for a specific system.
     AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD");
     ISeriesNetServer ns = new ISeriesNetServer(system);
       // Get the name of the NetServer.
       System.out.println("Name: " + ns.getName());
       // Get the CCSID of the NetServer.
       System.out.println("CCSID: " + ns.getCCSID());
       // Get the "allow system name" value of the NetServer.
       System.out.println("'Allow system name': " +  ns.isAllowSystemName());
       // Set the description of the NetServer.
       // Note: Changes will take effect after next start of NetServer.
       ns.setDescription("The NetServer");
       // Set the CCSID of the NetServer to 13488.
       // Set the "allow system name" value of the NetServer to true.
       // Commit the attribute changes (send them to the system).
     catch (AS400Exception e) {
       AS400Message[] messageList = e.getAS400MessageList();
       for (int i=0; i<messageList.length; i++) {
     catch (Exception e) {
     finally {
       if (system != null) system.disconnectAllServices();
    See Also:
    ISeriesNetServerFileShare, ISeriesNetServerPrintShare, ISeriesNetServerConnection, ISeriesNetServerSession, Serialized Form