From d03f99a7c7ecd5f3e9e94f84c9b8a3b22d8f232a Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Sat, 05 Oct 2013 18:19:50 +0000
Subject: [PATCH] Reverted part of r9660 and all of r9661. I think it was invalid to think that we might want to call getCount() for a given serverId (hence replicaDB) by using the serverId from one of the CSNs. We can very well call getCount() with from and to CSNs that are not present on the targeted replicaDB.

---
 opends/src/server/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 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 e5c2285..d64a8a5 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
@@ -136,7 +136,8 @@
    * </ol>
    * <h6>Example</h6>
    * <p>
-   * Given the following replica database for baseDN "dc=example,dc=com":
+   * Given the following replica database for baseDN "dc=example,dc=com" and
+   * serverId 1:
    *
    * <pre>
    * CSN1  <=  Oldest
@@ -149,23 +150,25 @@
    * Then:
    *
    * <pre>
-   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, CSN1, CSN1), 1);
-   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, CSN1, CSN2), 2);
-   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, CSN1, CSN5), 5);
-   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, null, CSN5), 5);
-   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, CSN1, null), 0);
-   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, null, null), 5);
+   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, CSN1, CSN1), 1);
+   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, CSN1, CSN2), 2);
+   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, CSN1, CSN5), 5);
+   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, null, CSN5), 5);
+   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, CSN1, null), 0);
+   * assertEquals(getCount(&quot;dc=example,dc=com&quot;, 1, null, null), 5);
    * </pre>
    *
    * @param baseDN
    *          the replication domain baseDN
+   * @param serverId
+   *          the serverId on which to act
    * @param from
    *          The older CSN where to start the count
    * @param to
    *          The newer CSN where to end the count
    * @return The computed number of changes
    */
-  long getCount(DN baseDN, CSN from, CSN to);
+  long getCount(DN baseDN, int serverId, CSN from, CSN to);
 
   /**
    * Returns the {@link CSN} situated immediately after the specified

--
Gitblit v1.10.0