Previous | Next | Trail Map | Java Objects and the Directory | Representation in the Directory

LDAP Directories

The details of how LDAP attributes are used to store data about Java objects are described in the Internet-Draft draft-ryan-java-schema-00.txt.

The discussion here is a quick summary of that Internet-Draft. It is intended primarily for developers of LDAP service providers. API users will generally not need this information. Service providers implement the details here so that API users can simply use Context.bind()(in the API reference documentation) or DirContext.bind()(in the API reference documentation).

In addition to reading this section, developers of LDAP service providers and those needing to add the Java schema to servers should consult the Internet-Draft.

Types of Objects

As indicated in the Object Factories (in the Java Objects and the Directory trail) lesson, service providers are encouraged to support storing referenceable objects, serializable objects, and DirContext(in the API reference documentation) objects.

DirContext

DirContext objects are stored straightforwardly by storing their attributes. In other words, an LDAP service provider can extract the attributes using DirContext.getAttributes("")(in the API reference documentation) and store them into the directory.

Referenceable Objects

A Referenceable(in the API reference documentation) object is stored by storing its reference ( Referenceable.getReference()(in the API reference documentation)). A Reference(in the API reference documentation) is stored by extracting its fields and storing them into the directory as attributes as follows:

LDAP Attribute Name Content
javaClassName Reference.getClassName()(in the API reference documentation)
javaFactoryName Reference.getFactoryClassName()(in the API reference documentation)
javaFactoryLocation Reference.getFactoryClassLocation()(in the API reference documentation)
javaReferenceAddress Reference.get()(in the API reference documentation)

"javaReferenceAddress" is a multivalued attribute consisting of one or more values. Each value represents a RefAddr(in the API reference documentation). Details of how a RefAddr is encoded are described in the Internet-Draft.

An LDAP entry that stores these attributes should have "javaNamingReference" as one of its object classes.

Serializable Objects

A serializable object is stored by serializing the object and storing it into the directory as attributes as follows:

LDAP Attribute Name Content
javaClassName Object.getClass().getName()
javaSerializedObject serialized form of object

An LDAP entry that stores these attributes should have "javaObject" as one of its object classes.

Schema

The object class and attribute definitions to be added to the schema of your directory are included with this tutorial.

If you are adding an LDAP entry that consists just of attributes that represent a Java object, you need to also include the object class "javaContainer", which is a structural object class that allows the entry to exist in the LDAP directory.


Previous | Next | Trail Map | Java Objects and the Directory | Representation in the Directory