From 10b76e3a58346e0b6e2e07e58617b75dc383c249 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 21 Aug 2013 08:33:59 +0000
Subject: [PATCH] Increased encapsulation in ReplicationServerDomain by: - Making private the start*() methods - Moved some code to here from some other classes - MAking private the buildAndSendTopoInfoTo*() methods.

---
 opends/src/server/org/opends/server/replication/server/DataServerHandler.java |   37 ++++++++-----------------------------
 1 files changed, 8 insertions(+), 29 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/DataServerHandler.java b/opends/src/server/org/opends/server/replication/server/DataServerHandler.java
index d956b28..c2d9722 100644
--- a/opends/src/server/org/opends/server/replication/server/DataServerHandler.java
+++ b/opends/src/server/org/opends/server/replication/server/DataServerHandler.java
@@ -183,14 +183,15 @@
   }
 
   /**
-   * Change the status according to the event generated from the status
-   * analyzer.
-   * @param event The event to be used for new status computation
+   * Change the status according to the event.
+   *
+   * @param event
+   *          The event to be used for new status computation
    * @return The new status of the DS
-   * @throws IOException When raised by the underlying session
+   * @throws IOException
+   *           When raised by the underlying session
    */
-  public ServerStatus changeStatusFromStatusAnalyzer(StatusMachineEvent event)
-  throws IOException
+  public ServerStatus changeStatus(StatusMachineEvent event) throws IOException
   {
     return changeStatus(event, "from status analyzer");
   }
@@ -377,25 +378,6 @@
     return serverStartMsg.getSSLEncryption();
   }
 
-  /**
-   * Registers this handler into its related domain and notifies the domain
-   * about the new DS.
-   */
-  public void registerIntoDomain()
-  {
-    // All-right, connected with new DS: store handler.
-    Map<Integer, DataServerHandler> connectedDSs =
-      replicationServerDomain.getConnectedDSs();
-    connectedDSs.put(serverId, this);
-
-    // Tell peer DSs a new DS just connected to us
-    // No need to re-send TopologyMsg to this just new DS so not null
-    // argument
-    replicationServerDomain.buildAndSendTopoInfoToDSs(this);
-    // Tell peer RSs a new DS just connected to us
-    replicationServerDomain.buildAndSendTopoInfoToRSs();
-  }
-
   /** Send our own TopologyMsg to DS. */
   private TopologyMsg sendTopoToRemoteDS() throws IOException
   {
@@ -498,10 +480,7 @@
         throw new DirectoryException(ResultCode.OTHER, null, null);
       }
 
-      replicationServerDomain.startStatusAnalyzer();
-      replicationServerDomain.startMonitoringPublisher();
-
-      registerIntoDomain();
+      replicationServerDomain.register(this);
 
       Message message = INFO_REPLICATION_SERVER_CONNECTION_FROM_DS
           .get(getReplicationServerId(), getServerId(),

--
Gitblit v1.10.0