Class ConnectionUtils


  • public class ConnectionUtils
    extends Object
    Class providing some utilities to create LDAP connections using JNDI and to manage entries retrieved using JNDI.
    • Method Detail

      • firstValueAsString

        public static String firstValueAsString​(Entry entry,
                                                String attrDesc)
        Returns the first attribute value in this attribute decoded as a UTF-8 string.
        Parameters:
        entry - the entry
        attrDesc - the attribute description
        Returns:
        The first attribute value in this attribute decoded as a UTF-8 string.
      • allValuesAsStrings

        public static List<String> allValuesAsStrings​(Entry entry,
                                                      String attrDesc)
        Returns all the values of this attribute decoded as UTF-8 strings, in the order they were returned by the server.
        Parameters:
        entry - the entry
        attrDesc - the attribute description
        Returns:
        all the values of this attribute decoded as UTF-8 strings, an empty list if the attribute is not present.