From 174074dccd4a4731728bfb274ed982534c45fde1 Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Tue, 19 Aug 2014 10:06:35 +0000
Subject: [PATCH] Forward port of checkpoint commit for OPENDJ-1206 : Create a new ReplicationBackend/ChangelogBackend   to support cn=changelog CR-4053

---
 opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/DomainDBCursor.java |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/DomainDBCursor.java b/opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/DomainDBCursor.java
index c249a78..26c40f7 100644
--- a/opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/DomainDBCursor.java
+++ b/opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/DomainDBCursor.java
@@ -54,6 +54,8 @@
    */
   private static final CSN NULL_CSN = new CSN(0, 0, 0);
 
+  private final PositionStrategy positionStrategy;
+
   /**
    * Builds a DomainDBCursor instance.
    *
@@ -61,11 +63,15 @@
    *          the replication domain baseDN of this cursor
    * @param domainDB
    *          the DB for the provided replication domain
+   * @param positionStrategy
+   *          Cursor position strategy, which allow to indicates at which
+   *          exact position the cursor must start
    */
-  public DomainDBCursor(DN baseDN, ReplicationDomainDB domainDB)
+  public DomainDBCursor(DN baseDN, ReplicationDomainDB domainDB, PositionStrategy positionStrategy)
   {
     this.baseDN = baseDN;
     this.domainDB = domainDB;
+    this.positionStrategy = positionStrategy;
   }
 
   /**
@@ -102,8 +108,9 @@
       final Entry<Integer, CSN> pair = iter.next();
       final int serverId = pair.getKey();
       final CSN csn = pair.getValue();
-      final CSN startAfterCSN = !NULL_CSN.equals(csn) ? csn : null;
-      final DBCursor<UpdateMsg> cursor = domainDB.getCursorFrom(baseDN, serverId, startAfterCSN);
+      final CSN startCSN = !NULL_CSN.equals(csn) ? csn : null;
+      final DBCursor<UpdateMsg> cursor =
+          domainDB.getCursorFrom(baseDN, serverId, startCSN, positionStrategy);
       addCursor(cursor, null);
       iter.remove();
     }

--
Gitblit v1.10.0