From f9fc57cba81bcf9a8259a8ea699eb999c0415397 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 21 Aug 2013 13:26:47 +0000
Subject: [PATCH] Extracted ReplicationDomainMonitor class out of ReplicationServerDomain to increase its cohesion.

---
 opends/src/server/org/opends/server/replication/server/MonitoringPublisher.java |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/MonitoringPublisher.java b/opends/src/server/org/opends/server/replication/server/MonitoringPublisher.java
index 1a5e7bf..5993812 100644
--- a/opends/src/server/org/opends/server/replication/server/MonitoringPublisher.java
+++ b/opends/src/server/org/opends/server/replication/server/MonitoringPublisher.java
@@ -54,8 +54,8 @@
    */
   private static final DebugTracer TRACER = getTracer();
 
-  /** The domain we send monitoring for. */
-  private final ReplicationServerDomain replicationServerDomain;
+  /** The replication domain we send monitoring for. */
+  private final ReplicationServerDomain domain;
 
   /** Sleep time (in ms) before sending new monitoring messages. */
   private volatile long period;
@@ -79,7 +79,7 @@
         + ") monitor publisher for domain \""
         + replicationServerDomain.getBaseDn() + "\"");
 
-    this.replicationServerDomain = replicationServerDomain;
+    this.domain = replicationServerDomain;
     this.period = period;
   }
 
@@ -107,15 +107,10 @@
         }
 
         // Send global topology information to peer DSs
-        MonitorData monitorData = replicationServerDomain
-            .computeDomainMonitorData();
+        MonitorMsg monitorMsg = domain.createGlobalTopologyMonitorMsg(0, 0);
+        final int localServerId = domain.getLocalRSServerId();
 
-        MonitorMsg monitorMsg = replicationServerDomain
-            .createGlobalTopologyMonitorMsg(0, 0, monitorData);
-
-        int localServerId = replicationServerDomain.getLocalRSServerId();
-        for (ServerHandler serverHandler : replicationServerDomain
-            .getConnectedDSs().values())
+        for (ServerHandler serverHandler : domain.getConnectedDSs().values())
         {
           // Set the right sender and destination ids
           monitorMsg.setSenderID(localServerId);
@@ -203,8 +198,7 @@
 
   private String getMessage(String message)
   {
-    return "In RS " + replicationServerDomain.getLocalRSServerId()
-        + ", for base dn " + replicationServerDomain.getBaseDn() + ": "
-        + message;
+    return "In RS " + domain.getLocalRSServerId() + ", for base dn "
+        + domain.getBaseDn() + ": " + message;
   }
 }

--
Gitblit v1.10.0