From 40483c36210b8a0682a9dd400f0419d11b76483e Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Tue, 10 Mar 2009 08:56:32 +0000
Subject: [PATCH] fix for 3804 : improve replication monitoring

---
 opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReSyncTest.java                          |    6 
 opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java                 |    2 
 opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/AssuredReplicationServerTest.java |   26 ++--
 opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationMonitor.java                                  |    7 
 opendj-sdk/opends/src/server/org/opends/server/replication/server/ServerHandler.java                                        |   17 +-
 opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java                              |   89 ++++++++++++++
 opendj-sdk/opends/src/server/org/opends/server/replication/server/LightweightServerHandler.java                             |   12 +-
 opendj-sdk/opends/src/server/org/opends/server/replication/server/DbHandler.java                                            |    7 
 opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java                                    |  112 +++---------------
 opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/TopologyViewTest.java             |    4 
 opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/service/ReplicationDomainTest.java       |   10 
 opendj-sdk/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java                                                        |    6 
 opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java |    2 
 opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java                                   |    6 
 14 files changed, 161 insertions(+), 145 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 16b72a8..d8d1a53 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
@@ -1102,11 +1102,11 @@
     if (cacheFilter.searchMonitoringInformation())
     {
       ctls = new SearchControls();
-      ctls.setSearchScope(SearchControls.ONELEVEL_SCOPE);
+      ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
       ctls.setReturningAttributes(
           new String[] {
               "approx-older-change-not-synchronized-millis", "missing-changes",
-              "base-dn", "server-id"
+              "domain-name", "server-id"
           });
       filter = "(missing-changes=*)";
 
@@ -1122,7 +1122,7 @@
           {
             SearchResult sr = (SearchResult)monitorEntries.next();
 
-            String dn = getFirstValue(sr, "base-dn");
+            String dn = getFirstValue(sr, "domain-name");
             int replicaId = -1;
             try
             {
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/DbHandler.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/DbHandler.java
index 27a909b..ac7f7dd 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/DbHandler.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/DbHandler.java
@@ -579,8 +579,11 @@
     @Override
     public String getMonitorInstanceName()
     {
-      return "ReplicationServer database " + baseDn.toString() +
-             " " + String.valueOf(serverId);
+      ReplicationServerDomain domain =
+        replicationServer.getReplicationServerDomain(baseDn, false);
+
+      return "ReplicationServer database " + String.valueOf(serverId) +
+             ",cn=" + domain.getMonitorInstanceName();
     }
 
     /**
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/LightweightServerHandler.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/LightweightServerHandler.java
index ccbf43f..b4634fc 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/LightweightServerHandler.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/LightweightServerHandler.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2008 Sun Microsystems, Inc.
+ *      Copyright 2008-2009 Sun Microsystems, Inc.
  */
 package org.opends.server.replication.server;
 
@@ -203,9 +203,9 @@
   public String getMonitorInstanceName()
   {
     String serverURL=""; // FIXME
-    String str = rsDomain.getBaseDn().toString() + " " + serverURL + " "
-       + String.valueOf(serverId);
-    return "Undirect LDAP Server " + str;
+    String str = serverURL + " " + String.valueOf(serverId);
+    return "Undirect Replica " + str +
+                          ",cn=" + replServerHandler.getMonitorInstanceName();
   }
 
   /**
@@ -253,7 +253,7 @@
 
     attributes.add(Attributes.create("server-id",
         String.valueOf(serverId)));
-    attributes.add(Attributes.create("base-dn",
+    attributes.add(Attributes.create("domain-name",
         rsDomain.getBaseDn()));
     attributes.add(Attributes.create("connected-to",
         replServerHandler.getMonitorInstanceName()));
@@ -262,7 +262,7 @@
     MonitorData md;
     try
     {
-      md = rsDomain.getMonitorData();
+      md = rsDomain.computeMonitorData();
 
       ServerState remoteState = md.getLDAPServerState(serverId);
       if (remoteState == null)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
index 98e6de4..ff0a677 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -50,13 +50,11 @@
 import org.opends.messages.Message;
 import org.opends.messages.MessageBuilder;
 import org.opends.server.admin.server.ConfigurationChangeListener;
-import org.opends.server.admin.std.server.MonitorProviderCfg;
 import org.opends.server.admin.std.server.ReplicationServerCfg;
 import org.opends.server.api.Backend;
 import org.opends.server.api.BackupTaskListener;
 import org.opends.server.api.ExportTaskListener;
 import org.opends.server.api.ImportTaskListener;
-import org.opends.server.api.MonitorProvider;
 import org.opends.server.api.RestoreTaskListener;
 import org.opends.server.config.ConfigException;
 import org.opends.server.core.DirectoryServer;
@@ -64,9 +62,6 @@
 import org.opends.server.loggers.debug.DebugTracer;
 import org.opends.server.replication.protocol.ProtocolSession;
 import org.opends.server.replication.protocol.ReplSessionSecurity;
-import org.opends.server.types.Attribute;
-import org.opends.server.types.AttributeBuilder;
-import org.opends.server.types.Attributes;
 import org.opends.server.types.BackupConfig;
 import org.opends.server.types.ConfigChangeResult;
 import org.opends.server.types.DN;
@@ -90,8 +85,8 @@
  * It is responsible for creating the replication server replicationServerDomain
  * and managing it
  */
-public class ReplicationServer extends MonitorProvider<MonitorProviderCfg>
-  implements Runnable, ConfigurationChangeListener<ReplicationServerCfg>,
+public class ReplicationServer
+  implements ConfigurationChangeListener<ReplicationServerCfg>,
              BackupTaskListener, RestoreTaskListener, ImportTaskListener,
              ExportTaskListener
 {
@@ -164,8 +159,6 @@
   public ReplicationServer(ReplicationServerCfg configuration)
     throws ConfigException
   {
-    super("Replication Server" + configuration.getReplicationPort());
-
     replicationPort = configuration.getReplicationPort();
     serverId = (short) configuration.getReplicationServerId();
     replicationServers = configuration.getReplicationServer();
@@ -205,8 +198,6 @@
     replSessionSecurity = new ReplSessionSecurity();
     initialize(replicationPort);
     configuration.addChangeListener(this);
-    DirectoryServer.registerMonitorProvider(this);
-
     try
     {
       backendConfigEntryDN = DN.decode(
@@ -550,7 +541,6 @@
     {
       dbEnv.shutdown();
     }
-    DirectoryServer.deregisterMonitorProvider(getMonitorInstanceName());
 }
 
 
@@ -760,86 +750,6 @@
   }
 
   /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void initializeMonitorProvider(MonitorProviderCfg configuraiton)
-  {
-    // Nothing to do for now
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public String getMonitorInstanceName()
-  {
-    return "Replication Server " + this.replicationPort + " "
-           + serverId;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public long getUpdateInterval()
-  {
-    /* we don't wont to do polling on this monitor */
-    return 0;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void updateMonitorData()
-  {
-    // As long as getUpdateInterval() returns 0, this will never get called
-
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public ArrayList<Attribute> getMonitorData()
-  {
-    /*
-     * publish the server id and the port number.
-     */
-    ArrayList<Attribute> attributes = new ArrayList<Attribute>();
-    attributes.add(Attributes.create("replication server id",
-        String.valueOf(serverId)));
-    attributes.add(Attributes.create("replication server port",
-        String.valueOf(replicationPort)));
-
-    /*
-     * Add all the base DNs that are known by this replication server.
-     */
-    AttributeBuilder builder = new AttributeBuilder("base-dn");
-    for (String base : baseDNs.keySet())
-    {
-      builder.add(base.toString());
-    }
-    attributes.add(builder.toAttribute());
-
-    // Publish to monitor the generation ID by replicationServerDomain
-    builder = new AttributeBuilder("base-dn-generation-id");
-    for (String base : baseDNs.keySet())
-    {
-      long generationId=-1;
-      ReplicationServerDomain replicationServerDomain =
-              getReplicationServerDomain(base, false);
-      if (replicationServerDomain != null)
-        generationId = replicationServerDomain.getGenerationId();
-      builder.add(base.toString() + " " + generationId);
-    }
-    attributes.add(builder.toAttribute());
-
-    return attributes;
-  }
-
-  /**
    * Get the value of generationId for the replication replicationServerDomain
    * associated with the provided baseDN.
    *
@@ -1147,4 +1057,22 @@
       replicationServerDomain.stopReplicationServers(serversToDisconnect);
     }
   }
+
+  /**
+   * {@inheritDoc}
+   */
+  public String getMonitorInstanceName()
+  {
+    return "Replication Server " + replicationPort + " " + serverId;
+  }
+
+  /**
+   * Retrieves the port used by this ReplicationServer.
+   *
+   * @return The port used by this ReplicationServer.
+   */
+  public int getReplicationPort()
+  {
+    return replicationPort;
+  }
 }
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
index 498dac4..d7a71f5 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
@@ -31,6 +31,9 @@
 
 import static org.opends.server.loggers.debug.DebugLogger.*;
 
+import org.opends.server.admin.std.server.MonitorProviderCfg;
+import org.opends.server.api.MonitorProvider;
+import org.opends.server.core.DirectoryServer;
 import org.opends.server.loggers.debug.DebugTracer;
 import static org.opends.server.loggers.ErrorLogger.logError;
 import static org.opends.messages.ReplicationMessages.*;
@@ -57,6 +60,9 @@
 import org.opends.server.replication.protocol.MonitorMsg;
 import org.opends.server.replication.protocol.MonitorRequestMsg;
 import org.opends.server.replication.protocol.ResetGenerationIdMsg;
+import org.opends.server.types.Attribute;
+import org.opends.server.types.AttributeBuilder;
+import org.opends.server.types.Attributes;
 import org.opends.server.types.DirectoryException;
 import org.opends.server.types.ResultCode;
 import org.opends.server.util.TimeThread;
@@ -89,7 +95,7 @@
  * received to the disk and for trimming them
  * Decision to trim can be based on disk space or age of the message
  */
-public class ReplicationServerDomain
+public class ReplicationServerDomain extends MonitorProvider<MonitorProviderCfg>
 {
   private final Object flowControlLock = new Object();
   private final String baseDn;
@@ -184,10 +190,15 @@
   public ReplicationServerDomain(
       String baseDn, ReplicationServer replicationServer)
   {
+    super("Replication Server " + replicationServer.getReplicationPort() + " "
+        + baseDn + " " + replicationServer.getServerId());
+
     this.baseDn = baseDn;
     this.replicationServer = replicationServer;
     this.assuredTimeoutTimer = new Timer("Replication Assured Timer for " +
       baseDn + " in RS " + replicationServer.getServerId(), true);
+
+    DirectoryServer.registerMonitorProvider(this);
   }
 
   /**
@@ -1556,6 +1567,8 @@
    */
   public void shutdown()
   {
+    DirectoryServer.deregisterMonitorProvider(getMonitorInstanceName());
+
     // Terminate the assured timer
     assuredTimeoutTimer.cancel();
 
@@ -2187,7 +2200,7 @@
    * @return The monitor data.
    * @throws DirectoryException When an error occurs.
    */
-  synchronized protected MonitorData getMonitorData()
+  synchronized protected MonitorData computeMonitorData()
     throws DirectoryException
   {
     if (monitorData.getBuildDate() + monitorDataLifeTime > TimeThread.getTime())
@@ -2609,5 +2622,77 @@
       statusAnalyzer.setDeradedStatusThreshold(degradedStatusThreshold);
     }
   }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void initializeMonitorProvider(MonitorProviderCfg configuraiton)
+  {
+    // Nothing to do for now
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public String getMonitorInstanceName()
+  {
+    return "Replication Server "
+           + replicationServer.getReplicationPort() + " "
+           + " " + replicationServer.getServerId()
+           + ",cn=" + baseDn.replace(',', '_').replace('=', '_')
+           + ",cn=replication";
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public long getUpdateInterval()
+  {
+    /* we don't wont to do polling on this monitor */
+    return 0;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void updateMonitorData()
+  {
+    // As long as getUpdateInterval() returns 0, this will never get called
+
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public ArrayList<Attribute> getMonitorData()
+  {
+    /*
+     * publish the server id and the port number.
+     */
+    ArrayList<Attribute> attributes = new ArrayList<Attribute>();
+    attributes.add(Attributes.create("replication server id",
+        String.valueOf(replicationServer.getServerId())));
+    attributes.add(Attributes.create("replication server port",
+        String.valueOf(replicationServer.getReplicationPort())));
+
+    /*
+     * Add all the base DNs that are known by this replication server.
+     */
+    AttributeBuilder builder = new AttributeBuilder("domain-name");
+    builder.add(baseDn);
+    attributes.add(builder.toAttribute());
+
+    // Publish to monitor the generation ID by replicationServerDomain
+    builder = new AttributeBuilder("generation-id");
+    builder.add(baseDn.toString() + " " + generationId);
+    attributes.add(builder.toAttribute());
+
+    return attributes;
+  }
 }
 
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ServerHandler.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ServerHandler.java
index 32f48b3..a6d898c 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ServerHandler.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ServerHandler.java
@@ -1968,13 +1968,14 @@
   @Override
   public String getMonitorInstanceName()
   {
-    String str = baseDn.toString() +
-      " " + serverURL + " " + String.valueOf(serverId);
+    String str = serverURL + " " + String.valueOf(serverId);
 
     if (serverIsLDAPserver)
-      return "Directory Server " + str;
+      return "Connected Replica " + str +
+                ",cn=" + replicationServerDomain.getMonitorInstanceName();
     else
-      return "Remote Replication Server " + str;
+      return "Connected Replication Server " + str +
+                ",cn=" + replicationServerDomain.getMonitorInstanceName();
   }
 
   /**
@@ -2020,7 +2021,7 @@
     ArrayList<Attribute> attributes = new ArrayList<Attribute>();
     if (serverIsLDAPserver)
     {
-      attributes.add(Attributes.create("LDAP-Server", serverURL));
+      attributes.add(Attributes.create("replica", serverURL));
       attributes.add(Attributes.create("connected-to",
           this.replicationServerDomain.getReplicationServer()
               .getMonitorInstanceName()));
@@ -2028,17 +2029,17 @@
     }
     else
     {
-      attributes.add(Attributes.create("ReplicationServer-Server",
+      attributes.add(Attributes.create("Replication-Server",
           serverURL));
     }
     attributes.add(Attributes.create("server-id", String
         .valueOf(serverId)));
-    attributes.add(Attributes.create("base-dn", baseDn.toString()));
+    attributes.add(Attributes.create("domain-name", baseDn.toString()));
 
     try
     {
       MonitorData md;
-      md = replicationServerDomain.getMonitorData();
+      md = replicationServerDomain.computeMonitorData();
 
       if (serverIsLDAPserver)
       {
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java b/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
index db3939b..8c67c5d 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
@@ -540,10 +540,10 @@
   }
 
   /**
-   * Gets the info for DSs in the topology (except us).
-   * @return The info for DSs in the topology (except us)
+   * Gets the info for Replicas in the topology (except us).
+   * @return The info for Replicas in the topology (except us)
    */
-  public List<DSInfo> getDsList()
+  public List<DSInfo> getReplicasList()
   {
     return broker.getDsList();
   }
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationMonitor.java b/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationMonitor.java
index 3773ecd..b5c9476 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationMonitor.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationMonitor.java
@@ -76,8 +76,9 @@
   @Override
   public String getMonitorInstanceName()
   {
-    return "Replication Domain "  + domain.getServiceID()
-       + " " + domain.getServerId();
+    return "Replication Domain " + domain.getServerId()
+           + ",cn=" + domain.getServiceID().replace(',', '_').replace('=', '_')
+           + ",cn=replication";
   }
 
   /**
@@ -94,7 +95,7 @@
     ArrayList<Attribute> attributes = new ArrayList<Attribute>();
 
     /* get the base dn */
-    Attribute attr = Attributes.create("base-dn", domain.getServiceID());
+    Attribute attr = Attributes.create("domain-name", domain.getServiceID());
     attributes.add(attr);
 
     /* get the base dn */
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReSyncTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReSyncTest.java
index 2e4dfbc..bcfc8d6 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReSyncTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReSyncTest.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2007-2008 Sun Microsystems, Inc.
+ *      Copyright 2007-2009 Sun Microsystems, Inc.
  */
 package org.opends.server.replication;
 
@@ -224,9 +224,7 @@
     connection.processDelete(DN.decode("dc=fooUniqueName2," + EXAMPLE_DN));
 
     String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
-    String path = buildRoot + File.separator + "build" +
-                  File.separator + "unit-tests" + File.separator +
-                  "package-instance"+ File.separator + "ReSynchTest";
+    String path = "ReSynchTest";
 
     task("dn: ds-task-id=" + UUID.randomUUID()
         + ",cn=Scheduled Tasks,cn=Tasks\n"
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java
index d325b25..5723295 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java
@@ -635,7 +635,7 @@
   protected long getMonitorAttrValue(DN baseDn, String attr) throws Exception
   {
     String monitorFilter =
-         "(&(cn=replication Domain*)(base-dn=" + baseDn + "))";
+         "(&(cn=replication Domain*)(domain-name=" + baseDn + "))";
 
     InternalSearchOperation op;
     int count = 0;
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java
index 9079f04..b20164a 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java
@@ -1855,7 +1855,7 @@
      * Find monitoring entry for requested base DN
      */
     String monitorFilter =
-         "(&(cn=replication Domain*)(base-dn=" + baseDn + "))";
+         "(&(cn=replication Domain*)(domain-name=" + baseDn + "))";
 
     InternalSearchOperation op;
     int count = 0;
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/TopologyViewTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/TopologyViewTest.java
index 5acfae9..3f4c7ad 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/TopologyViewTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/TopologyViewTest.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2008 Sun Microsystems, Inc.
+ *      Copyright 2008-2009 Sun Microsystems, Inc.
  */
 package org.opends.server.replication.plugin;
 
@@ -1086,7 +1086,7 @@
      /**
       * Get the topo view of the current analyzed DS
       */
-     List<DSInfo> internalDsList = rd.getDsList();
+     List<DSInfo> internalDsList = rd.getReplicasList();
      // Add info for DS itself:
      // we need to clone the list as we don't want to modify the list kept
      // inside the DS.
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/AssuredReplicationServerTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/AssuredReplicationServerTest.java
index fb6b2ab..762033e 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/AssuredReplicationServerTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/AssuredReplicationServerTest.java
@@ -175,7 +175,7 @@
   // RS receives updates but does not respond (makes timeouts)
   private static final int TIMEOUT_RS_SCENARIO = 12;
   // RS is used for sending updates (with sendNewFakeUpdate()) and receive acks, synchronously
-  private static final int SENDER_RS_SCENARIO = 13;  
+  private static final int SENDER_RS_SCENARIO = 13;
   //   Scenarios only used in safe read tests:
   // RS receives updates and replies ack error as if a DS was connected to it and timed out
   private static final int DS_TIMEOUT_RS_SCENARIO_SAFE_READ = 14;
@@ -2035,7 +2035,7 @@
     List<RSInfo> rsInfo = null;
     while(nSec > 0)
     {
-      dsInfo = fakeRd.getDsList();
+      dsInfo = fakeRd.getReplicasList();
       rsInfo = fakeRd.getRsList();
       nDs = dsInfo.size();
       nRs = rsInfo.size();
@@ -2734,35 +2734,35 @@
       /*
        * Start another fake DS 2 connected to RS
        */
-   
+
       fakeRd2 = createFakeReplicationDomain(FDS2_ID, DEFAULT_GID, RS1_ID,
         DEFAULT_GENID, true, AssuredMode.SAFE_READ_MODE, 1, LONG_TIMEOUT,
         REPLY_OK_DS_SCENARIO);
       assertNotNull(fakeRd2);
-     
+
       /*
        * Start another fake DS 3 connected to RS
        */
-      
+
       fakeRd3 = createFakeReplicationDomain(FDS3_ID, otherFakeDsGid, RS1_ID,
         otherFakeDsGenId, ((otherFakeDsGid == DEFAULT_GID) ? true : false),
         AssuredMode.SAFE_READ_MODE, 1, LONG_TIMEOUT,
         otherFakeDsScen);
       assertNotNull(fakeRd3);
-      
+
       /*
        * Start fake RS (RS 1) connected to RS
        */
-      
+
       fakeRs1 = createFakeReplicationServer(FRS1_ID, DEFAULT_GID, RS1_ID,
         DEFAULT_GENID, true, AssuredMode.SAFE_READ_MODE, 1,
         new ServerState(), REPLY_OK_RS_SCENARIO);
       assertNotNull(fakeRs1);
-      
+
       /*
        * Start another fake RS (RS 2) connected to RS
        */
-      
+
       fakeRs2 = createFakeReplicationServer(FRS2_ID, otherFakeRsGid, RS1_ID,
         otherFakeRsGenId, ((otherFakeRsGid == DEFAULT_GID) ? true : false),
         AssuredMode.SAFE_READ_MODE, 1, new ServerState(), otherFakeRsScen);
@@ -2909,7 +2909,7 @@
       if (shouldSeeDsRsIdInError)
         expectedErrors.put(DS_FRS2_ID, 1);
       checkServerErrorListsAreEqual(fakeRd1.getAssuredSrServerNotAcknowledgedUpdates(), expectedErrors);
-      
+
       assertEquals(fakeRd1.getAssuredSrReceivedUpdates(), 0);
       assertEquals(fakeRd1.getAssuredSrReceivedUpdatesAcked(), 0);
       assertEquals(fakeRd1.getAssuredSrReceivedUpdatesNotAcked(), 0);
@@ -3739,7 +3739,7 @@
       // Wait for connections to be finished
       // DS must see expected numbers of DSs/RSs
       waitForStableTopo(fakeRd1, 1, 1);
-      List<DSInfo> dsInfos = fakeRd1.getDsList();
+      List<DSInfo> dsInfos = fakeRd1.getReplicasList();
       DSInfo dsInfo = dsInfos.get(0);
       assertEquals(dsInfo.getDsId(), FDS2_ID);
       assertEquals(dsInfo.getStatus(), ServerStatus.NORMAL_STATUS);
@@ -3771,7 +3771,7 @@
       boolean error = true;
       for (int count = 0; count < 12; count++)
       {
-        dsInfos = fakeRd1.getDsList();
+        dsInfos = fakeRd1.getReplicasList();
         if (dsInfos == null)
           continue;
         if (dsInfos.size() == 0)
@@ -3886,7 +3886,7 @@
       error = true;
       for (int count = 0; count < 12; count++)
       {
-        dsInfos = fakeRd1.getDsList();
+        dsInfos = fakeRd1.getReplicasList();
         if (dsInfos == null)
           continue;
         if (dsInfos.size() == 0)
diff --git a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/service/ReplicationDomainTest.java b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/service/ReplicationDomainTest.java
index d3cff52..65d6784 100644
--- a/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/service/ReplicationDomainTest.java
+++ b/opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/service/ReplicationDomainTest.java
@@ -129,7 +129,7 @@
         assertTrue(replServerInfo.getGenerationId() == 1);
       }
 
-      for (DSInfo serverInfo : domain1.getDsList())
+      for (DSInfo serverInfo : domain1.getReplicasList())
       {
         assertTrue(serverInfo.getStatus() == ServerStatus.NORMAL_STATUS);
       }
@@ -145,7 +145,7 @@
         assertTrue(replServerInfo.getGenerationId() == 2);
       }
 
-      for (DSInfo serverInfo : domain1.getDsList())
+      for (DSInfo serverInfo : domain1.getReplicasList())
       {
         if (serverInfo.getDsId() == 2)
           assertTrue(serverInfo.getStatus() == ServerStatus.BAD_GEN_ID_STATUS);
@@ -156,7 +156,7 @@
         }
       }
 
-      for (DSInfo serverInfo : domain2.getDsList())
+      for (DSInfo serverInfo : domain2.getReplicasList())
       {
         if (serverInfo.getDsId() == 2)
           assertTrue(serverInfo.getStatus() == ServerStatus.BAD_GEN_ID_STATUS);
@@ -231,7 +231,7 @@
        * Trigger a total update from domain1 to domain2.
        * Check that the exported data is correctly received on domain2.
        */
-      for (DSInfo remoteDS : domain2.getDsList())
+      for (DSInfo remoteDS : domain2.getReplicasList())
       {
         if (remoteDS.getDsId() != domain2.getServerId())
         {
@@ -361,7 +361,7 @@
       boolean alone = true;
       while (alone)
       {
-        for (DSInfo remoteDS : domain1.getDsList())
+        for (DSInfo remoteDS : domain1.getReplicasList())
         {
           if (remoteDS.getDsId() != domain1.getServerId())
           {

--
Gitblit v1.10.0