Class OpenDJUtils


  • public class OpenDJUtils
    extends Object
    Provides methods for converting between OpenDJ 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

      • OpenDJUtils

        public OpenDJUtils()
        Default constructor.
      • OpenDJUtils

        public OpenDJUtils​(SortBehavior sb)
        Creates a new opendj 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
      • fromStringValues

        public org.forgerock.opendj.ldap.ByteString[] fromStringValues​(Collection<String> values)
        Returns an opendj byte string that represents the values in the supplied collection.
        Parameters:
        values - to convert to byte strings
        Returns:
        byte strings
      • fromBinaryValues

        public org.forgerock.opendj.ldap.ByteString[] fromBinaryValues​(Collection<byte[]> values)
        Returns an opendj byte string that represents the values in the supplied collection.
        Parameters:
        values - to convert to byte strings
        Returns:
        byte strings
      • toStringValues

        public String[] toStringValues​(org.forgerock.opendj.ldap.ByteString[] values)
        Returns string values for the supplied byte strings.
        Parameters:
        values - to convert to strings
        Returns:
        string values
      • toBinaryValues

        public byte[][] toBinaryValues​(org.forgerock.opendj.ldap.ByteString[] values)
        Returns byte array values for the supplied byte strings.
        Parameters:
        values - to convert to byte arrays
        Returns:
        byte array values
      • fromLdapAttribute

        public org.forgerock.opendj.ldap.Attribute fromLdapAttribute​(LdapAttribute la)
        Returns an opendj attribute that represents the values in the supplied ldap attribute.
        Parameters:
        la - ldap attribute
        Returns:
        opendj attribute
      • toLdapAttribute

        public LdapAttribute toLdapAttribute​(org.forgerock.opendj.ldap.Attribute a)
        Returns an ldap attribute using the supplied opendj attribute.
        Parameters:
        a - opendj attribute
        Returns:
        ldap attribute
      • fromLdapAttributes

        public org.forgerock.opendj.ldap.Attribute[] fromLdapAttributes​(Collection<LdapAttribute> c)
        Returns a list of opendj attribute that represents the values in the supplied ldap attributes.
        Parameters:
        c - ldap attributes
        Returns:
        opendj attributes
      • fromLdapEntry

        public org.forgerock.opendj.ldap.Entry fromLdapEntry​(LdapEntry le)
        Returns an opendj entry that represents the values in the supplied entry.
        Parameters:
        le - ldap entry
        Returns:
        opendj entry
      • toSearchEntry

        public SearchEntry toSearchEntry​(org.forgerock.opendj.ldap.Entry e,
                                         ResponseControl[] c,
                                         int id)
        Returns a search entry using the supplied opendj entry.
        Parameters:
        e - opendj entry
        c - response controls
        id - message id
        Returns:
        search entry
      • fromAttributeModification

        public org.forgerock.opendj.ldap.Modification[] fromAttributeModification​(AttributeModification[] am)
        Returns opendj modifications using the supplied attribute modifications.
        Parameters:
        am - attribute modifications
        Returns:
        opendj modifications
      • fromSortKey

        public static org.forgerock.opendj.ldap.SortKey[] fromSortKey​(SortKey[] sk)
        Returns opendj sort keys using the supplied sort keys.
        Parameters:
        sk - sort keys
        Returns:
        opendj sort keys
      • getModificationType

        protected static org.forgerock.opendj.ldap.ModificationType getModificationType​(AttributeModificationType am)
        Returns the opendj modification type for the supplied attribute modification type.
        Parameters:
        am - attribute modification type
        Returns:
        modification type