Interface AttributeMapper

All Known Implementing Classes:
MemberOfOverlayMapper, ObjectGUIDMapper, ObjectSIDMapper, PrimaryGroupIdMapper, RFC2307GidNumberMapper, RFC2307MemberUidMapper, RFC4519MemberDnMapper, RFC4519MemberDnRangedMapper, RFC4519MemberDnRangeOffsetMapper, UserAccountControlMapper, USNChangedMapper

public interface AttributeMapper

Maps a single attribute for an entity from an LDAP NameAttributesPair to a set of string values. This is used for non-core attributes, such as membership for specific directory types and for custom attributes.

Mandatory or field-level attributes are mapped via the LDAPUserAttributesMapper and the LDAPGroupAttributesMapper.

  • Method Details

    • getKey

      String getKey()
      Get the key to use when storing the attribute on an entity with Attributes.
      Returns:
      non-null key.
    • getValues

      Set<String> getValues(NameAttributesPair nameAttributesPair) throws Exception
      Map the value of the key from a directory entry.
      Parameters:
      nameAttributesPair - directory entry containing attributes.
      Returns:
      the set of attribute values associated with the key. If no values are present an empty set will be returned
      Throws:
      Exception - error retrieving value. The attribute will not be set.
    • getRequiredLdapAttributes

      Set<String> getRequiredLdapAttributes()
      Returns the LDAP attributes that should be requested in a search where getValues(NameAttributesPair) will be called on the results. If an implementation returns null then all attributes will be requested.
      Returns:
      the LDAP attributes that should be requested, or null for all