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/ModifyCommonMsg.java | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/protocol/ModifyCommonMsg.java b/opends/src/server/org/opends/server/replication/protocol/ModifyCommonMsg.java
index 70f9fef..6033fa2 100644
--- a/opends/src/server/org/opends/server/replication/protocol/ModifyCommonMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/ModifyCommonMsg.java
@@ -66,7 +66,7 @@
* @param dn The DN of the entry on which the change
* that caused the creation of this object happened
*/
- public ModifyCommonMsg(OperationContext ctx, String dn)
+ public ModifyCommonMsg(OperationContext ctx, DN dn)
{
super(ctx, dn);
}
@@ -81,7 +81,7 @@
* @param dn The DN of the entry on which the change
* that caused the creation of this object happened
*/
- public ModifyCommonMsg(CSN csn, String entryUUID, String dn)
+ public ModifyCommonMsg(CSN csn, String entryUUID, DN dn)
{
super(csn, entryUUID, dn);
}
@@ -104,14 +104,7 @@
*/
public List<Modification> getMods() throws ASN1Exception, LDAPException
{
- List<Modification> mods = new ArrayList<Modification>();
-
- ASN1Reader reader = ASN1.getReader(encodedMods);
-
- while (reader.hasNextElement())
- mods.add((LDAPModification.decode(reader)).toModification());
-
- return mods;
+ return decodeMods(encodedMods);
}
// ============
@@ -175,8 +168,8 @@
* @throws LDAPException when occurs.
* @return The decoded mods.
*/
- protected List<Modification> decodeMods(byte[] in)
- throws ASN1Exception, LDAPException
+ protected List<Modification> decodeMods(byte[] in) throws ASN1Exception,
+ LDAPException
{
List<Modification> mods = new ArrayList<Modification>();
ASN1Reader reader = ASN1.getReader(in);
@@ -194,10 +187,10 @@
* @throws ASN1Exception when occurs.
* @throws LDAPException when occurs.
*/
- protected ArrayList<RawModification> decodeRawMods(byte[] in)
- throws LDAPException, ASN1Exception
+ protected List<RawModification> decodeRawMods(byte[] in)
+ throws LDAPException, ASN1Exception
{
- ArrayList<RawModification> ldapmods = new ArrayList<RawModification>();
+ List<RawModification> ldapmods = new ArrayList<RawModification>();
ASN1Reader asn1Reader = ASN1.getReader(in);
while(asn1Reader.hasNextElement())
{
--
Gitblit v1.10.0