From 528a453c5d271bdf9ef7a7174219950492e5edb6 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 14 Jul 2009 00:27:29 +0000
Subject: [PATCH] Follow up to fix for issue 4092 (dsreplication should allow to configure servers with no replication server and servers with only a replication server)

---
 opendj-sdk/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java |   68 ----------------------------------
 1 files changed, 0 insertions(+), 68 deletions(-)

diff --git a/opendj-sdk/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java b/opendj-sdk/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java
index c4e0596..190d488 100644
--- a/opendj-sdk/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java
+++ b/opendj-sdk/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java
@@ -1009,7 +1009,6 @@
   throws NamingException
   {
     boolean replicationEnabled = false;
-    boolean oneDomainReplicated = false;
     SearchControls ctls = new SearchControls();
     ctls.setSearchScope(SearchControls.OBJECT_SCOPE);
     ctls.setReturningAttributes(
@@ -1071,7 +1070,6 @@
           Set<String> replicationServers = getValues(sr,
           "ds-cfg-replication-server");
           Set<String> dns = getValues(sr, "ds-cfg-base-dn");
-          oneDomainReplicated = dns.size() > 0;
           for (String dn : dns)
           {
             for (ReplicaDescriptor replica : desc.getReplicas())
@@ -1145,72 +1143,6 @@
       /* ignore */
     }
 
-    if (cacheFilter.searchMonitoringInformation())
-    {
-      ctls = new SearchControls();
-      ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
-      ctls.setReturningAttributes(
-          new String[] {
-              "approx-older-change-not-synchronized-millis", "missing-changes",
-              "domain-name", "server-id"
-          });
-      filter = "(missing-changes=*)";
-
-      jndiName = new LdapName("cn=monitor");
-
-      if (oneDomainReplicated)
-      {
-        try
-        {
-          NamingEnumeration monitorEntries = ctx.search(jndiName, filter, ctls);
-
-          while(monitorEntries.hasMore())
-          {
-            SearchResult sr = (SearchResult)monitorEntries.next();
-
-            String dn = getFirstValue(sr, "domain-name");
-            int replicaId = -1;
-            try
-            {
-              replicaId = new Integer(getFirstValue(sr, "server-id"));
-            }
-            catch (Throwable t)
-            {
-            }
-
-            for (ReplicaDescriptor replica: desc.getReplicas())
-            {
-              if (Utils.areDnsEqual(dn, replica.getSuffix().getDN()) &&
-                  replica.isReplicated() &&
-                  (replica.getReplicationId() == replicaId))
-              {
-                try
-                {
-                  replica.setAgeOfOldestMissingChange(
-                      new Long(getFirstValue(sr,
-                      "approx-older-change-not-synchronized-millis")));
-                }
-                catch (Throwable t)
-                {
-                }
-                try
-                {
-                  replica.setMissingChanges(
-                      new Integer(getFirstValue(sr, "missing-changes")));
-                }
-                catch (Throwable t)
-                {
-                }
-              }
-            }
-          }
-        }
-        catch (NameNotFoundException nse)
-        {
-        }
-      }
-    }
-
     boolean replicationSecure = false;
     if (replicationEnabled)
     {

--
Gitblit v1.10.0