From 377b2709c64b32fe93905b466482216c2cc0581c Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 19 Mar 2014 16:30:32 +0000
Subject: [PATCH] OPENDJ-1368 (CR-3232) Remove AttributeValue

---
 opendj3-server-dev/src/server/org/opends/server/loggers/TextAuditLogPublisher.java |   44 ++++++++++++++++++--------------------------
 1 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/loggers/TextAuditLogPublisher.java b/opendj3-server-dev/src/server/org/opends/server/loggers/TextAuditLogPublisher.java
index 3266890..66e3e09 100644
--- a/opendj3-server-dev/src/server/org/opends/server/loggers/TextAuditLogPublisher.java
+++ b/opendj3-server-dev/src/server/org/opends/server/loggers/TextAuditLogPublisher.java
@@ -26,8 +26,6 @@
  */
 package org.opends.server.loggers;
 
-
-
 import static org.opends.messages.ConfigMessages.*;
 import static org.forgerock.opendj.ldap.ResultCode.*;
 import static org.opends.server.util.ServerConstants.*;
@@ -44,14 +42,13 @@
 import org.forgerock.opendj.config.server.ConfigException;
 import org.opends.server.core.*;
 import org.opends.server.types.*;
-import org.forgerock.opendj.ldap.ResultCode;
 import org.forgerock.opendj.ldap.ByteSequence;
+import org.forgerock.opendj.ldap.ByteString;
+import org.forgerock.opendj.ldap.ResultCode;
 import org.opends.server.util.Base64;
 import org.opends.server.util.StaticUtils;
 import org.opends.server.util.TimeThread;
 
-
-
 /**
  * This class provides the implementation of the audit logger used by
  * the directory server.
@@ -323,13 +320,7 @@
     {
       for (Attribute a : attrList)
       {
-        for (AttributeValue v : a)
-        {
-          buffer.append(a.getName());
-          buffer.append(":");
-          encodeValue(v.getValue(), buffer);
-          buffer.append(EOL);
-        }
+        append(buffer, a);
       }
     }
 
@@ -338,13 +329,7 @@
     {
       for (Attribute a : attrList)
       {
-        for (AttributeValue v : a)
-        {
-          buffer.append(a.getName());
-          buffer.append(":");
-          encodeValue(v.getValue(), buffer);
-          buffer.append(EOL);
-        }
+        append(buffer, a);
       }
     }
 
@@ -484,13 +469,7 @@
       buffer.append(a.getName());
       buffer.append(EOL);
 
-      for (AttributeValue v : a)
-      {
-        buffer.append(a.getName());
-        buffer.append(":");
-        encodeValue(v.getValue(), buffer);
-        buffer.append(EOL);
-      }
+      append(buffer, a);
     }
 
     writer.writeRecord(buffer.toString());
@@ -498,6 +477,19 @@
 
 
 
+  private void append(StringBuilder buffer, Attribute a)
+  {
+    for (ByteString v : a)
+    {
+      buffer.append(a.getName());
+      buffer.append(":");
+      encodeValue(v, buffer);
+      buffer.append(EOL);
+    }
+  }
+
+
+
   // Appends the common log header information to the provided buffer.
   private void appendHeader(Operation operation, StringBuilder buffer)
   {

--
Gitblit v1.10.0