From 19772d267299ace5f85c6fc6ae9b1edc5f6a9c60 Mon Sep 17 00:00:00 2001
From: Mark Craig <mark.craig@forgerock.com>
Date: Wed, 02 May 2012 16:18:53 +0000
Subject: [PATCH] Start adding content to the chapter on LDAP controls

---
 opendj3/src/main/docbkx/dev-guide/chap-controls.xml |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/opendj3/src/main/docbkx/dev-guide/chap-controls.xml b/opendj3/src/main/docbkx/dev-guide/chap-controls.xml
index d38b25b..add663c 100644
--- a/opendj3/src/main/docbkx/dev-guide/chap-controls.xml
+++ b/opendj3/src/main/docbkx/dev-guide/chap-controls.xml
@@ -114,7 +114,37 @@
  
  <section xml:id="use-assertion-request-control">
   <title>Assertion Request Control</title>
-  <para>TODO</para>
+
+  <para>The <link xlink:href="http://tools.ietf.org/html/rfc4528"
+  xlink:show="new" >LDAP assertion control</link> lets you specify a condition
+  that must be true in order for the operation you request to be processed
+  normally. The following excerpt shows, for example, how you might check
+  that no description exists on the entry before adding your description.</para>
+
+  <programlisting language="java">
+if (isSupported(AssertionRequestControl.OID)) {
+    // Modify Babs Jensen's description if her entry does not have
+    // a description, yet.
+    String dn = "uid=bjensen,ou=People,dc=example,dc=com";
+
+    ModifyRequest request = Requests.newModifyRequest(dn);
+    request.addControl(AssertionRequestControl.newControl(true,
+            Filter.valueOf("!(description=*)")));
+    request.addModification(ModificationType.ADD, "description",
+            "Created with the help of the LDAP assertion control");
+
+    connection.modify(request);
+
+    LDIFEntryWriter writer = new LDIFEntryWriter(System.out);
+    try {
+        writer.writeEntry(connection.readEntry(dn, "description"));
+        writer.close();
+    } catch (final IOException e) {
+        // Ignore.
+    }
+}</programlisting>
+
+  <para>OpenDJ directory server supports the LDAP assertion control.</para>
  </section>
  
  <section xml:id="use-authorization-identity-control">

--
Gitblit v1.10.0