From dfbe880eb338a1d752ce790f689b5133761d7079 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 26 Sep 2013 07:35:55 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB

---
 opends/src/server/org/opends/server/replication/protocol/AddMsg.java |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/protocol/AddMsg.java b/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
index b63a095..c6ea471 100644
--- a/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
@@ -28,12 +28,12 @@
 package org.opends.server.replication.protocol;
 
 import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.zip.DataFormatException;
 
+import org.opends.server.core.AddOperation;
 import org.opends.server.core.AddOperationBasis;
 import org.opends.server.core.DirectoryServer;
 import org.opends.server.protocols.asn1.ASN1;
@@ -67,8 +67,7 @@
    */
   public AddMsg(PostOperationAddOperation op)
   {
-    super((AddContext) op.getAttachment(SYNCHROCONTEXT),
-          op.getRawEntryDN().toString());
+    super((AddContext) op.getAttachment(SYNCHROCONTEXT), op.getEntryDN());
 
     AddContext ctx = (AddContext) op.getAttachment(SYNCHROCONTEXT);
 
@@ -93,7 +92,7 @@
    * @param operationalAttributes operational attributes of the added entry.
    */
   public AddMsg(CSN csn,
-                String dn,
+                DN dn,
                 String entryUUID,
                 String parentEntryUUID,
                 Map<ObjectClass, String> objectClasses,
@@ -123,7 +122,7 @@
    * @param operationalAttributes operational attributes of the added entry.
    */
   public AddMsg(CSN csn,
-                String dn,
+                DN dn,
                 String uniqueId,
                 String parentId,
                 Attribute objectClass,
@@ -172,16 +171,16 @@
    * {@inheritDoc}
    */
   @Override
-  public AddOperationBasis createOperation(
-      InternalClientConnection connection, String newDn)
+  public AddOperation createOperation(
+      InternalClientConnection connection, DN newDN)
   throws LDAPException, ASN1Exception
   {
-    ArrayList<RawAttribute> attr = decodeRawAttributes(encodedAttributes);
+    List<RawAttribute> attr = decodeRawAttributes(encodedAttributes);
 
-    AddOperationBasis add =  new AddOperationBasis(connection,
+    AddOperation add =  new AddOperationBasis(connection,
         InternalClientConnection.nextOperationID(),
         InternalClientConnection.nextMessageID(), null,
-        ByteString.valueOf(newDn), attr);
+        ByteString.valueOf(newDN.toString()), attr);
     AddContext ctx = new AddContext(getCSN(), getEntryUUID(),
         parentEntryUUID);
     add.setAttachment(SYNCHROCONTEXT, ctx);
@@ -579,8 +578,7 @@
   @Override
   public int size()
   {
-    return encodedAttributes.length + + encodedEclIncludes.length
-      + headerSize();
+    return encodedAttributes.length + encodedEclIncludes.length + headerSize();
   }
 
 }

--
Gitblit v1.10.0