Class JLdapUtils


  • public class JLdapUtils
    extends Object
    Provides methods for converting between JLDAP specific objects and ldaptive specific objects.
    • Field Detail

      • sortBehavior

        private final SortBehavior sortBehavior
        Ldap result sort behavior.
      • binaryAttrs

        private List<String> binaryAttrs
        Attributes that should be treated as binary.
    • Constructor Detail

      • JLdapUtils

        public JLdapUtils()
        Default constructor.
      • JLdapUtils

        public JLdapUtils​(SortBehavior sb)
        Creates a new jldap util.
        Parameters:
        sb - sort behavior
    • Method Detail

      • getBinaryAttributes

        public List<String> getBinaryAttributes()
        Returns the list of binary attributes.
        Returns:
        list of binary attributes
      • setBinaryAttributes

        public void setBinaryAttributes​(String[] s)
        Sets the list of binary attributes.
        Parameters:
        s - binary attributes
      • fromLdapAttribute

        public com.novell.ldap.LDAPAttribute fromLdapAttribute​(LdapAttribute la)
        Returns a jldap attribute that represents the values in the supplied ldap attribute.
        Parameters:
        la - ldap attribute
        Returns:
        jldap attribute
      • toLdapAttribute

        public LdapAttribute toLdapAttribute​(com.novell.ldap.LDAPAttribute a)
        Returns an ldap attribute using the supplied jldap attribute.
        Parameters:
        a - jldap attribute
        Returns:
        ldap attribute
      • fromLdapAttributes

        public com.novell.ldap.LDAPAttributeSet fromLdapAttributes​(Collection<LdapAttribute> c)
        Returns a jldap attribute set that represents the values in the supplied ldap attributes.
        Parameters:
        c - ldap attributes
        Returns:
        jldap attributes
      • fromLdapEntry

        public com.novell.ldap.LDAPEntry fromLdapEntry​(LdapEntry le)
        Returns a jldap ldap entry that represents the supplied ldap entry.
        Parameters:
        le - ldap entry
        Returns:
        jldap ldap entry
      • toSearchEntry

        public SearchEntry toSearchEntry​(com.novell.ldap.LDAPEntry entry,
                                         ResponseControl[] c,
                                         int id)
        Returns a search entry using the supplied jldap ldap entry.
        Parameters:
        entry - jldap ldap entry
        c - response controls
        id - message id
        Returns:
        search entry
      • fromAttributeModification

        public com.novell.ldap.LDAPModification[] fromAttributeModification​(AttributeModification[] am)
        Returns jldap ldap modifications using the supplied attribute modifications.
        Parameters:
        am - attribute modifications
        Returns:
        jldap ldap modifications
      • fromSortKey

        public static com.novell.ldap.controls.LDAPSortKey[] fromSortKey​(SortKey[] sk)
        Returns jldap sort keys using the supplied sort keys.
        Parameters:
        sk - sort keys
        Returns:
        jldap sort keys
      • getAttributeModification

        protected static int getAttributeModification​(AttributeModificationType am)
        Returns the jldap modification integer constant for the supplied attribute modification type.
        Parameters:
        am - attribute modification type
        Returns:
        integer constant