From 08154804f671e1c471df14ac999e6d6bb18bbd37 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 01 Jul 2016 14:30:12 +0000
Subject: [PATCH] Partial OPENDJ-2625 Convert all code that uses JNDI to use the SDK instead

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

diff --git a/opendj-server-legacy/src/main/java/org/opends/admin/ads/TopologyCache.java b/opendj-server-legacy/src/main/java/org/opends/admin/ads/TopologyCache.java
index 6100447..9de7170 100644
--- a/opendj-server-legacy/src/main/java/org/opends/admin/ads/TopologyCache.java
+++ b/opendj-server-legacy/src/main/java/org/opends/admin/ads/TopologyCache.java
@@ -34,6 +34,7 @@
 
 import org.forgerock.i18n.LocalizableMessage;
 import org.forgerock.i18n.slf4j.LocalizedLogger;
+import org.forgerock.opendj.ldap.DN;
 import org.opends.admin.ads.ADSContext.ServerProperty;
 import org.opends.admin.ads.util.ApplicationTrustManager;
 import org.opends.admin.ads.util.ConnectionUtils;
@@ -57,7 +58,7 @@
   private final ADSContext adsContext;
   private final ApplicationTrustManager trustManager;
   private final int timeout;
-  private final String bindDN;
+  private final DN bindDN;
   private final String bindPwd;
   private final Set<ServerDescriptor> servers = new HashSet<>();
   private final Set<SuffixDescriptor> suffixes = new HashSet<>();
@@ -83,8 +84,9 @@
     this.adsContext = adsContext;
     this.trustManager = trustManager;
     this.timeout = timeout;
-    bindDN = ConnectionUtils.getBindDN(adsContext.getDirContext());
-    bindPwd = ConnectionUtils.getBindPassword(adsContext.getDirContext());
+    ConnectionWrapper conn = adsContext.getConnection();
+    bindDN = conn.getBindDn();
+    bindPwd = conn.getBindPassword();
   }
 
   /**
@@ -357,8 +359,7 @@
   {
     return new ServerLoader(serverProperties, bindDN, bindPwd,
         trustManager == null ? null : trustManager.createCopy(),
-        timeout,
-        getPreferredConnections(), getFilter());
+        timeout, getPreferredConnections(), getFilter());
   }
 
   /**

--
Gitblit v1.10.0