From 867e35d3947bd5f2e6c0baaf502312ca618a00ea Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 05 Aug 2016 18:35:35 +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/util/ConnectionUtils.java |   64 --------------------------------
 1 files changed, 0 insertions(+), 64 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java b/opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java
index 82ad403..dfd91b1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java
@@ -19,7 +19,6 @@
 import java.io.IOException;
 import java.net.ConnectException;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Set;
 
@@ -27,8 +26,6 @@
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
@@ -487,67 +484,6 @@
   }
 
   /**
-   * Returns the String representation of the first value of an attribute in a
-   * LDAP entry.
-   * @param entry the entry.
-   * @param attrName the attribute name.
-   * @return the String representation of the first value of an attribute in a
-   * LDAP entry.
-   * @throws NamingException if there is an error processing the entry.
-   */
-  public static String getFirstValue(SearchResult entry, String attrName)
-  throws NamingException
-  {
-    String v = null;
-    Attributes attrs = entry.getAttributes();
-    if (attrs != null)
-    {
-      Attribute attr = attrs.get(attrName);
-      if (attr != null && attr.size() > 0)
-      {
-        Object o = attr.get();
-        if (o instanceof String)
-        {
-          v = (String)o;
-        }
-        else
-        {
-          v = String.valueOf(o);
-        }
-      }
-    }
-    return v;
-  }
-
-  /**
-   * Returns a Set with the String representation of the values of an attribute
-   * in a LDAP entry.  The returned Set will never be null.
-   * @param entry the entry.
-   * @param attrName the attribute name.
-   * @return a Set with the String representation of the values of an attribute
-   * in a LDAP entry.
-   * @throws NamingException if there is an error processing the entry.
-   */
-  public static Set<String> getValues(SearchResult entry, String attrName)
-  throws NamingException
-  {
-    Set<String> values = new HashSet<>();
-    Attributes attrs = entry.getAttributes();
-    if (attrs != null)
-    {
-      Attribute attr = attrs.get(attrName);
-      if (attr != null)
-      {
-        for (int i=0; i<attr.size(); i++)
-        {
-          values.add((String)attr.get(i));
-        }
-      }
-    }
-    return values;
-  }
-
-  /**
    * Returns the first attribute value in this attribute decoded as a UTF-8 string.
    *
    * @param sr

--
Gitblit v1.10.0