LDAP SDK Persistence Updates

Over the Christmas break, I was able to spend some time working on the LDAP SDK persistence framework and I believe that it is now in a very usable state. I do plan on talking it over with a couple of people before merging it into the trunk (at which point it would be included in the next release), but if you’re interested in possibly using it then I would strongly encourage you to try it for yourself. You can do that by checking the source code out of the public Subversion repository using the following command:

svn checkout \
https://ldap-sdk.svn.sourceforge.net/svnroot/ldap-sdk/branches/persist \

Then, you can build the LDAP SDK using the command ./build-se.sh on UNIX-based systems, or build-se.bat on Windows. The resulting build/package directory will include zipped-up and extracted versions of the LDAP SDK.

Some of the most significant changes that I made to the LDAP SDK persistence framework over the break include:

  • I added a generate-source-from-schema tool that can be used to read a directory server schema and generate Java source code for a properly-annotated class that can be used to interact with entries of a specified type, based on the structural object class (and optionally auxiliary classes) contained in that entry. If you want to work with existing data in a directory, or data for which the LDAP schema is already defined, then this is a very easy way to get source code to interact with entries of that type.

  • I added a generate-schema-from-source tool that can be used to generate LDAP attribute type and object class definitions from a properly-annotated source file.

  • I updated the default LDAP field encoder so that it supports interacting with multivalued attributes using Java lists and sets. Previously, this was only possible using arrays, and that option is still available and is still the mechanism used by the generate-source-from-schema tool.

  • I added the initial set of documentation for the persistence framework, including schema and code examples.