From 9c8493a28711aff83940445f42f923c587eea4f8 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 02 Sep 2013 14:57:25 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB
---
opends/src/server/org/opends/server/replication/plugin/PendingChange.java | 35 ++++++++++++++++-------------------
1 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/plugin/PendingChange.java b/opends/src/server/org/opends/server/replication/plugin/PendingChange.java
index b6e3e37..b261419 100644
--- a/opends/src/server/org/opends/server/replication/plugin/PendingChange.java
+++ b/opends/src/server/org/opends/server/replication/plugin/PendingChange.java
@@ -40,7 +40,7 @@
*/
public class PendingChange implements Comparable<PendingChange>
{
- private CSN changeNumber;
+ private CSN csn;
private boolean committed;
private LDAPUpdateMsg msg;
private PluginOperation op;
@@ -49,15 +49,13 @@
/**
* Construct a new PendingChange.
- * @param changeNumber the ChangeNumber of use
+ * @param csn the CSN of use
* @param op the operation to use
* @param msg the message to use (can be null for local operations)
*/
- public PendingChange(CSN changeNumber,
- PluginOperation op,
- LDAPUpdateMsg msg)
+ public PendingChange(CSN csn, PluginOperation op, LDAPUpdateMsg msg)
{
- this.changeNumber = changeNumber;
+ this.csn = csn;
this.committed = false;
this.op = op;
this.msg = msg;
@@ -82,12 +80,12 @@
}
/**
- * Get the ChangeNumber associated to this PendingChange.
- * @return the ChangeNumber
+ * Get the CSN associated to this PendingChange.
+ * @return the CSN
*/
public CSN getCSN()
{
- return changeNumber;
+ return csn;
}
/**
@@ -167,16 +165,15 @@
synchronized (this)
{
if (targetDN != null)
- return targetDN;
- else
{
- try
- {
- targetDN = DN.decode(msg.getDn());
- }
- catch (DirectoryException e)
- {
- }
+ return targetDN;
+ }
+ try
+ {
+ targetDN = DN.decode(msg.getDn());
+ }
+ catch (DirectoryException e)
+ {
}
return targetDN;
}
@@ -188,6 +185,6 @@
@Override
public int compareTo(PendingChange o)
{
- return this.getCSN().compareTo(o.getCSN());
+ return getCSN().compareTo(o.getCSN());
}
}
--
Gitblit v1.10.0