org.identityconnectors.ldap.commons
Class LdapUtil

java.lang.Object
  extended by org.identityconnectors.ldap.commons.LdapUtil

public class LdapUtil
extends Object


Method Summary
static String addBinaryOption(String ldapAttrName)
          Adds the binary option to the attribute if not present already.
static void addStringAttrValues(Attributes ldapAttrs, String ldapAttrName, Set<String> toSet)
           
static boolean attrNameEquals(String name1, String name2)
          Returns true if the names of the given LDAP attributes are equal.
static
<T> List<T>
checkedListByFilter(List list, Class<T> clazz)
           
static boolean escapeAttrValue(Object value, StringBuilder toBuilder)
          Escapes the given attribute value to the given StringBuilder.
static String getStringAttrValue(Attributes ldapAttrs, String ldapAttrName)
          Return the value of the ldapAttrName parameter cast to a String.
static Set<String> getStringAttrValues(Attributes ldapAttrs, String ldapAttrName)
          Return the case insensitive set of values of the ldapAttrName parameter cast to a String.
static boolean hasBinaryOption(String ldapAttrName)
          Returns true if the attribute has the binary option, e.g., userCertificate;binary.
static boolean isUnderContexts(LdapName entry, List<LdapName> contexts)
           
static String[] nullAsEmpty(String[] array)
           
static LdapName quietCreateLdapName(String ldapName)
           
static String removeBinaryOption(String ldapAttrName)
          Removes the binary option from the attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

attrNameEquals

public static boolean attrNameEquals(String name1,
                                     String name2)
Returns true if the names of the given LDAP attributes are equal. Deals with null values as a convenience.


hasBinaryOption

public static boolean hasBinaryOption(String ldapAttrName)
Returns true if the attribute has the binary option, e.g., userCertificate;binary.


addBinaryOption

public static String addBinaryOption(String ldapAttrName)
Adds the binary option to the attribute if not present already.


removeBinaryOption

public static String removeBinaryOption(String ldapAttrName)
Removes the binary option from the attribute.


getStringAttrValue

public static String getStringAttrValue(Attributes ldapAttrs,
                                        String ldapAttrName)
Return the value of the ldapAttrName parameter cast to a String.


getStringAttrValues

public static Set<String> getStringAttrValues(Attributes ldapAttrs,
                                              String ldapAttrName)
Return the case insensitive set of values of the ldapAttrName parameter cast to a String.


addStringAttrValues

public static void addStringAttrValues(Attributes ldapAttrs,
                                       String ldapAttrName,
                                       Set<String> toSet)

escapeAttrValue

public static boolean escapeAttrValue(Object value,
                                      StringBuilder toBuilder)
Escapes the given attribute value to the given StringBuilder. Returns true iff anything was written to the builder.


quietCreateLdapName

public static LdapName quietCreateLdapName(String ldapName)

isUnderContexts

public static boolean isUnderContexts(LdapName entry,
                                      List<LdapName> contexts)

nullAsEmpty

public static String[] nullAsEmpty(String[] array)

checkedListByFilter

public static <T> List<T> checkedListByFilter(List list,
                                              Class<T> clazz)


Copyright © 2012. All Rights Reserved.