![]() ![]() ![]() ![]() |
Preparations |
Once you've set up the directory, or have directed your program to communicate with an existing directory, what sort of information can you expect to find there?There are two kinds of information that you can get from the directory: bindings and attributes. The directory can be viewed as consisting of name-to-object bindings. That is, each object in the directory has a corresponding name. An object in the directory can be retrieved by looking up its name. If you are using a naming service like the file system (as we will be doing in some of our examples), the objects are files and they are bound to file names.
Another kind of data that is stored in the directory are attributes. An object in the directory, in addition to having a name, also has an optional set of attributes. You can ask the directory for an object's attributes, as well as ask the directory to search for an object that has certain attributes.
Examples of accessing both these kinds of information are given in this trail. Specifics of exactly what you can access from a naming or directory service depend on how the particular service has been laid out and what information has been added into it.
Providing Directory Content for This Tutorial
To set up the file system namespace, run the Setup program. To run this program, you give it the name of the directory in which to create the tutorial test namespace. For example, typing the following:creates a directory "/tmp/tutorial" and populates it with directories and files.# java Setup /tmp/tutorialIn the directory examples in this trail, the results shown reflect how the LDAP directory has been set up using the configuration file (tutorial.ldif) that accompanies this tutorial. If you are using an existing server, or a server with a different setup, you may see different results.
Installation Note: Schema In order to load the configuration file (tutorial.ldif), you must first either turn schema-checking off in the server, or add the schema that accompanies this tutorial to the server. Both of these tasks are typically performed by the directory server's administrator.Different directory servers have different ways of configuring their schema. The schema that accompanies this tutorial is a formal description that might not be in a format that can be directly copied and pasted into server configuration files. Specifically, the attribute syntaxes are described in terms of RFC 2252. The Netscape Directory Server 3.11 has a different way of identifying attribute syntaxes. For that server, you should use "case ignore string" for the attributes with the "DirectoryString" syntax (1.3.6.1.4.1.1466.115.121.1.15), and use "binary" for the attribute with the Binary syntax (1.3.6.1.4.1.1466.115.121.1.5).
Installation Note: Access Control Different directory servers handle access control differently. Some examples in this trail perform updates to the directory. Therefore, you need to take server-specific actions to make the directory updatable in order for those examples to work. For the Netscape Directory Server, add the "aci" entry suggested in the netscape.aci.ldif file to the "dn: o=JNDITutorial" entry to make the entire directory updatable. For the Sun Directory Services 3.1, use its AdminTool or update the server's dsserv.acl.conf file to make the directory's entries updatable.
![]() ![]() ![]() ![]() |
Preparations |