com.atlassian.crowd.directory.ldap.mapper.attribute
Interface AttributeMapper

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

public interface AttributeMapper

Maps a single attribute for an entity from an LDAP DirContextAdapter 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 Summary
 String getKey()
          Get the key to use when storing the attribute on an entity with Attributes.
 Set<String> getRequiredLdapAttributes()
          Returns the LDAP attributes that should be requested in a search where getValues(DirContextAdapter) will be called on the results.
 Set<String> getValues(org.springframework.ldap.core.DirContextAdapter ctx)
          Map the value of the key from the directory context.
 

Method Detail

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(org.springframework.ldap.core.DirContextAdapter ctx)
                      throws Exception
Map the value of the key from the directory context.

Parameters:
ctx - directory context 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(DirContextAdapter) 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


Copyright © 2013 Atlassian. All Rights Reserved.