This interface defines the valid operations on a particular attribute of a directory entry.
An attribute can have zero or more values. The value may be null.
When there are multiple values for a particular attribute, the collection of values may be specifically ordered or unordered. This interface provides a method for determining whether the order is maintained.
If the values of an attribute are ordered, then duplicates are allowed. If the values are unordered then duplicates are not allowed.
If the values are unordered then the indexed operations work as if the values added previously to the attribute had been done using ordered semantics. For example, if the values "a", "b" and "c" were previously added to an unordered attribute using "add("a"); add("b"); add("c");
", it is equivalent to adding the same objects to an ordered attribute using "add(0,"a"); add(1,"b"); add(2,"c");
". In this case, if we do "remove(1)
" on the unordered list, the value "b" is removed, changing the index of "c" to 1.
Multiple null values can be added to an attribute. It is not the same as having no values on an attribute. If a null value is added to an unordered attribute which already has a null value, the add
method has no effect.
A directory may optionally provide information about the syntax of an attribute's value via a schema. The methods getAttributeDefinition
and getAttributeSyntaxDefinition
return the schema definitions if they exist.
Note that updates to the attribute via ths interface do not affect the directory directly. The only mechanism for modifying the directory is through the {@link DirContext}.
Concrete implementations of this Attribute
interface may be either static or dynamic, and this interface does not make any distinction between the two types. A static attribute implementation retrieves its value from the directory once and stores it locally, a dynamic attribute implementation will go back to the directory for each request.