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/PreReadRequestControl.java | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/controls/PreReadRequestControl.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/controls/PreReadRequestControl.java index 51653cc..bc00844 100644 --- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/controls/PreReadRequestControl.java +++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/controls/PreReadRequestControl.java @@ -55,6 +55,25 @@ * client to read the target entry of an update operation immediately before the * modifications are applied. These reads are done as an atomic part of the * update operation. + * <p> + * The following example gets the entry as it was before the modify operation. + * + * <pre> + * Connection connection = ...; + * String DN = ...; + * + * ModifyRequest request = + * Requests.newModifyRequest(DN) + * .addControl(PreReadRequestControl.newControl(true, "mail")) + * .addModification(ModificationType.REPLACE, + * "mail", "modified@example.com"); + * + * Result result = connection.modify(request); + * PreReadResponseControl control = + * result.getControl(PreReadResponseControl.DECODER, + * new DecodeOptions()); + * Entry unmodifiedEntry = control.getEntry(); + * </pre> * * @see PreReadResponseControl * @see <a href="http://tools.ietf.org/html/rfc4527">RFC 4527 - Lightweight -- Gitblit v1.10.0