Attribute uniqueness can be configured across a set of attributes using the multiple-attribute-behavior property. The multiple-attribute-behavior property can take the following values:
  • unique-within-each-attribute - If multiple attributes are specified, then uniqueness will be enforced for all values of each attribute, but the same value may 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-7890 and mobile=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 telephoneNumber value that matches the telephoneNumber attribute in the existing entry, then the add request will fail.
    • An entry with a mobile value that matches the mobile attribute in the existing entry, then that too will fail.
    • An entry with the same telephoneNumber and mobile attribute values (e.g., 123-456-7893) but differ from the values in the existing entry, then the add request will succeed.
  • unique-across-all-attributes-including-in-same-entry - If multiple attributes are specified, then uniqueness will be enforced across all of those attributes, so that if a value appears in one of those attributes, that value may 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-7890 and mobile=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 telephoneNumber value (e.g., 123-456-7890) that matches the telephoneNumber attribute in an existing entry, then the add request will fail.
    • An entry with a mobile value that matches the mobile attribute in an existing entry, then that too will fail.
    • An entry with a mobile value (e.g., 123-456-7890) that matches the telephoneNumber attribute in an existing entry, then that will fail.
    • An entry with a telephoneNumber value (e.g., 123-456-7891) that matches the mobile attribute in an existing entry, then that too will fail.
    • An entry with the same telephoneNumber and mobile attribute values (e.g., 123-456-7893) but differ from the values in an existing entry, then the add request will fail.
  • unique-across-all-attributes-except-in-same-entry - If multiple attributes are specified, then uniqueness will be enforced across all of those attributes, so that if a value appears in one of those attributes, that value may not be present in any of the listed attributes in other entries. However, the same value may appear in multiple attributes in the same entry. For example, assume you have an existing entry that has attributes, telephoneNumber=123-456-7890 and mobile=123-456-7891. If 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 telephoneNumber value (e.g., 123-456-7890) that matches the telephoneNumber attribute in an existing entry, then the add request will fail.
    • An entry with a mobile value that matches the mobile attribute in the existing entry, then that too will fail.
    • An entry with a mobile value (e.g., 123-456-7890) that matches the telephoneNumber attribute in an existing entry, then that will fail.
    • An entry with a telephoneNumber value (e.g., 123-456-7891) that matches the mobile attribute in an existing entry, then that will fail.
    • An entry with the same telephoneNumber and mobile attribute values (e.g., 123-456-7893) but differ from the values in an existing entry, then the add request will succeed.