2.7 NetWare Provider

2.7.1 Introduction

The NetWare provider for JNDI acts as a logical root name space for the Novell providers for JNDI. This Novell service provides contexts that list all the known NetWare servers and trees. The individual servers and trees available to the user are returned by performing lookup operations on specific server and tree names.

The NetWare name space uses SLP to list servers and trees. If the SLP configuration is incorrect, the returned list will be incomplete. If an incomplete list is suspected, check the SLP configuration.

This NetWare provider is the most general among Novell’s JNDI providers. Specifying com.novell.service.nw.NetWareInitialContextFactory as the initial context factory is the only required setting to start browsing the NetWare name space. From the NetWare name space, a JNDI application can navigate to all other Novell naming systems. Optionally, a user can specify a tree or server name when creating an initial context, and the provider will return a corresponding NDS or Server context.

The NetWare naming system is used solely as a top level context to list the known NetWare trees and servers. It has no attributes or binding capabilities. Therefore its contexts are not subclasses of javax.naming.DirContext, and it contains no schema information.

2.7.2 NetWare Provider Components

The important components (interfaces and classes) of the NetWare provider are the following:

2.7.3 NetWare Initial Context Implementations

In order to access the NetWare interfaces and classes, you must specify an initial context factory to use. Following is an example of how the NetWare initial context factory implementation might be done.

   Hashtable properties = new Hashtable(); 
    
   property.put(Context.INITIAL_CONTEXT_FACTORY, 
    
      "com.novell.service.bindery.NetWareInitialContextFactory"); 
    
   property.put(Context.PROVIDER_URL, <server name>); 
    
   DirContext initCtx = new InitialDirContext(properties);
   

To access the Server through federation you might do the following:

   serverDirContext = lookup(<server name>+"/");
   

After the initial context has been implemented, you can then get the session environment object using code similar to the following:

   InitialContext initCtx = new InitialContext (hash); 
    
   hash = initCtx.getEnvironment (); 
    
   Session sess = (Session) hash.get (Environment.SESSION.OBJECT);
   

For a detailed discussion of initial context implementation see Initial Context Implementations in the Novell Services Introduction.

2.7.4 Important NetWare Provider Methods

Listed below is the only NetWare Provider method available:

  • NetWareInitialContextFactory.getInitialContext - Creates an initial context based on the PROVIDER_URL entry in the info parameter. The syntax for the URL is [[NetWare://][<SapHost>]/"Trees | Servers"/<DomainName>]. If the URL is not set or is empty, an NetWareInitialContext will be returned.

2.7.5 Relationship of NetWare Classes and Interfaces

The relationship between the NetWare 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.

Figure 2-11 NetWare 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 NetWare interfaces and classes.

  • NetWareInitialContextFactory class implements the Javasoft InitialContextFactory interface, and creates different NetWareInitialContext objects depending on the Context.PROVIDER_URL entry (Servers or Trees).
  • NetWareInitialContext class is created by the NetWareInitialContextFactory class, and is extended by the NetWareServersContext and NetWareTreesContext classes.
  • NetWareServersContext class extends the NetWareInitialContext class.
  • NetWareTreesContext class extends the NetWareInitialContext class.