Accessing Directory Services

So far, we’ve only discussed JNDI in the context of naming services. Now it’s time to turn to directory services. At its root, a directory is merely a naming service whose objects have attributes as well as names. Programming for a directory service, such as an LDAP directory, is roughly as hard as programming for a relational database.

As we’ve seen, a binding in JNDI is an association between a name and an object. While this association is sufficient for some naming services, a directory service needs to be able to associate more than just a name with an object. Attributes associate specialized data with an object. In JNDI, an object with attributes as well as a name is called a directory entry.

We’ve been talking about the filesystem as though it were a naming system because that is how Sun’s filesystem provider implements it. But if you think about it, a filesystem is really a directory system; files and directories have attributes like permissions, user IDs, and group IDs (we just can’t get at these attributes using Sun’s filesystem provider).

Most of the directories you’ll interact with using JNDI are based on the X.500 directory services standard. For example, both standard LDAP directories and Novell’s NDS directories have been influenced by X.500. As such, it is important that you know a little bit about X.500, so that you can understand how these directories work.

X.500 Directories

X.500 is a directory services standard that was developed through ...

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.