Configuring uniqueness across attribute sets
Configure attribute uniqueness across a set of attributes using the multiple-attribute-behavior property.
Before you begin
About this task
To enable uniqueness across attribute sets:
Steps
-
To configure the UID unique attribute plugin to apply across multiple attributes, use the
dsconfigtool.The following table details the
multiple-attribute-behaviorproperty and the values it can take.The multiple-attribute-behaviorproperty values, descriptions, and examplesValue Description Example unique-within-each-attributeIf multiple attributes are specified, then uniqueness is enforced for all values of each attribute, but the same value might appear in different attributes in the same entry or in different entries.
For example, assume you have an existing entry that has attributes
telephoneNumber=123-456-7890andmobile=123-456-7891.If you set the uniqueness plugin to have
--set "multiple-attribute-behavior:unique-within-each-attribute"and add:-
An entry with a
telephoneNumbervalue that matches thetelephoneNumberattribute in the existing entry, then the add request fails. -
An entry with a
mobilevalue that matches themobileattribute in the existing entry, then the request fails. -
An entry with the same
telephoneNumberandmobileattribute values, such as 123-456-7893, but differs from the values in the existing entry, then the add request succeeds.
unique-across-all-attributes-including-in-same-entryIf multiple attributes are specified, then uniqueness is enforced across all of those attributes. If a value appears in one of those attributes that value might not be present in any other of the listed attributes in the same entry, nor in any of the listed attributes in other entries.
For example, assume you have an existing entry that has attributes,
telephoneNumber=123-456-7890andmobile=123-456-7891.If you set the uniqueness plugin to have
--set "multiple-attribute-behavior:unique-across-all-attributes-including-in-same-entry"and add:-
An entry with a
telephoneNumbervalue, such as 123-456-7890, that matches thetelephoneNumberattribute in an existing entry, then the add request fails. -
An entry with a
mobilevalue that matches themobileattribute in an existing entry, then the request fails. -
An entry with a
mobilevalue, such as 123-456-7890, that matches thetelephoneNumberattribute in an existing entry, then that fails. -
An entry with the same
telephoneNumberandmobileattribute values, such as 123-456-7893, but differ from the values in an existing entry, then the add request fails.
unique-across-all-attributes-except-in-same-entryIf multiple attributes are specified, then uniqueness is enforced across all of those attributes. So, if a value appears in one of those attributes, that value might not be present in any of the listed attributes in other entries. However, the same value might appear in multiple attributes in the same entry.
For example, assume you have an existing entry that has attributes,
telephoneNumber=123-456-7890andmobile=123-456-7891.You set the uniqueness plugin to have
--set "multiple-attribute-behavior:unique-across-all-attributes-except-in-same-entry"and add:-
An entry with a
telephoneNumbervalue, such as 123-456-7890, that matches thetelephoneNumberattribute in an existing entry, then the add request fails. -
An entry with a
mobilevalue that matches themobileattribute in the existing entry, then the request fails. -
An entry with a
mobilevalue, such as 123-456-7890, that matches thetelephoneNumberattribute in an existing entry, then the request fails. -
An entry with a
telephoneNumbervalue, such as 123-456-7891, that matches themobileattribute in an existing entry, then the request fails. -
An entry with the same
telephoneNumberandmobileattribute values, such as 123-456-7893, but that differs from the values in an existing entry, then the add request succeeds.
Example:
The
multiple-attribute-behaviorproperty is set tounique-within-each-attribute, which indicates that uniqueness is enforced for all values of each attribute, such astelephoneNumber=123-456-7890andmobile=123-456-7891, but the same value, such as either 123-456-7890 or 123-456-7891 might appear in different attributes in the same entry or in different entries.$ dsconfig create-plugin \ --plug-in "Unique telephoneNumber and mobile" \ --type "unique-attribute" \ --set "enabled:true" \ --set "type:telephoneNumber" \ --set "type:mobile" \ --set "multiple-attribute-behavior:unique-within-each-attribute" \ --no-prompt -