From 5edd098f77ea5a4752bd68911147813a0875dc18 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 08 Aug 2016 08:05:17 +0000
Subject: [PATCH] ReplicationDomainMonitorData.java: move calls to setMaxCSNs() directly inside setRSState()

---
 opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java     |   14 ++------------
 opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitorData.java |    1 +
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java
index d826cca..48c3169 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitor.java
@@ -250,12 +250,7 @@
     // Then initialize the max CSN for the LS that produced something
     // - from our own local db state
     // - whatever they are directly or indirectly connected
-    final ServerState dbServerState = domain.getLatestServerState();
-    pendingMonitorData.setRSState(domain.getLocalRSServerId(), dbServerState);
-    for (CSN storedCSN : dbServerState)
-    {
-      pendingMonitorData.setMaxCSN(storedCSN);
-    }
+    pendingMonitorData.setRSState(domain.getLocalRSServerId(), domain.getLatestServerState());
   }
 
   /**
@@ -281,13 +276,8 @@
 
       try
       {
-        // Here is the RS state : list <serverID, lastCSN>
-        // For each LDAP Server, we keep the max CSN across the RSes
-        ServerState replServerDbState = msg.getReplServerDbState();
-        pendingMonitorData.setMaxCSNs(replServerDbState);
-
         // store the remote RS states.
-        pendingMonitorData.setRSState(msg.getSenderID(), replServerDbState);
+        pendingMonitorData.setRSState(msg.getSenderID(), msg.getReplServerDbState());
 
         // Store the remote LDAP servers states
         for (int dsServerId : toIterable(msg.ldapIterator()))
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitorData.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitorData.java
index 5403d15..bf99ed1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitorData.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationDomainMonitorData.java
@@ -325,6 +325,7 @@
   public void setRSState(int serverId, ServerState state)
   {
     rsStates.put(serverId, state);
+    setMaxCSNs(state);
   }
 
   /**

--
Gitblit v1.10.0