Package org.bremersee.ldaptive
Interface LdaptiveEntryMapper<T>
- Type Parameters:
T- the type of the domain object
- All Superinterfaces:
org.ldaptive.beans.LdapEntryMapper<T>
- All Known Implementing Classes:
LdaptiveEntryImmutableMapper
public interface LdaptiveEntryMapper<T>
extends org.ldaptive.beans.LdapEntryMapper<T>
The ldap entry mapper.
- Author:
- Christian Bremer
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidaddAttribute(org.ldaptive.LdapEntry ldapEntry, String name, T value, boolean isBinary, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Adds the specified value to the attribute with the specified name.static <T> voidaddAttribute(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, T value, List<org.ldaptive.AttributeModification> modifications) Add attribute.static <T> voidaddAttributes(org.ldaptive.LdapEntry ldapEntry, String name, Collection<T> values, boolean isBinary, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Adds the specified values to the attribute with the specified name.static <T> voidaddAttributes(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, Collection<T> values, List<org.ldaptive.AttributeModification> modifications) Add attributes.static StringCreate dn string.static <T> TgetAttributeValue(org.ldaptive.LdapEntry ldapEntry, String name, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, T defaultValue) Gets attribute value.static <T> TgetAttributeValue(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, T defaultValue) Gets attribute value.static <T> Collection<T> getAttributeValues(org.ldaptive.LdapEntry ldapEntry, String name, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder) Gets attribute values.static <T> Collection<T> getAttributeValues(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute) Gets attribute values.static <T> List<T> getAttributeValuesAsList(org.ldaptive.LdapEntry ldapEntry, String name, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder) Gets attribute values as list.static <T> List<T> getAttributeValuesAsList(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute) Gets attribute values as list.static <T> Set<T> getAttributeValuesAsSet(org.ldaptive.LdapEntry ldapEntry, String name, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder) Gets attribute values as set.static <T> Set<T> getAttributeValuesAsSet(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute) Gets attribute values as set.default String[]Get binary attribute names.default String[]Get mapped attribute names.String[]Get object classes of the ldap entry.static StringGets rdn value (not the rdn attribute name).map(org.ldaptive.LdapEntry ldapEntry) Map a ldap entry into a domain object.voiddefault voidorg.ldaptive.AttributeModification[]mapAndComputeModifications(T source, org.ldaptive.LdapEntry destination) Map and compute attribute modifications (seeLdapEntry.computeModifications(LdapEntry, LdapEntry)**).default Optional<org.ldaptive.ModifyRequest> mapAndComputeModifyRequest(T source, org.ldaptive.LdapEntry destination) Map and compute modify request.static voidremoveAttribute(org.ldaptive.LdapEntry ldapEntry, String name, List<org.ldaptive.AttributeModification> modifications) Removes an attribute with the specified name.static <T> voidremoveAttribute(org.ldaptive.LdapEntry ldapEntry, String name, T value, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Removes an attribute with the specified value.static <T> voidremoveAttribute(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, T value, List<org.ldaptive.AttributeModification> modifications) Remove attribute.static <T> voidremoveAttributes(org.ldaptive.LdapEntry ldapEntry, String name, Collection<T> values, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Remove attributes with the specified values.static <T> voidremoveAttributes(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, Collection<T> values, List<org.ldaptive.AttributeModification> modifications) Remove attributes.static <T> voidsetAttribute(org.ldaptive.LdapEntry ldapEntry, String name, T value, boolean isBinary, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Replaces the value of the attribute with the specified value.static <T> voidsetAttribute(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, T value, List<org.ldaptive.AttributeModification> modifications) Sets attribute.static <T> voidsetAttributes(org.ldaptive.LdapEntry ldapEntry, String name, Collection<T> values, boolean isBinary, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Replaces the values of the attribute with the specified values.static <T> voidsetAttributes(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, Collection<T> values, List<org.ldaptive.AttributeModification> modifications) Sets attributes.
-
Method Details
-
getObjectClasses
String[] getObjectClasses()Get object classes of the ldap entry. The object classes are only required, if a new ldap entry should be persisted.- Returns:
- the object classes of the ldap entry
-
getMappedAttributeNames
Get mapped attribute names.- Returns:
- the mapped attribute names
-
getBinaryAttributeNames
Get binary attribute names.- Returns:
- the binary attribute names
-
mapDn
- Specified by:
mapDnin interfaceorg.ldaptive.beans.LdapEntryMapper<T>
-
map
Map a ldap entry into a domain object.- Parameters:
ldapEntry- the ldap entry- Returns:
- the domain object
-
map
- Specified by:
mapin interfaceorg.ldaptive.beans.LdapEntryMapper<T>
-
map
- Specified by:
mapin interfaceorg.ldaptive.beans.LdapEntryMapper<T>
-
mapAndComputeModifications
org.ldaptive.AttributeModification[] mapAndComputeModifications(T source, org.ldaptive.LdapEntry destination) Map and compute attribute modifications (seeLdapEntry.computeModifications(LdapEntry, LdapEntry)**).- Parameters:
source- the source (domain object); requireddestination- the destination (ldap entry); required- Returns:
- the attribute modifications
-
mapAndComputeModifyRequest
default Optional<org.ldaptive.ModifyRequest> mapAndComputeModifyRequest(T source, org.ldaptive.LdapEntry destination) Map and compute modify request.- Parameters:
source- the source (domain object); requireddestination- the destination (ldap entry); required- Returns:
- the modify request
-
getAttributeValue
static <T> T getAttributeValue(org.ldaptive.LdapEntry ldapEntry, String name, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, T defaultValue) Gets attribute value.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entry; requiredname- the name; requiredvalueTranscoder- the value transcoder; requireddefaultValue- the default value- Returns:
- the attribute value
-
getAttributeValue
static <T> T getAttributeValue(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, T defaultValue) Gets attribute value.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attributedefaultValue- the default value- Returns:
- the attribute value
-
getAttributeValues
static <T> Collection<T> getAttributeValues(org.ldaptive.LdapEntry ldapEntry, String name, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder) Gets attribute values.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entry; requiredname- the name; requiredvalueTranscoder- the value transcoder; required- Returns:
- the attribute values
-
getAttributeValues
static <T> Collection<T> getAttributeValues(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute) Gets attribute values.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attribute- Returns:
- the attribute values
-
getAttributeValuesAsSet
static <T> Set<T> getAttributeValuesAsSet(org.ldaptive.LdapEntry ldapEntry, String name, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder) Gets attribute values as set.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entry; requiredname- the name; requiredvalueTranscoder- the value transcoder; required- Returns:
- the attribute values as set
-
getAttributeValuesAsSet
static <T> Set<T> getAttributeValuesAsSet(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute) Gets attribute values as set.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attribute- Returns:
- the attribute values as set
-
getAttributeValuesAsList
static <T> List<T> getAttributeValuesAsList(org.ldaptive.LdapEntry ldapEntry, String name, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder) Gets attribute values as list.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entry; requiredname- the name; requiredvalueTranscoder- the value transcoder; required- Returns:
- the attribute values as list
-
getAttributeValuesAsList
static <T> List<T> getAttributeValuesAsList(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute) Gets attribute values as list.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attribute- Returns:
- the attribute values as list
-
setAttribute
static <T> void setAttribute(org.ldaptive.LdapEntry ldapEntry, String name, T value, boolean isBinary, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Replaces the value of the attribute with the specified value.- Type Parameters:
T- the type of the domain object- Parameters:
ldapEntry- the ldap entry; requiredname- the attribute name; requiredvalue- the attribute value; can be nullisBinary- specifies whether the attribute value is binary or notvalueTranscoder- the value transcoder (can be null if value is also null)modifications- the list of modifications; required
-
setAttribute
static <T> void setAttribute(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, T value, List<org.ldaptive.AttributeModification> modifications) Sets attribute.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attributevalue- the valuemodifications- the modifications
-
setAttributes
static <T> void setAttributes(org.ldaptive.LdapEntry ldapEntry, String name, Collection<T> values, boolean isBinary, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Replaces the values of the attribute with the specified values.- Type Parameters:
T- the type of the domain object- Parameters:
ldapEntry- the ldap entry; requiredname- the attribute name; requiredvalues- the values of the attributeisBinary- specifies whether the attribute value is binary or notvalueTranscoder- the value transcoder (can be null if values is also null)modifications- the list of modifications; required
-
setAttributes
static <T> void setAttributes(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, Collection<T> values, List<org.ldaptive.AttributeModification> modifications) Sets attributes.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attributevalues- the valuesmodifications- the modifications
-
addAttribute
static <T> void addAttribute(org.ldaptive.LdapEntry ldapEntry, String name, T value, boolean isBinary, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Adds the specified value to the attribute with the specified name.- Type Parameters:
T- the type of the domain object- Parameters:
ldapEntry- the ldap entry; requiredname- the attribute name; requiredvalue- the attribute value; can be nullisBinary- specifies whether the attribute value is binary or notvalueTranscoder- the value transcoder; requiredmodifications- the list of modifications; required
-
addAttribute
static <T> void addAttribute(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, T value, List<org.ldaptive.AttributeModification> modifications) Add attribute.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attributevalue- the valuemodifications- the modifications
-
addAttributes
static <T> void addAttributes(org.ldaptive.LdapEntry ldapEntry, String name, Collection<T> values, boolean isBinary, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Adds the specified values to the attribute with the specified name.- Type Parameters:
T- the type of the domain object- Parameters:
ldapEntry- the ldap entry; requiredname- the attribute name; requiredvalues- the attribute values; can be nullisBinary- specifies whether the attribute value is binary or notvalueTranscoder- the value transcoder; requiredmodifications- the list of modifications; required
-
addAttributes
static <T> void addAttributes(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, Collection<T> values, List<org.ldaptive.AttributeModification> modifications) Add attributes.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attributevalues- the valuesmodifications- the modifications
-
removeAttribute
static void removeAttribute(org.ldaptive.LdapEntry ldapEntry, String name, List<org.ldaptive.AttributeModification> modifications) Removes an attribute with the specified name.- Parameters:
ldapEntry- the ldap entry; requiredname- the name; requiredmodifications- the modifications; required
-
removeAttribute
static <T> void removeAttribute(org.ldaptive.LdapEntry ldapEntry, String name, T value, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Removes an attribute with the specified value. If the value isnull, the whole attribute will be removed.- Type Parameters:
T- the type of the domain object- Parameters:
ldapEntry- the ldap entry; requiredname- the name; requiredvalue- the value; can be nullvalueTranscoder- the value transcoder; requiredmodifications- the modifications; required
-
removeAttribute
static <T> void removeAttribute(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, T value, List<org.ldaptive.AttributeModification> modifications) Remove attribute.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attributevalue- the valuemodifications- the modifications
-
removeAttributes
static <T> void removeAttributes(org.ldaptive.LdapEntry ldapEntry, String name, Collection<T> values, org.ldaptive.transcode.ValueTranscoder<T> valueTranscoder, List<org.ldaptive.AttributeModification> modifications) Remove attributes with the specified values. If values are empty ornull, no attributes will be removed.- Type Parameters:
T- the type of the domain object- Parameters:
ldapEntry- the ldap entry; requiredname- the name; requiredvalues- the valuesvalueTranscoder- the value transcoder; requiredmodifications- the modifications; required
-
removeAttributes
static <T> void removeAttributes(org.ldaptive.LdapEntry ldapEntry, LdaptiveAttribute<T> attribute, Collection<T> values, List<org.ldaptive.AttributeModification> modifications) Remove attributes.- Type Parameters:
T- the type parameter- Parameters:
ldapEntry- the ldap entryattribute- the attributevalues- the valuesmodifications- the modifications
-
createDn
Create dn string.- Parameters:
rdn- the rdn; requiredrdnValue- the rdn value; requiredbaseDn- the base dn; required- Returns:
- the string
-
getRdn
Gets rdn value (not the rdn attribute name).- Parameters:
dn- the dn- Returns:
- the rdn
-