From commits-return-20271-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Sat Nov 15 17:43:05 2008 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 47738 invoked from network); 15 Nov 2008 17:43:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2008 17:43:04 -0000 Received: (qmail 79465 invoked by uid 500); 15 Nov 2008 17:43:12 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 79425 invoked by uid 500); 15 Nov 2008 17:43:12 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 79415 invoked by uid 99); 15 Nov 2008 17:43:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Nov 2008 09:43:12 -0800 X-ASF-Spam-Status: No, hits=-1993.9 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY,SUBJECT_FUZZY_TION X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Nov 2008 17:41:48 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 08E3D234C25F for ; Sat, 15 Nov 2008 09:42:00 -0800 (PST) Message-ID: <37379804.1226770920017.JavaMail.www-data@brutus> Date: Sat, 15 Nov 2008 09:42:00 -0800 (PST) From: confluence@apache.org To: commits@directory.apache.org Subject: [CONF] Apache Directory SandBox: Draft - How to write a simple custom partition for ApacheDS (page edited) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org

Draft - How to write a simple custom partition for ApacheDS has been edited by Stefan Zoerner (Nov 15, 2008).

(View changes)

Content:

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