Package org.ldaptive.provider.opendj
Class OpenDJUtils
- java.lang.Object
-
- org.ldaptive.provider.opendj.OpenDJUtils
-
public class OpenDJUtils extends Object
Provides methods for converting between OpenDJ specific objects and ldaptive specific objects.
-
-
Field Summary
Fields Modifier and Type Field Description private List<String>binaryAttrsAttributes that should be treated as binary.private SortBehaviorsortBehaviorLdap result sort behavior.
-
Constructor Summary
Constructors Constructor Description OpenDJUtils()Default constructor.OpenDJUtils(SortBehavior sb)Creates a new opendj util.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.forgerock.opendj.ldap.Modification[]fromAttributeModification(AttributeModification[] am)Returns opendj modifications using the supplied attribute modifications.org.forgerock.opendj.ldap.ByteString[]fromBinaryValues(Collection<byte[]> values)Returns an opendj byte string that represents the values in the supplied collection.org.forgerock.opendj.ldap.AttributefromLdapAttribute(LdapAttribute la)Returns an opendj attribute that represents the values in the supplied ldap attribute.org.forgerock.opendj.ldap.Attribute[]fromLdapAttributes(Collection<LdapAttribute> c)Returns a list of opendj attribute that represents the values in the supplied ldap attributes.org.forgerock.opendj.ldap.EntryfromLdapEntry(LdapEntry le)Returns an opendj entry that represents the values in the supplied entry.static org.forgerock.opendj.ldap.SortKey[]fromSortKey(SortKey[] sk)Returns opendj sort keys using the supplied sort keys.org.forgerock.opendj.ldap.ByteString[]fromStringValues(Collection<String> values)Returns an opendj byte string that represents the values in the supplied collection.List<String>getBinaryAttributes()Returns the list of binary attributes.protected static org.forgerock.opendj.ldap.ModificationTypegetModificationType(AttributeModificationType am)Returns the opendj modification type for the supplied attribute modification type.voidsetBinaryAttributes(String[] s)Sets the list of binary attributes.byte[][]toBinaryValues(org.forgerock.opendj.ldap.ByteString[] values)Returns byte array values for the supplied byte strings.LdapAttributetoLdapAttribute(org.forgerock.opendj.ldap.Attribute a)Returns an ldap attribute using the supplied opendj attribute.SearchEntrytoSearchEntry(org.forgerock.opendj.ldap.Entry e, ResponseControl[] c, int id)Returns a search entry using the supplied opendj entry.String[]toStringValues(org.forgerock.opendj.ldap.ByteString[] values)Returns string values for the supplied byte strings.
-
-
-
Field Detail
-
sortBehavior
private final SortBehavior sortBehavior
Ldap result sort behavior.
-
-
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 entryc- response controlsid- 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
-
-