Package com.nimbusds.ldapsync
Class AttributeNameMap
- java.lang.Object
-
- com.nimbusds.ldapsync.AttributeNameMap
-
public class AttributeNameMap extends Object
Bidirectional mapping between source and target directory attribute names, with optional value transformation.Mapping between attribute names may be required in situations when the source and target directories employ different object classes (schemas) for a particular detail, e.g. name, email or postal address.
Note: The get operation is case insensitive!
-
-
Constructor Summary
Constructors Constructor Description AttributeNameMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeSingleValueSelector
getSingleValueSelector(String sourceAttributeName)
String
getSourceAttributeName(String targetAttributeName)
Gets the source attribute name that maps to the specified target attribute.String
getTargetAttributeName(String sourceAttributeName)
Gets the target attribute name that maps to the specified source attribute.AttributeValueTransform
getValueTransform(String sourceAttributeName)
Gets the attribute value transform.void
put(String sourceAttributeName, String targetAttributeName, AttributeValueTransform valueTransform, AttributeSingleValueSelector singleValueSelector)
Puts a new source attribute / target attribute pair into the map.int
size()
Return the number of mappings.Collection<String>
sourceAttributes()
Returns aCollection
view the source attribute names contained in this map.Collection<String>
targetAttributes()
Returns aCollection
view of the target attribute names contained in this map.
-
-
-
Method Detail
-
put
public void put(String sourceAttributeName, String targetAttributeName, AttributeValueTransform valueTransform, AttributeSingleValueSelector singleValueSelector)
Puts a new source attribute / target attribute pair into the map.- Parameters:
sourceAttributeName
- The source attribute name.targetAttributeName
- The target attribute name.valueTransform
- The attribute value transform,null
if none.singleValueSelector
- The attribute single value selector,null
if none.
-
getSourceAttributeName
public String getSourceAttributeName(String targetAttributeName)
Gets the source attribute name that maps to the specified target attribute.- Parameters:
targetAttributeName
- The target attribute name.- Returns:
- The corresponding source attribute name,
null
if no mapping exists.
-
getTargetAttributeName
public String getTargetAttributeName(String sourceAttributeName)
Gets the target attribute name that maps to the specified source attribute.- Parameters:
sourceAttributeName
- The source attribute name.- Returns:
- The corresponding target attribute name,
null
if no mapping exists.
-
getValueTransform
public AttributeValueTransform getValueTransform(String sourceAttributeName)
Gets the attribute value transform.- Parameters:
sourceAttributeName
- The source attribute name.- Returns:
- The attribute value transform,
null
if none.
-
getSingleValueSelector
public AttributeSingleValueSelector getSingleValueSelector(String sourceAttributeName)
-
size
public int size()
Return the number of mappings.- Returns:
- The number of mappings.
-
sourceAttributes
public Collection<String> sourceAttributes()
Returns aCollection
view the source attribute names contained in this map.- Returns:
- The source attribute names.
-
targetAttributes
public Collection<String> targetAttributes()
Returns aCollection
view of the target attribute names contained in this map.- Returns:
- The target attribute names.
-
-