From 4818be26577e76b550219cde7278282f101dafa9 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 18 Apr 2016 09:35:03 +0000
Subject: [PATCH] Replaced uses of ConnectionUtils.getHost() and getPort() by ConnectionWrapper.getHostPort()
---
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java
index 1e988e7..82f2432 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java
@@ -24,13 +24,13 @@
import javax.naming.ldap.InitialLdapContext;
import javax.net.ssl.KeyManager;
+import org.forgerock.opendj.ldap.DN;
+import org.forgerock.opendj.ldap.SearchScope;
import org.opends.admin.ads.util.ApplicationTrustManager;
import org.opends.admin.ads.util.ConnectionUtils;
import org.opends.guitools.controlpanel.event.ReferralAuthenticationListener;
-import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.HostPort;
import org.opends.server.types.LDAPURL;
-import org.forgerock.opendj.ldap.SearchScope;
import com.forgerock.opendj.cli.CliConstants;
@@ -478,19 +478,20 @@
}
private LDAPURL makeLDAPUrl(InitialLdapContext ctx) {
- return makeLDAPUrl(ctx, "");
+ return makeLDAPUrl(ConnectionUtils.getHostPort(ctx), "", isSSL(ctx));
}
/**
* Make an url from the specified arguments.
- * @param ctx the connection to the server.
+ * @param hostPort the host name and port of the server.
* @param dn the base DN of the URL.
+ * @param isSSL whether the connection uses SSL
* @return an LDAP URL from the specified arguments.
*/
- public static LDAPURL makeLDAPUrl(InitialLdapContext ctx, String dn) {
- HostPort hostPort = ConnectionUtils.getHostPort(ctx);
+ public static LDAPURL makeLDAPUrl(HostPort hostPort, String dn, boolean isSSL)
+ {
return new LDAPURL(
- isSSL(ctx) ? "ldaps" : LDAPURL.DEFAULT_SCHEME,
+ isSSL ? "ldaps" : LDAPURL.DEFAULT_SCHEME,
hostPort.getHost(),
hostPort.getPort(),
dn,
--
Gitblit v1.10.0