![]() ![]() ![]() ![]() |
Representation in the Directory |
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()
or DirContext.bind()
.
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 Factorieslesson, service providers are encouraged to support storing referenceable objects, serializable objects, and DirContext
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("")and store them into the directory.
Referenceable Objects
A Referenceableobject is stored by storing its reference ( Referenceable.getReference()
). A Reference
is stored by extracting its fields and storing them into the directory as attributes as follows:
LDAP Attribute Name Content javaClassName Reference.getClassName() javaFactoryName Reference.getFactoryClassName() javaFactoryLocation Reference.getFactoryClassLocation() javaReferenceAddress Reference.get() "javaReferenceAddress" is a multivalued attribute consisting of one or more values. Each value represents a RefAddr
. 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.
![]() ![]() ![]() ![]() |
Representation in the Directory |