2.9 Server Provider
2.9.1 Introduction
The Server provider for JNDI allows for server management
and control functionality. The Server Provider has a context that
represents a NetWare server. This context allows access to attribute information
and provides federation to three name spaces associated with the
server: File System, NCPExtensions, and Bindery.
2.9.2 Server Provider Components
The important components (interfaces and classes) of the server
provider are the following:
- NWServer interface
represents a NetWare server, allowing you to perform functions on
the NetWare server.
- ServerDirContext Represents
a NetWare server with the attriburtes enumerated below(ServerCounts,
ServerDescription, ServerDiagnostics, ServerLoginStatus, and ServerVersion).
The server has three bindings: File System, NCPExtensions, and Bindery.
- ServerCounts interface
corresponds to a specific attribute of a ServerDirContext. The ID
of the attribute is equal to ATTR_ID, and its value is
an object that implements this interface.
- ServerCountsImpl class
provides the value of ServerCounts, a ServerDirContext attribute,
and is an implementation class for the ServerCounts interface.
- ServerDescription interface corresponds
to a specific attribute of a ServerDirContext. The ID of the attribute
is equal to ATTR_ID, and its value is an object that implements
this interface.
- ServerDescriptionImpl class provides
the value of ServerDescription, a ServerDirContext attribute, and
is an implementation class for the ServerDescription interface.
- ServerDiagnostics interface corresponds
to a specific attribute of a ServerDirContext. The ID of the attribute
is equal to ATTR_ID, and its value is an object that implements
this interface.
- ServerDiagnosticsImpl class provides
the value of ServerDiagnostic, a ServerDirContext attribute, and
is an implementation class for the ServerDiagnostic interface.
- ServerLoginStatus interface corresponds
to a specific attribute of a ServerDirContext. The ID of the attribute
is equal to ATTR_ID, and its value is an object that implements
this interface.
- ServerLoginStatusImpl class provides
the value of ServerLoginStatus, a ServerDirContext attribute, and
is an implementation class for the ServerLoginStatus interface.
- ServerVersions interface
corresponds to a specific attribute of a ServerDirContext. The ID
of the attribute is equal to ATTR_ID, and its value is
an object that implements this interface.
- ServerVersionsImpl class
provides the value of ServerVersions, a ServerDirContext attribute,
and is an implementation class for the ServerVersions interface.
2.9.3 Server Initial Context Implementation
In order to access the Server interfaces and classes you must
specify an initial context factory to use or you can access the
Server through federation from another name space. Following is
an example of how the Server initial context factory implementation
might be done:
Hashtable properties = new Hashtable();
property.put(Context.INITIAL_CONTEXT_FACTORY,
"com.novell.service.server.ServerInitialContextFactory");
property.put(Context.PROVIDER_URL, <server name>);
DirContext initCtx = new InitialDirContext(properties);
To access a server through federation you might do the following:
serverDirContext = lookup(<server name>+"/");
For a detailed discussion of initial context implementation
see Initial Context Implementations in
the Novell Services Introduction.
2.9.4 Important Server Provider Methods
Listed below are some important Server provider methods of
which to be aware. For a complete list of available methods, go
to the Reference Guide documentation.
- NWServer.getTime -
Returns the time of the NetWare Server.
- NWServer.setTime -
Sets the time of the NetWare Server.
- NWServer.loadNLM -
Loads an NLM on the NetWare Server using the load command parameter
for the NLM: {VOLUME NAME:}{PATH}NLMName{.ext}{parameters}.
- NWServer.unloadNLM -
Unloads the specified NLM from the NetWare Server.
2.9.5 Relationship of Server Classes and
Interfaces
The relationship between the Server interfaces and classes
is illustrated in the diagram below, followed by a brief description
of the relationship each interface and class has with other interfaces and
classes.
In this diagram of interfaces and classes a solid blue line
ending with a hollow arrow represents an implementation of an interface.
A solid red line ending with a solid arrow represent an extension
of a class. The dotted black lines ending with a small solid arrow
imply some relationships between the different interfaces and classes.
Links are provided to the Reference Guide documentation for each of
these important Server interfaces and classes.
- NWServer is
implemented by the ServerDirContext class. NWServer represents a
NetWare server on which various functions can be performed.
- ServerDirContext class
implements the NWServer interface and extends the Javasoft DirContext
interface indirectly through the ComponenetDirContext class. ServerDirContext
has bindings to three name spaces with binding names of File System,
Bindery, and NCP Extensions.
- Session interface
provides the current session for the ServerDirContext.
- ServerCounts interface
is implemented by the ServerCountsImpl class, which provides the
ServerCounts attribute value.
- ServerCountsImpl class
implements the ServerCounts interface providing it with the attribute
value.
- ServerDescription interface
is implemented by the ServerDescriptionImpl class, which provides
the ServerDescription attribute value.
- ServerDescriptionImpl class implements
the ServerDescription interface providing it with the attribute
value.
- ServerDiagnostics interface
is implemented by the ServerDiagnosticsImpl class, which provides
the ServerDiagnostic attribute value.
- ServerDiagnosticsImpl class implements
the ServerDiagnostic interface providing it with the attribute value.
- ServerLoginStatus interface
is implemented by the ServerLoginStatusImpl class, which provides
the ServerLoginStatus attribute value.
- ServerLoginStatusImpl class implements
the ServerLoginStatus interface providing it with the attribute
value.
- ServerVersions interface
is implemented by the ServerVersionsImpl class, which provides the
ServerVersionsI attribute value.
- ServerVersionsImpl class implements
the ServerVersions interface providing it with the attribute value.
Documentation for the methods provided by each of the server
attribute classes (ServerCounts, ServerDescription, ServerDiagnostics,
ServerLoginStatus and ServerVersions) can be viewed by going to
the Server
Package of the Reference Guide and opening each of these
attribute classes.