From cc33fc8953d90663d5678b396576ac9f90f4995b Mon Sep 17 00:00:00 2001
From: Mark Craig <mark.craig@forgerock.com>
Date: Mon, 21 May 2012 15:24:17 +0000
Subject: [PATCH] Align with r8013

---
 opendj3/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.java |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.java b/opendj3/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.java
index efe6a66..c9e716e 100644
--- a/opendj3/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.java
+++ b/opendj3/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/RewriterProxy.java
@@ -36,6 +36,7 @@
 
 import org.forgerock.opendj.ldap.Attribute;
 import org.forgerock.opendj.ldap.AttributeDescription;
+import org.forgerock.opendj.ldap.Attributes;
 import org.forgerock.opendj.ldap.Connection;
 import org.forgerock.opendj.ldap.ConnectionFactory;
 import org.forgerock.opendj.ldap.Connections;
@@ -47,7 +48,6 @@
 import org.forgerock.opendj.ldap.LDAPConnectionFactory;
 import org.forgerock.opendj.ldap.LDAPListener;
 import org.forgerock.opendj.ldap.LDAPListenerOptions;
-import org.forgerock.opendj.ldap.LinkedAttribute;
 import org.forgerock.opendj.ldap.Modification;
 import org.forgerock.opendj.ldap.RequestContext;
 import org.forgerock.opendj.ldap.RequestHandler;
@@ -101,8 +101,6 @@
  * <li>It does not touch matched DNs in results.
  * <li>It does not rewrite attributes with options in search result entries.
  * <li>It does not touch search result references.
- * <li>It does not rewrite LDAP Controls or Extended Operations, except to
- * rewrite the DN used as authorization ID for proxied authorization.
  * </ul>
  * This example takes the following command line parameters:
  *
@@ -221,7 +219,7 @@
                                         .replaceFirst(
                                                 serverAttributeTypeName,
                                                 clientAttributeTypeName));
-                        attrsToAdd.add(new LinkedAttribute(clientAttrDesc, a.toArray()));
+                        attrsToAdd.add(Attributes.renameAttribute(a, clientAttrDesc));
                         attrsToRemove.add(ad);
                     }
                 }
@@ -288,9 +286,9 @@
                                             .getAttributeDescriptionAsString()
                                             .replaceFirst(clientAttributeTypeName,
                                                           serverAttributeTypeName);
-                                    Attribute serverAttr = new LinkedAttribute(
-                                            AttributeDescription.valueOf(ad),
-                                            a.toArray());
+                                    Attribute serverAttr =
+                                            Attributes.renameAttribute(a,
+                                                    AttributeDescription.valueOf(ad));
                                     rewrittenRequest.addAttribute(serverAttr);
                                     rewrittenRequest.removeAttribute(
                                             a.getAttributeDescription());
@@ -521,8 +519,7 @@
                                                             serverAttributeTypeName));
                                     rewrittenRequest.addModification(new Modification(
                                             mod.getModificationType(),
-                                            new LinkedAttribute(
-                                                    serverAttrDesc, a.toArray())));
+                                            Attributes.renameAttribute(a, serverAttrDesc)));
                                 } else {
                                     rewrittenRequest.addModification(mod);
                                 }

--
Gitblit v1.10.0