From a7bbfd0cece1181f052437f06f8201a19a590a69 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 14 Jul 2009 13:23:16 +0000
Subject: [PATCH] Store the exception when reading replication monitoring information at the server descriptor level and not at the TopologyCache object level.

---
 opendj-sdk/opends/src/ads/org/opends/admin/ads/TopologyCache.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/opendj-sdk/opends/src/ads/org/opends/admin/ads/TopologyCache.java b/opendj-sdk/opends/src/ads/org/opends/admin/ads/TopologyCache.java
index 91900b7..1f2045d 100644
--- a/opendj-sdk/opends/src/ads/org/opends/admin/ads/TopologyCache.java
+++ b/opendj-sdk/opends/src/ads/org/opends/admin/ads/TopologyCache.java
@@ -196,7 +196,7 @@
    * @throws NamingException if an error occurs reading the replication
    * monitoring.
    */
-  private void readReplicationMonitoring() throws NamingException
+  private void readReplicationMonitoring()
   {
     Set<ReplicaDescriptor> replicasToUpdate = new HashSet<ReplicaDescriptor>();
     for (ServerDescriptor server : getServers())
@@ -213,6 +213,9 @@
     {
       if (server.isReplicationServer())
       {
+        // If is replication server, then at least we were able to read the
+        // configuration, so assume that we might be able to read monitoring
+        // (even if an exception occurred before).
         Set<ReplicaDescriptor> candidateReplicas =
           new HashSet<ReplicaDescriptor>();
         // It contains replication information: analyze it.
@@ -233,7 +236,15 @@
         {
           Set<ReplicaDescriptor> updatedReplicas =
             new HashSet<ReplicaDescriptor>();
-          updateReplicas(server, candidateReplicas, updatedReplicas);
+          try
+          {
+            updateReplicas(server, candidateReplicas, updatedReplicas);
+          }
+          catch (NamingException ne)
+          {
+            server.setLastException(new TopologyCacheException(
+                TopologyCacheException.Type.GENERIC_READING_SERVER, ne));
+          }
           replicasToUpdate.removeAll(updatedReplicas);
         }
       }

--
Gitblit v1.10.0