From 36191b70a96c298ad07cf9a9384cc42764ea957e Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Wed, 22 Apr 2009 06:22:39 +0000
Subject: [PATCH] The replication publish information about the whole topology in cn=monitor When cn=monitor is searched, the replication therefore asks informations about the replication state to all Replication Servers. This should always be fast unless a server is hanged. In such case the replication waits for 5 seconds then issue an error message and goes on with the information it has received at this time.

---
 opends/src/server/org/opends/server/replication/server/ServerHandler.java |   32 ++++++++++++++++++++++++--------
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/ServerHandler.java b/opends/src/server/org/opends/server/replication/server/ServerHandler.java
index 081cba3..b6c4e3d 100644
--- a/opends/src/server/org/opends/server/replication/server/ServerHandler.java
+++ b/opends/src/server/org/opends/server/replication/server/ServerHandler.java
@@ -2064,6 +2064,18 @@
         long delay = md.getApproxDelay(serverId);
         attributes.add(Attributes.create("approximate-delay", String
             .valueOf(delay)));
+
+        /* get the Server State */
+        AttributeBuilder builder = new AttributeBuilder("server-state");
+        ServerState state = md.getLDAPServerState(serverId);
+        if (state != null)
+        {
+          for (String str : state.toStringSet())
+          {
+            builder.add(str);
+          }
+          attributes.add(builder.toAttribute());
+        }
       }
       else
       {
@@ -2071,6 +2083,18 @@
         long missingChanges = md.getMissingChangesRS(serverId);
         attributes.add(Attributes.create("missing-changes", String
             .valueOf(missingChanges)));
+
+        /* get the Server State */
+        AttributeBuilder builder = new AttributeBuilder("server-state");
+        ServerState state = md.getRSStates(serverId);
+        if (state != null)
+        {
+          for (String str : state.toStringSet())
+          {
+            builder.add(str);
+          }
+          attributes.add(builder.toAttribute());
+        }
       }
     }
     catch (Exception e)
@@ -2131,14 +2155,6 @@
     attributes.add(Attributes.create("current-rcv-window", String
         .valueOf(rcvWindow)));
 
-    /* get the Server State */
-    AttributeBuilder builder = new AttributeBuilder("server-state");
-    for (String str : serverState.toStringSet())
-    {
-      builder.add(str);
-    }
-    attributes.add(builder.toAttribute());
-
     // Encryption
     attributes.add(Attributes.create("ssl-encryption", String
         .valueOf(session.isEncrypted())));

--
Gitblit v1.10.0