From c8a1bec908f144ebacb97ba6c591eaf0f47779f6 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 08 Aug 2016 07:26:19 +0000
Subject: [PATCH] Replase use of String ldapUrl by HostPort

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

diff --git a/opendj-server-legacy/src/main/java/org/opends/admin/ads/ServerDescriptor.java b/opendj-server-legacy/src/main/java/org/opends/admin/ads/ServerDescriptor.java
index 4f3a630..f214db2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/admin/ads/ServerDescriptor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/admin/ads/ServerDescriptor.java
@@ -264,32 +264,31 @@
   }
 
   /**
-   * Returns the URL to access this server using LDAP.
-   * @return the URL to access this server using LDAP,
+   * Returns the HostPort to access this server using LDAP.
+   * @return the HostPort to access this server using LDAP,
    *         {@code null} if the server is not configured to listen on an LDAP port.
    */
-  public String getLDAPURL()
+  public HostPort getLdapHostPort()
   {
-    return getLDAPUrl0(ServerProperty.LDAP_ENABLED, ServerProperty.LDAP_PORT, false);
+    return getHostPort0(ServerProperty.LDAP_ENABLED, ServerProperty.LDAP_PORT, false);
   }
 
   /**
-   * Returns the URL to access this server using LDAPS.
-   * @return the URL to access this server using LDAP,
+   * Returns the HostPort to access this server using LDAPS.
+   * @return the HostPort to access this server using LDAPS,
    *         {@code null} if the server is not configured to listen on an LDAPS port.
    */
-  public String getLDAPsURL()
+  public HostPort getLdapsHostPort()
   {
-    return getLDAPUrl0(ServerProperty.LDAPS_ENABLED, ServerProperty.LDAPS_PORT, true);
+    return getHostPort0(ServerProperty.LDAPS_ENABLED, ServerProperty.LDAPS_PORT, true);
   }
 
-  private String getLDAPUrl0(ServerProperty enabledProp, ServerProperty portProp, boolean useSSL)
+  private HostPort getHostPort0(ServerProperty enabledProp, ServerProperty portProp, boolean useSSL)
   {
     int port = getPort(enabledProp, portProp);
     if (port != -1)
     {
-      String host = getHostName();
-      return getLDAPUrl(host, port, useSSL);
+      return new HostPort(getHostName(), port);
     }
     return null;
   }
@@ -304,13 +303,13 @@
   }
 
   /**
-   * Returns the URL to access this server using the administration connector.
-   * @return the URL to access this server using the administration connector,
+   * Returns the HostPort to access this server using the administration connector.
+   * @return the HostPort to access this server using the administration connector,
    *         {@code null} if the server cannot get the administration connector.
    */
-  public String getAdminConnectorURL()
+  public HostPort getAdminConnectorHostPort()
   {
-    return getLDAPUrl0(ServerProperty.ADMIN_ENABLED, ServerProperty.ADMIN_PORT, true);
+    return getHostPort0(ServerProperty.ADMIN_ENABLED, ServerProperty.ADMIN_PORT, true);
   }
 
   /**

--
Gitblit v1.10.0