From fa9c515bf663d5189abd094e68051f380205f24d Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 18 Apr 2016 08:52:40 +0000
Subject: [PATCH] Replaced uses of ConnectionUtils.getHostPort() by ConnectionWrapper.getHostPort()

---
 opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContext.java |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContext.java b/opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContext.java
index 9313818..71238f0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContext.java
+++ b/opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContext.java
@@ -53,10 +53,10 @@
 import org.forgerock.i18n.LocalizableMessage;
 import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.opends.admin.ads.ADSContextException.ErrorType;
-import org.opends.admin.ads.util.ConnectionUtils;
 import org.opends.admin.ads.util.ConnectionWrapper;
 import org.opends.quicksetup.Constants;
 import org.opends.server.schema.SchemaConstants;
+import org.opends.server.types.HostPort;
 
 /** Class used to update and read the contents of the Administration Data. */
 public class ADSContext
@@ -310,6 +310,16 @@
   }
 
   /**
+   * Returns the host name and port number of this connection.
+   *
+   * @return the hostPort of this connection
+   */
+  public HostPort getHostPort()
+  {
+    return connectionWrapper.getHostPort();
+  }
+
+  /**
    * Method called to register a server in the ADS.
    *
    * @param serverProperties
@@ -2189,8 +2199,7 @@
     }
     catch (ADSContextException adce)
     {
-      LocalizableMessage msg = ERR_ADS_MERGE.get(ConnectionUtils.getHostPort(getDirContext()),
-          ConnectionUtils.getHostPort(adsCtx.getDirContext()), adce.getMessageObject());
+      LocalizableMessage msg = ERR_ADS_MERGE.get(getHostPort(), adsCtx.getHostPort(), adce.getMessageObject());
       throw new ADSContextException(ErrorType.ERROR_MERGING, msg, adce);
     }
   }
@@ -2220,8 +2229,8 @@
     if (!notDefinedAdmins.isEmpty())
     {
       LocalizableMessage msg = ERR_ADS_ADMINISTRATOR_MERGE.get(
-          ConnectionUtils.getHostPort(adsCtx.getDirContext()), ConnectionUtils.getHostPort(getDirContext()),
-          joinAsString(Constants.LINE_SEPARATOR, notDefinedAdmins), ConnectionUtils.getHostPort(getDirContext()));
+          adsCtx.getHostPort(), getHostPort(),
+          joinAsString(Constants.LINE_SEPARATOR, notDefinedAdmins), getHostPort());
       throw new ADSContextException(ErrorType.ERROR_MERGING, msg, null);
     }
   }

--
Gitblit v1.10.0