Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C901D18EB2 for ; Sun, 5 Jul 2015 22:34:46 +0000 (UTC) Received: (qmail 4264 invoked by uid 500); 5 Jul 2015 22:34:46 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 4120 invoked by uid 500); 5 Jul 2015 22:34:46 -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 3675 invoked by uid 99); 5 Jul 2015 22:34:46 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jul 2015 22:34:46 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 2CD42AC0E52 for ; Sun, 5 Jul 2015 22:34:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r957126 [9/18] - in /websites/staging/directory/trunk/content: ./ apacheds/ apacheds/advanced-ug/ apacheds/basic-ug/ apacheds/configuration/ apacheds/kerberos-ug/ api/ api/download/ api/groovy-api/ api/user-guide/ escimo/ fortress/ fortress... Date: Sun, 05 Jul 2015 22:34:38 -0000 To: commits@directory.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150705223446.2CD42AC0E52@hades.apache.org> Modified: websites/staging/directory/trunk/content/api/groovy-api/5-groovy-ldap-reference.html ============================================================================== --- websites/staging/directory/trunk/content/api/groovy-api/5-groovy-ldap-reference.html (original) +++ websites/staging/directory/trunk/content/api/groovy-api/5-groovy-ldap-reference.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -173,6 +173,17 @@ +

5 - Groovy LDAP Reference

@@ -192,10 +203,10 @@
- +

The search method performs an LDAP search operation and returns the result as a list of entries. In Groovy LDAP, an entry is simply a map.

-

Three options to call a search method

-

Short cut methods

+

Three options to call a search method

+

Short cut methods

For the most common types of search requests, the LDAP class contains two direct methods.

public List<Object> search( String filter ) throws NamingException
 public List<Object> search( String filter, String base, SearchScope scope ) throws NamingException
@@ -215,7 +226,7 @@
 
-

Using a Search object

+

Using a Search object

The class org.apache.directory.groovyldap.Search is a JavaBean which contains parameters for a search.

@@ -271,7 +282,7 @@ -

Using map style syntax

+

Using map style syntax

A very handy way to call search operations is to use the expressive map style arguments. The same properties as described for the Search class are supported. Here is an example.

...
 results = ldap.search(filter: '(objectClass=person)', 
@@ -281,7 +292,7 @@
 
 
 

The order of arguments does not matter, and this variant is very descriptive, and therefore recommended to use.

-

Using filter arguments

+

Using filter arguments

JNDI supports filter expressions with placeholders like {0}, {1} etc., and Groovy LDAP offers their use as well. Here is a simple example:

...
@@ -295,7 +306,7 @@ Here is a simple example:

It is possible to use this in map style as well.

- +

tbd.

Modified: websites/staging/directory/trunk/content/api/groovy-api/6-groovy-ldap-origin.html ============================================================================== --- websites/staging/directory/trunk/content/api/groovy-api/6-groovy-ldap-origin.html (original) +++ websites/staging/directory/trunk/content/api/groovy-api/6-groovy-ldap-origin.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -173,7 +173,18 @@
-

6-Groovy LDAP Origin

+ +

6-Groovy LDAP Origin

I did some research about accessing LDAP from Groovy, in order to create some simple scripts. It is possible to use both JNDI and libraries like Netscape or Novell SDK from Groovy (you can basically use any Java library in Groovy scripts).

But these approaches have disadvantages. Netscape SDK is plain LDAP, so the scripts look like one familiar to LDAP would expect. But the API is not connected very well to the Collection API, so sometimes it is not easy to use the result from Groovy. And you have a non-standard dependency. JNDI on the other hand is easier to use (exists in every VM), but the scripts look horrible, because of the LDAP abstraction JNDI does. For instance you have to type "entry.nameInNamespace" instead of "entry.DN" (Netscape).

It seems that there does no special solution/library for Groovy and LDAP exist. So I started to create a little prototype. Basically, it is a wrapper which uses JNDI (in order to omit the dependency to a non-standard library) under the hood, but looks like LDAP from the outside (script). Unfortunately, I am not a Groovy expert.

Modified: websites/staging/directory/trunk/content/api/groovy-ldap.html ============================================================================== --- websites/staging/directory/trunk/content/api/groovy-ldap.html (original) +++ websites/staging/directory/trunk/content/api/groovy-ldap.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -154,6 +154,17 @@ +

Groovy LDAP

Learn about an attempt to make LDAP available from Groovy scripts in a way, LDAP people would expect.

@@ -177,14 +188,14 @@

Note: Please note that this is not an official sub project of Apache Directory yet. There are no official releases. However if interest in this client library increases, it may become a sub project very soon.

-

Mission Statement

+

Mission Statement

Create a way to access LDAP from Groovy scripts, which is suitable for people familiar to LDAP. Primary audience are people who plan to write simple scripts against their LDAP servers. This is not about LDAP abstraction. The API should be comparable to the native LDAP library for C, in order to provide an easy start for the primary target group. Nevertheless it should "smell" like other Groovy integration solutions (namely GSQL) do. Especially the use of closures is planned. In order to reduce the number of dependencies, nothing besides Java SE and Groovy itself should be used. JNDI will therefore be used under the hood to communicate with LDAP.

  • Why this? Learn more about the origin of this attempt here.
-

How it looks like in Groovy

+

How it looks like in Groovy

Here are two example scripts which use Groovy LDAP in order to give you a first impression. Learn more about how to use Groovy LDAP in the User Guide.

-

Adding an entry

+

Adding an entry

The attribute values of an LDAP entry can be defined with the help of the expressive Map syntax of Groovy ([DIRxSBOX:...)). The following script uses the add operation to create a new entry in the directory:

import org.apache.directory.groovyldap.LDAP
 
@@ -209,7 +220,7 @@ objectClass: top
 
-

Performing an LDAP search with a closure

+

Performing an LDAP search with a closure

Besides the operations found in the classic LDAP API, Groovy LDAP provides advanced functionality with the help of features specific to the Groovy language. Here is an example which performs a search operation, and executes the behavior given via a closure for each entry found:

import org.apache.directory.groovyldap.LDAP
 
@@ -229,15 +240,15 @@ objectClass: top
 
-

Current status

+

Current status

Creation of the solution has just been started. We do not know, whether it will become an official project with releases and so (no official release yet). Even the name is not final yet. The current version only supports five of the LDAP operations (search, add, delete, compare, modify) explicitly.

-

Get involved

+

Get involved

Feel free to ask questions and provide feedback! Use the Apache Directory mailing lists for this purpose.

For issue tracking, Groovy LDAP has a project within the JIRA installation of the Apache Software Foundation.

-

Alternatives

+

Alternatives

There are other efforts to bring the Groovy and the LDAP World together. An interesting alternative to Groovy LDAP is Gldapo (http://gldapo.codehaus.org/)

-

Where to go from here

+

Where to go from here

  • Download a binary version including the source code
  • Read the User Guide in order to understand which operations are already implemented, and how to use them
  • Modified: websites/staging/directory/trunk/content/api/index.html ============================================================================== --- websites/staging/directory/trunk/content/api/index.html (original) +++ websites/staging/directory/trunk/content/api/index.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -167,7 +167,7 @@ The API is OSGI ready and extensible. New controls, schema elements and network layer could be added or used in the near future.
@@ -177,7 +177,27 @@ -

News

+
+

News

+

Apache Directory LDAP API 1.0.0-M31 released posted on July 5th, 2015

+

The Apache Directory Team is proud to announce the availability of version 1.0.0-M31 of the Apache Directory LDAP API.

+

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

+

This is a schema aware API, with some convenient ways to access a LDAP server. This API is not only targeting the Apache Directory Server, but should work pristine with any LDAP server.

+

It's also an extensible API : new Controls, schema elements and network layer could be added or used in the near future. It's also OSGi capable.

+

This release fixes a security vulnerability, CVE-2015-3250.

+

Feel free to experiment, we highly appreciate your feedback !

+

Downloads are available here and the User's Guide is there

+

News

Apache Directory LDAP API 1.0.0-M30 released posted on May 2nd, 2015

The Apache Directory Team is proud to announce the availability of version 1.0.0-M30 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -204,7 +224,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M29 released posted on April 2nd, 2015

The Apache Directory Team is proud to announce the availability of version 1.0.0-M29 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -235,7 +255,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M28 released posted on January 15th, 2015

The Apache Directory Team is proud to announce the availability of version 1.0.0-M28 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -250,7 +270,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M27 released posted on December 29th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M27 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -259,7 +279,7 @@

This release included a new Control : proxied-authz RFC-4370, and a major cleanup of the OSGi Manifests.

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M26 released posted on November 22th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M26 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -269,7 +289,7 @@

Bugs :

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M25 released posted on November 11th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M25 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -288,7 +308,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M24 released posted on August 2th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M24 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -303,7 +323,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M23 released posted on July 4th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M23 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -321,7 +341,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M22 released posted on April 22th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M22 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

Modified: websites/staging/directory/trunk/content/api/java-api.html ============================================================================== --- websites/staging/directory/trunk/content/api/java-api.html (original) +++ websites/staging/directory/trunk/content/api/java-api.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -154,9 +154,20 @@ -

LDAP Java API

+ +

LDAP Java API

This is the Java implementation of a new LDAP API. This effort was initially conducted with the OpenDS team.

-

Background

+

Background

There are a few existing LDAP API around there. Here is a short list and description.

@@ -207,7 +218,7 @@

(There may be some more we don't know about)

-

Features

+

Features

The User Guide pages gives the list of features the API provides.

Modified: websites/staging/directory/trunk/content/api/news.html ============================================================================== --- websites/staging/directory/trunk/content/api/news.html (original) +++ websites/staging/directory/trunk/content/api/news.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -154,7 +154,27 @@ -

News

+ +

News

+

Apache Directory LDAP API 1.0.0-M31 released posted on July 5th, 2015

+

The Apache Directory Team is proud to announce the availability of version 1.0.0-M31 of the Apache Directory LDAP API.

+

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

+

This is a schema aware API, with some convenient ways to access a LDAP server. This API is not only targeting the Apache Directory Server, but should work pristine with any LDAP server.

+

It's also an extensible API : new Controls, schema elements and network layer could be added or used in the near future. It's also OSGi capable.

+

This release fixes a security vulnerability, CVE-2015-3250.

+

Feel free to experiment, we highly appreciate your feedback !

+

Downloads are available here and the User's Guide is there

+

News

Apache Directory LDAP API 1.0.0-M30 released posted on May 2nd, 2015

The Apache Directory Team is proud to announce the availability of version 1.0.0-M30 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -181,7 +201,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M29 released posted on April 2nd, 2015

The Apache Directory Team is proud to announce the availability of version 1.0.0-M29 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -212,7 +232,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M28 released posted on January 15th, 2015

The Apache Directory Team is proud to announce the availability of version 1.0.0-M28 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -227,7 +247,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M27 released posted on December 29th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M27 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -236,7 +256,7 @@

This release included a new Control : proxied-authz RFC-4370, and a major cleanup of the OSGi Manifests.

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M26 released posted on November 22th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M26 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -246,7 +266,7 @@

Bugs :

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M25 released posted on November 11th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M25 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -265,7 +285,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M24 released posted on August 2th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M24 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -280,7 +300,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M23 released posted on July 4th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M23 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

@@ -298,7 +318,7 @@

Feel free to experiment, we highly appreciate your feedback !

Downloads are available here and the User's Guide is there

-

News

+

News

Apache Directory LDAP API 1.0.0-M22 released posted on April 22th, 2014

The Apache Directory Team is proud to announce the availability of version 1.0.0-M22 of the Apache Directory LDAP API.

The Apache Directory LDAP API is an ongoing effort to provide an enhanced LDAP API, as a replacement for JNDI and the existing LDAP API (jLdap and Mozilla LDAP API).

Modified: websites/staging/directory/trunk/content/api/user-guide.html ============================================================================== --- websites/staging/directory/trunk/content/api/user-guide.html (original) +++ websites/staging/directory/trunk/content/api/user-guide.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -154,7 +154,18 @@ -

Users guide

+ +

Users guide

Work in progress @@ -166,14 +177,14 @@ Other pages are finished (but may be rev

This documentation is about the newly LDAP API developped at the Apache Software Foundation. We expect this API will be a replacement for all the ancient API (jLdap, Mozilla LDAP SDK and JNDI).

-

About this guide

+

About this guide

Getting started. Learn how to use the LDAP API, connect to various LDAP server, manipulate the data within your directory.

-

Audience

+

Audience

This guide is primarily for people new to the LDAP API. If you plan to use the API as is, maybe even for your first LDAP experience, you'll (hopefully) find all information necessary to do so. Only basic tasks are covered. Learn more about the options you have (and many other things) in the [Advanced User's Guide].

-

Feedback welcome!

+

Feedback welcome!

We are quite interested to improve the content of this guide. Feel free to provide us feedback: !email.png! mailto:users@directory.apache.org

-

Table of contents

+

Table of contents

  • 1 - Introduction

    Modified: websites/staging/directory/trunk/content/api/user-guide/1-introduction.html ============================================================================== --- websites/staging/directory/trunk/content/api/user-guide/1-introduction.html (original) +++ websites/staging/directory/trunk/content/api/user-guide/1-introduction.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -173,10 +173,21 @@ -

1 - Introduction

+ +

1 - Introduction

This User Guide goal is to provide some clue for any developer wanting to use the LDAP API. We have mixed some description of each important features with some tested snippet of code (all of them has been integrated as tests in the API code).

We hope it will be enough for you to quickly get started, but in any case, if you feel like improving this document, feel free to post your suggestion to the Apache Directory mailing list : any contribution is welcomed !

-

Contents

+

Contents

  • 1.1 - Java and LDAP
  • 1.2 - LDAP in a few words
  • Modified: websites/staging/directory/trunk/content/api/user-guide/1.1-java-and-ldap.html ============================================================================== --- websites/staging/directory/trunk/content/api/user-guide/1.1-java-and-ldap.html (original) +++ websites/staging/directory/trunk/content/api/user-guide/1.1-java-and-ldap.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -173,7 +173,18 @@ -

1.1 - Java and LDAP

+ +

1.1 - Java and LDAP

Most developer will, at some point, face the tricky task to communicate with a LDAP server. LDAP seems to be a very simple technology, but when you get deep into it, you realize that many aspects are not well known, and not so easy to deal with.

Java is most certainly the number one language used in the enterprise, for around 10 years now. Some even call it the new Cobol !

Those two facts make it necessary to be able to communicate with a LDAP server in Java. This is ware a convenient API is useful, and this is why we decided to provide this API.

Modified: websites/staging/directory/trunk/content/api/user-guide/1.2-ldap-in-a-few-words.html ============================================================================== --- websites/staging/directory/trunk/content/api/user-guide/1.2-ldap-in-a-few-words.html (original) +++ websites/staging/directory/trunk/content/api/user-guide/1.2-ldap-in-a-few-words.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -173,19 +173,30 @@ -

1.2 - LDAP in a few words

+ +

1.2 - LDAP in a few words

LDAP is not a new technlology. It has been around since mid 1990, as a way to mitigate the complexity of the X.500 based servers access. It's name is an acronym for Lightweight Directory Access Protocol. Soon after the first standard has been issued, the first full LDAP server was written (ie, X.500 was pushed out of the equation).

We will now use the term LDAP and LDAP server for respectively the protocole and the server.

-

Features

+

Features

A LDAP server provides access to entries, stored in a backend. It offers an interrogation mechanism allowing fast retrieval of entries. The data structure is hierarchical, and we use a schema to manage the content of entries, plus the organisation of data.

A LDAP client first has to connect to the server, and disconnect at the end. Some operations can be done on data, searches, modification and deletion, among a few others.

LDAP servers are extensible, but they all use a common protocol which makes it easy for users to request them. This API is an exemple of what LDAP is very good at : access data in a fast way, across servers.

-

Characteristics

+

Characteristics

LDAP servers are fast for retrievals : they have been designed for this purpose. On the other hand, modifications can be costly. This has to be understood when writing an application using a LDAP server as a backend.

Each entry is identified by it's position in the hierarchy, and we use what is called a Distinguished Name (or Dn) to describe this position in the tree. The base is also named the DIT, or Directory Information Tree.

-

Programming

+

Programming

Nowadays, LDAP is a part of the IT and it's difficult to avoid having to deal with it. LDAP servers are used to manage authentication, mainly, but also authorization, and more. It's very likely that you will have to write some code to access such a LDAP server, and the existing API are a bit cumbersome. This new LDAP API has been defined to facilitate this kind of tasks.

-

Going further

+

Going further

This was a very short introduction, you can find more literature about LDAP on the web : Wikipedia gives you a good starting point with many valid pointers.

Modified: websites/staging/directory/trunk/content/api/user-guide/1.3-apache-ldap-api-rational.html ============================================================================== --- websites/staging/directory/trunk/content/api/user-guide/1.3-apache-ldap-api-rational.html (original) +++ websites/staging/directory/trunk/content/api/user-guide/1.3-apache-ldap-api-rational.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
Downloads
Getting Started
@@ -173,7 +173,18 @@ -

1.3 - The Apache LDAP API rational

+ +

1.3 - The Apache LDAP API rational

Once we start to think about creating a new LDAP API, the first thing that comes to mind is that it could be a duplication of effort : there are already many libraries offering almost everything needed to write LDAP code. Some of them are :

  • JNDI : the default JDK API
  • @@ -182,7 +193,7 @@

So what makes the development of a new LDAP JAVA API a valid effort, and not another version of NIH syndrom ?

There are many reasons why we decided to start to work on such an API, and we will expose them in this chapter.

-

history

+

history

The Apache Directory Server project was first built on top of JNDI, but many of the internal LDAP structure were developed internally, just because JNDI was not designed specifically for LDAP, so it was not convenient for us to use those structure. Step by step, all of the LDAP objects (Attribute, Entry, DN, ...) were implemented again.

At some point, we needed to communicate with another LDAP server without having to go through JNDI, so we developed our own LdapConnection class. This was the last step toward a full Java API.

Strange enough, at the very same time in 2007, the Sun people working on OpenDS contacted us to know if we would agree to work on what would have become the next version of JNDI (Resurrecting The Java LDAP Centric API. Sadly, this effort soon staled, as it seemed that JNDI2 was not anymore an urgency for Sun. We decided to go on but the pace was slow.

@@ -194,7 +205,7 @@
  • An easy to use API
  • An API taking advantage of the new Java construction (generics, ellipsis, NIO)
  • -

    Result

    +

    Result

    The newly defined API fulfill all those aspects.

    We also wanted to make this API available for the masses. The Apache Software Foundation value quality and community over code, which means we think that the code is the result of a collaborative work, our users being a part of this collaboration. Every bug a user find, it's an opportunity to provide a better version of the API.

    At he end, we are proud to deliver an API which is used in the Apache Directory Server, but also in the Ldap Browser.

    Modified: websites/staging/directory/trunk/content/api/user-guide/1.4-preparation-to-code.html ============================================================================== --- websites/staging/directory/trunk/content/api/user-guide/1.4-preparation-to-code.html (original) +++ websites/staging/directory/trunk/content/api/user-guide/1.4-preparation-to-code.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
    Downloads
    Getting Started
    @@ -173,7 +173,18 @@ -

    1.4 - Preparation to code

    + +

    1.4 - Preparation to code

    In order to develop with the Apache Directory LDAP API, you first have to use a Java 6 JDK or higher.

    Second, you have to download the API. This package contains not only the LDAP API, but also all the needed jars (like commons-lang, slf4j...).

    If you are using Maven, you don't even have to refer all the libraries that are found in the package, they will be deduced automatically. You will just have to add a dependency on api-all.jar :

    Modified: websites/staging/directory/trunk/content/api/user-guide/2-basic-ldap-api-usage.html ============================================================================== --- websites/staging/directory/trunk/content/api/user-guide/2-basic-ldap-api-usage.html (original) +++ websites/staging/directory/trunk/content/api/user-guide/2-basic-ldap-api-usage.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
    Downloads
    Getting Started
    @@ -173,11 +173,22 @@ -

    2 - Basic LDAP API usage (...)

    + +

    2 - Basic LDAP API usage (...)

    We provide three different set of methods to send requests to the LDAP server : A first set which is the simplest, where the methods don't return a response, except the search and compare methods A second set, for advanced users, giving full control to the user * A third set allowing the user to send asynchronous requests.

    -

    Contents

    +

    Contents

    • 2.1 - Connection and disconnection
    • 2.2 - Binding and unbinding (...)
    • Modified: websites/staging/directory/trunk/content/api/user-guide/2.1-connection-disconnection.html ============================================================================== --- websites/staging/directory/trunk/content/api/user-guide/2.1-connection-disconnection.html (original) +++ websites/staging/directory/trunk/content/api/user-guide/2.1-connection-disconnection.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
    Downloads
    Getting Started
    @@ -173,18 +173,29 @@ -

    2.1 - Connection and disconnection

    + +

    2.1 - Connection and disconnection

    LDAP is a protocol which requires the user to be connected - and likely identified - in order to be able to send requests to the server. We maintain this connection potentially forever. What make the LDAP protocol different from, say, the HTTP protocol is that the connection must be issued explicitly. Let's see how we do that.

    -

    Opening a connection

    +

    Opening a connection

    We can open a secure or a standard connection.

    -

    Standard connection

    +

    Standard connection

    We can first establish a standard connection, where the data are sent and received in clear text (encoded in ASN.1 BER, but still not encrypted). This example expose the way it's done :

    LdapConnection connection = new LdapNetworkConnection( "localhost", 389 );
     

    Here, we just created an unsafe connection locally, using the 389 port. Quite simple...

    -

    Secure connection

    +

    Secure connection

    Although the LDAPS (LDAP over SSL) is now considered as deprecated, many people continue to use it. The big advantage of not using LDAPS is that you don't need to setup two different listening ports (one for LDAP -389- and another one for LDAPS -636- ).

    The only difference with the previous example is that we have to tell the connection that it has to use SSL, by passing true as a third parameter (incidentally, passing false set a unsafe connection).

    Here is an example

    @@ -192,7 +203,7 @@ -

    Maintaining the connection opened

    +

    Maintaining the connection opened

    We keep the connection opened for a limited period of time, defaulting to 30 seconds. This might be not long enough, so one can change this delay by calling the setTimeOut() method :

    LdapConnection connection = new LdapNetworkConnection( "localhost", 389 );
     connection.setTimeOut( 0 );
    @@ -204,7 +215,7 @@
     

    Note: Setting a value equal or below 0 will keep the connection opened for ever (or a soon as the connection is not explicitly closed).

    -

    Closing the connection

    +

    Closing the connection

    Once you don't need to use the connection anymore (remember that hodling a connection keeps a session opened on the server, and a socket opened between the client and the server), then you have to close it. This is done by calling the close() method :

    LdapConnection connection = new LdapNetworkConnection( "localhost", 389 );
     ...
    @@ -212,7 +223,7 @@
     
    -

    Using a pool of connections

    +

    Using a pool of connections

    Creating a connection is expensive. If you are to reuse a connection over and over, or if you are writing an application that will need many LDAP conenctions, you may want to use a pool of connections.

    This is slightly more complex than simply opening a new connection, as you have a lot of parametrs that can come into play when creating a pool. Here is an example of creation of a pool of connections :

    Modified: websites/staging/directory/trunk/content/api/user-guide/2.10-ldap-connection-template.html ============================================================================== --- websites/staging/directory/trunk/content/api/user-guide/2.10-ldap-connection-template.html (original) +++ websites/staging/directory/trunk/content/api/user-guide/2.10-ldap-connection-template.html Sun Jul 5 22:34:35 2015 @@ -104,7 +104,7 @@
    Downloads
    Getting Started
    @@ -173,7 +173,18 @@
    -

    2.10 - Why use the LdapConnectionTemplate?

    + +

    2.10 - Why use the LdapConnectionTemplate?

    The LdapConnectionTemplate provides simplified access to the API functions. It does so by

    The concept is basically that of the Template Method design pattern in that it does all the boiler plate work for you and hands back control as necessary.

    -

    Managing Connections

    +

    Managing Connections

    The connection template manages connections through a connection pool. The connection pool must be supplied to the constructor:

    LdapConnectionConfig config = new LdapConnectionConfig();
     config.setLdapHost( hostname );
    @@ -218,14 +229,14 @@
     
     
     

    This may look like a lot, but most of it is optional and it is the last you will have to think about connections.

    -

    Providing Factory Methods For Model Objects

    +

    Providing Factory Methods For Model Objects

    The connection template implements an interface called ModelFactory. Any implementation of this factory can be injected into the template once it is constructed. By default, it uses ModelFactoryImpl which in turn constructs the standard Apache LDAP API model objects. This abstractions frees you from having to be concerned with implementation details while still giving you the power to override the default behavior as you see fit.

    ModelFactory modelFactory = new MyCustomModelFactory();
     ldapConnectionTemplate.setModelFactory( modelFactory );
     
    -

    Providing CRUD Methods

    +

    Providing CRUD Methods

    The standard CRUD methods are provided (though in this case Add, Lookup, Modify, Delete) with a couple useful overloads. Add, Delete, and Modify all provide at least 2 approaches. The first is creating your own XxxRequest objects and supplying that to the method. These request objects can be created using the ModelFactory methods provided by LdapConnectionTemplate. The second, more elegant solution, is to use the DN and RequestBuilder approach. This approach will generate the request for you from the internal ModelFactory and provide it to a callback for you to fill in the details. This has the added benefit of translating any LdapException's that may occur (usually due to model implementation setter methods) to LdapRuntimeException, to remove the need for try/catch blocks. Now for some examples:

    Add provides the standard approaches of supplying your own AddRequest and using RequestBuilder, as well as a third shortcut approach where you supply all the attributes instead of a RequestBuilder:

    // using RequestBuilder
    @@ -299,7 +310,7 @@
     
     
     

    More information on EntryMapper can be found in the Handling Search Result Iteration section.

    -

    Handling Search Result Iteration

    +

    Handling Search Result Iteration

    Searching usually contains a lot of boiler plate code for build requests and iterating through responses. This template does the work for you. It iterates over the entire result set, feeds each entry through an EntryMapper, and collects the results into the list returned to the caller. All you have to do is provide the EntryMapper for mapping a single entry to a domain object. EntryMapper itself is a very simple interface with one method. As you saw before in the lookup documentation, they are typically defined as static members of your service classes:

    // typically mappers are reused, so define a static member
     private static final EntryMapper muppetEntryMapper =
    @@ -352,7 +363,7 @@
     
     
     

    This has the added benefit of ensuring that your search filter has been property encoded per RFC4515 section 3. For more information, see Filter Builder.

    -

    Providing Simplified, Password Policy Aware, Authentication/Password Modification Methods

    +

    Providing Simplified, Password Policy Aware, Authentication/Password Modification Methods

    One of the most common uses of LDAP is as an identity provider. As such, the most common operation is authentication, and password management. If your LDAP server supports the password policy control then the authenticate method is very handy:

    // throws PasswordException if authentication fails
     PasswordWarning warning = ldapConnectionTemplate.authenticate( 
    @@ -382,7 +393,7 @@
     
     
     

    If you modify the password as an administrator, then the oldPassword is not required, and if your password policy is set to, the password reset flag will be set causing a PasswordWarning to be returned the next time authenticate was called for that user.

    -

    Other Useful Methods

    +

    Other Useful Methods

    The template provides a method that will check the response and throw an exception if the request was not successful. It was designed to be chained:

    // using DN only
     DeleteResponse response = ldapConnectionTemplate.responseOrException(