You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Writing a simple custom partition for ApacheDS

On the mailing list, regularly people ask on how to write a custom partition in order to publish their data via LDAP. Please note that this is not an easy task. Nevertheless I try to give you a starting point with simple examples.

If you simply plan to add another suffix to ApacheDS (besides example.com, for instance), it is not necessary to write any code. You can simply add some lines to the configuration.

The following is for those who plan to use another storage mechanism than the provided default.

What exactly is a partition?

Within ApacheDS, a partition is a physically distinct store for a subset of the entries contained within the server. A partition can be implemented using any storage mechanism or can even be backed in memory. The default storage mechanism for a partition is JDBM.

Implementing your own partition is basically implementing the Partition interface from the org.apache.directory.server.core.partition package.

Hello world. A minimal partition

Let's start with a minimal partition, the hello world. Minimal means here, that it is possible to add it to ApacheDS and see it with an LDAP browser.

Features

The partition

  • correctly implements the Partition interface
  • is pluggable in the server (embedded and declarative in the configuration)
  • is visible for clients like ldapsearch or Apache Directory Studio
  • contains one entry, which contains the famous "hello, world" message in an attribute value
  • does not support any modification operations like delete, add etc.

Implementing the class

A partition which provides some more data

  • No labels