From 1e74b0f8f046cc9e69ba9eddbc180bf10ab83e06 Mon Sep 17 00:00:00 2001
From: Mark Craig <mark.craig@forgerock.com>
Date: Thu, 20 Sep 2012 16:58:20 +0000
Subject: [PATCH] CR-701 Fix for OPENDJ-596: Include more examples in LDAP SDK Javadoc

---
 opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/controls/Control.java |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/controls/Control.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/controls/Control.java
index 4a021ef..ea035f3 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/controls/Control.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/controls/Control.java
@@ -33,6 +33,22 @@
  * single LDAP message. A control only affects the semantics of the message it
  * is attached to. Controls sent by clients are termed 'request controls', and
  * those sent by servers are termed 'response controls'.
+ * <p>
+ * To determine whether a directory server supports a given control, read the
+ * list of supported controls from the root DSE to get a collection of control
+ * OIDs, and then check for a match:
+ *
+ * <pre>
+ * Connection connection = ...;
+ * Collection&lt;String&gt; supported =
+ *     RootDSE.readRootDSE(connection).getSupportedControls();
+ *
+ * Control control = ...;
+ * String OID = control.getOID();
+ * if (supported != null && !supported.isEmpty() && supported.contains(OID)) {
+ *     // The control is supported. Use it here...
+ * }
+ * </pre>
  *
  * @see <a href="http://tools.ietf.org/html/rfc4511">RFC 4511 - Lightweight
  *      Directory Access Protocol (LDAP): The Protocol </a>

--
Gitblit v1.10.0