From 942de627aa7249a1cb392b0d908b50b72bfffccb Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 05 Oct 2011 15:25:42 +0000
Subject: [PATCH] Fix OPENDJ-65: Host domain name lost from FQDN while enabling replication for a new replica using disreplication enable

---
 opends/src/server/org/opends/server/replication/service/ReplicationBroker.java |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java b/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
index 0ed1b10..6bc7cce 100644
--- a/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
+++ b/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
@@ -347,6 +347,7 @@
       {
         // This RS is locally configured, mark this
         replicationServerInfo.setLocallyConfigured(true);
+        replicationServerInfo.serverURL = serverUrl;
         return;
       }
     }
@@ -467,6 +468,23 @@
      * Create a new instance of ReplicationServerInfo wrapping the passed
      * message.
      * @param msg Message to wrap.
+     * @param server Override serverURL.
+     * @return The new instance wrapping the passed message.
+     * @throws IllegalArgumentException If the passed message has an unexpected
+     *                                  type.
+     */
+    public static ReplicationServerInfo newInstance(
+      ReplicationMsg msg, String server) throws IllegalArgumentException
+    {
+      ReplicationServerInfo rsInfo = newInstance(msg);
+      rsInfo.serverURL = server;
+      return rsInfo;
+    }
+
+    /**
+     * Create a new instance of ReplicationServerInfo wrapping the passed
+     * message.
+     * @param msg Message to wrap.
      * @return The new instance wrapping the passed message.
      * @throws IllegalArgumentException If the passed message has an unexpected
      *                                  type.
@@ -1216,7 +1234,7 @@
 
       // Wrap received message in a server info object
       ReplicationServerInfo replServerInfo = ReplicationServerInfo
-          .newInstance(msg);
+          .newInstance(msg, server);
 
       // Sanity check
       String repDn = replServerInfo.getBaseDn();

--
Gitblit v1.10.0