From 9357fb33c8425bb731ead54ae7359aa4725f2fd5 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Mon, 03 Jun 2013 09:13:08 +0000
Subject: [PATCH] Fix OPENDJ-866 Local RS is named differently to remote RS under cn=replication,cn=monitor

---
 opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ServerStartMsg.java |   24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ServerStartMsg.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ServerStartMsg.java
index abcd8af..d516608 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ServerStartMsg.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ServerStartMsg.java
@@ -28,8 +28,6 @@
 package org.opends.server.replication.protocol;
 
 import java.io.UnsupportedEncodingException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
 import java.util.zip.DataFormatException;
 
 import org.opends.server.replication.common.ServerState;
@@ -70,6 +68,7 @@
    *
    * @param serverId2 The serverId of the server for which the ServerStartMsg
    *                 is created.
+   * @param serverURL directory server URL
    * @param baseDn   The base DN.
    * @param windowSize   The window size used by this server.
    * @param heartbeatInterval The requested heartbeat interval.
@@ -80,17 +79,15 @@
    *                      after the start messages have been exchanged.
    * @param groupId The group id of the DS for this DN
    */
-  public ServerStartMsg(int serverId2, String baseDn, int windowSize,
-                            long heartbeatInterval,
-                            ServerState serverState,
-                            short protocolVersion,
-                            long generationId,
-                            boolean sslEncryption,
-                            byte groupId)
+  public ServerStartMsg(int serverId2, String serverURL, String baseDn,
+      int windowSize, long heartbeatInterval, ServerState serverState,
+      short protocolVersion, long generationId, boolean sslEncryption,
+      byte groupId)
   {
     super(protocolVersion, generationId);
 
     this.serverId = serverId2;
+    this.serverURL = serverURL;
     this.baseDn = baseDn;
     this.maxReceiveDelay = 0;
     this.maxReceiveQueue = 0;
@@ -101,15 +98,6 @@
     this.sslEncryption = sslEncryption;
     this.serverState = serverState;
     this.groupId = groupId;
-
-    try
-    {
-      /* TODO : find a better way to get the server URL */
-      this.serverURL = InetAddress.getLocalHost().getHostName();
-    } catch (UnknownHostException e)
-    {
-      this.serverURL = "Unknown host";
-    }
   }
 
   /**

--
Gitblit v1.10.0