Preparations |
Following is a list of the software/systems that you need:
Java Platform Software
To run applications or applets that use the JNDI, you need a v1.1.2 or higher of the Java platform software (such as the Java 2 Software Development Kit (SDK) software).To run the applets, you can use any Java-compatible Web browser, such as HotJava browser, Netscape Communicator or Navigator v4, or Internet Explorer v5. To ensure that your applets take full advantage of the latest features of the Java platform software, you can use the Java Plug-in with your Web browser.
JNDI Software
The JNDI class libraries are already included with the Java 2 SDK, v1.3. If you are using another version of the SDK, then you can use the JNDI software available from the JNDI Web site. All sample code from this tutorial, as well as the tutorial itself, can also be downloaded from that site.Service Provider Software
The JNDI API is a generic API for accessing any naming or directory service. Actual access to a naming or directory service is enabled by plugging in a service provider under the JNDI. An overview of the JNDI architecture and the role of service providers is given in the JNDI Overview lesson.A service provider is software that maps the JNDI API to actual calls to the naming or directory server. Typically, the roles of the service provider and that of the naming/directory server differ. In the terminology of client/server software, the JNDI and the service provider are the client (called the JNDI client) and the naming/directory server is the server.
Clients and servers may interact in many ways. In one common way, they use a network protocol so that the client and server can exist autonomously in a networked environment. The server typically supports many different clients, not only JNDI clients, provided that the clients conform to the specified protocol. The JNDI does not dictate any particular style of interaction between JNDI clients and servers. For example, at one extreme the client and server could be the same entity.
You need to obtain the classes for the service providers that you will be using. For example, if you plan to use the JNDI to access an LDAP directory server, then you would need software for an LDAP service provider.
The Java 2 SDK, v1.3 comes with service providers for LDAP, COS naming, and the RMI registry. If you are using an earlier version of the SDK, then you need to get the service providers. The JNDI Web site lists service providers you can download, including one for the LDAP.
This tutorial uses two service providers:
The file system service provider can be obtained from the JNDI Web site.
- The file system service provider for the naming examples
- The LDAP service provider for the directory and event notification examples
When using the file system service provider, you don't need to set up a server because you can use your local file system as the server. When using the LDAP service provider, you need either to set up your own server or to have access to an existing server, as explained next.
Naming and Directory Server Software
Once you have obtained the service provider software, you then need to set up or have access to a corresponding naming/directory server. Setting up a naming/directory server is typically the job of a network system administrator. Different vendors have different installation procedures for their naming/directory servers. Some require special machine privileges before the server can be installed. You should consult the naming/directory server software's installation instructions.For the naming examples in this tutorial, you'll use the file system.
For the directory examples in this tutorial, you need access to an LDAP server. You can download a free, publicly available LDAP server from OpenLDAP. See the next part of this lesson for information on populating the LDAP server with content for running this tutorial's examples.
Publicly accessible servers are also available at the following URLs:
- ldap://ldap.Bigfoot.com
- ldap://ldap.four11.com
- ldap://ldap.InfoSpace.com
Preparations |