From 4936231f6b43a59233dc4ee909d9a2eeb3ced31a Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 08 Oct 2013 13:52:43 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB

---
 opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java |   47 +++++++++++++++++++++++++++++------------------
 1 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java b/opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java
index 8e5b22f..bc57fbe 100644
--- a/opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java
+++ b/opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java
@@ -26,8 +26,6 @@
  */
 package org.opends.server.replication.server.changelog.api;
 
-import java.util.Set;
-
 import org.opends.server.replication.common.CSN;
 import org.opends.server.replication.common.ServerState;
 import org.opends.server.replication.protocol.UpdateMsg;
@@ -41,16 +39,6 @@
 {
 
   /**
-   * Returns the serverIds for the servers that are or have been part of the
-   * provided replication domain.
-   *
-   * @param baseDN
-   *          the replication domain baseDN
-   * @return an unmodifiable set of integers holding the serverIds
-   */
-  Set<Integer> getDomainServerIds(DN baseDN);
-
-  /**
    * Get the number of changes for the specified replication domain.
    *
    * @param baseDN
@@ -171,8 +159,9 @@
   long getCount(DN baseDN, int serverId, CSN from, CSN to);
 
   /**
-   * Generates a {@link ReplicaDBCursor} for the specified serverId and
-   * replication domain starting after the provided CSN.
+   * Generates a {@link ReplicaDBCursor} across all the replicaDBs for the
+   * specified replication domain, with all cursors starting after the provided
+   * CSN.
    * <p>
    * The cursor is already advanced to the record after startAfterCSN.
    * <p>
@@ -182,13 +171,35 @@
    *
    * @param baseDN
    *          the replication domain baseDN
-   * @param serverId
-   *          Identifier of the server for which the cursor is created
    * @param startAfterCSN
-   *          Starting point for the cursor. If null, start from the oldest CSN
+   *          Starting point for each ReplicaDB cursor. If null, start from the
+   *          oldest CSN for each ReplicaDB cursor.
    * @return a non null {@link ReplicaDBCursor}
+   * @see #getCursorFrom(DN, ServerState)
    */
-  ReplicaDBCursor getCursorFrom(DN baseDN, int serverId, CSN startAfterCSN);
+  ReplicaDBCursor getCursorFrom(DN baseDN, CSN startAfterCSN);
+
+  /**
+   * Generates a {@link ReplicaDBCursor} across all the replicaDBs for the
+   * specified replication domain starting after the provided
+   * {@link ServerState} for each replicaDBs.
+   * <p>
+   * The cursor is already advanced to the records after the serverState.
+   * <p>
+   * When the cursor is not used anymore, client code MUST call the
+   * {@link ReplicaDBCursor#close()} method to free the resources and locks used
+   * by the cursor.
+   *
+   * @param baseDN
+   *          the replication domain baseDN
+   * @param startAfterServerState
+   *          Starting point for each ReplicaDB cursor. If any CSN for a
+   *          replicaDB is null, then start from the oldest CSN for this
+   *          replicaDB
+   * @return a non null {@link ReplicaDBCursor}
+   * @see #getCursorFrom(DN, CSN)
+   */
+  ReplicaDBCursor getCursorFrom(DN baseDN, ServerState startAfterServerState);
 
   /**
    * for the specified serverId and replication domain.

--
Gitblit v1.10.0