2.4 NCP Extensions Provider

2.4.1 Introduction

The NCPExtensions provider for JNDI allows access to the NetWare operating system extensions by providing contexts that implement the behavior of NetWare NCP extensions, such as discovering and accessing NCP extensions.

The NCPExtension interface allows you to send requests to and receive replies from NCP extensions registered on a NetWare server. You cannot create new NCP extensions using JNDI; you can only access existing NCP extensions. You will usually use an NCP extension if you have written it yourself in C or if a third party has provided it.

You cannot enter the NCP Extensions naming system directly. Since an NCP extension is bound to a server, you can access it only from the Server naming system.

2.4.2 NCP Extensions Components

The important components (interfaces and classes) of NCP extensions are the following:

  • NCPExtension interface represents an NCP extension registered on the NetWare server that allows you to send requests to and receive replies from the NCP extension.
  • NCPExtensionDirContext class represents an NCPExtension loaded on a NetWare server. An NCPExtensionDirContext has one attribute, NCPExtensionInfo, with a single value that is an instance of NCPExtensionInfoImpl.
  • NCPExtensionInfo interface provides an attribute of an NCP extension with a single value that is an instance of NCPExtensionInfoImpl.
  • NCPExtensionInfoImpl class provides the value for attribute NCPExtensionInfo, and methods for getting information about the NCP extension loaded on the server.

2.4.3 NCP Extensions Initial Context Implementation

In order to access the NCP extensions interfaces and classes you must federate using the Server. Following is an example of how the NCPExtension federation from the Server might be done.

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

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

   serverDirContext = ctx; 
    
   ctx.lookup("ncpextensions"+"/");
   

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

2.4.4 Important NCP Extensions Methods

Listed below are some important NCP extensions methods of which to be aware. For a complete list of available methods, go to the Reference Guide documentation.

2.4.5 Relationship of NCP Extensions Classes and Interfaces

The relationship between the NCP extensions 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-3 NCP Extensions 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 NCPExtension interfaces and classes.

  • NCPExtension interface is implemented by the NCPExtensionDirContext class.
  • NCPExtensionDirContext class implements the NCPExtension interface and extends the Javasoft DirContext interface indirectly through the ComponenetDirContext class.
  • NCPExtensionInfo interface is implemented by the NCPExtensionInfoImpl class.
  • NCPExtensionInfoImpl class implements the NCPExtensionInfo interface.