A mapper that handle creation of modification items from variables and their environment. This class uses a LDAP-Java map and sets of operations expressed in Java namespace to generate a complete set of {@see javax.naming.directory.ModificationItem} items. It allows finer controlover the modification process than {@see speculoos.jndi.mappers.ModificationsFromAttributes}. *
By convention, if the content of an operation tag is the empty string, after environment variables subsitution, this is considered an empty value which may means different semantics according the operation required:
- if a replace operation ( {@link javax.naming.directory.DirContext#REPLACE_ATTRIBUTE}), an empty attribute value means that all values in the attribute are deleted, leading eventually to deletion of attribute if it must hold some value,
- if an add operation ( {@link javax.naming.directory.DirContext#ADD_ATTRIBUTE}), an exception will be thrown,
- if a remove operation ( {@link javax.naming.directory.DirContext#REMOVE_ATTRIBUTE}), an empty attribute value means that the attribute itseld is deleted.
The various operations related methods {@link #modifyAttribute(String,VariableString)}, {@link #addAttribute(String,VariableString)} and{@link #deleteAttribute(String,VariableString)} may be called in any orderbut this order will be preserved in the backend query. For example, if one does the following sequence of operations: ModifyMapperImpl mmi = ... mmi.modifyAttribute("toto",new VariableString("tutu")); mmi.addAttribute("titi",new VariableString("titi")); mmi.modifyAttribute("toto",new VariableString("tata"));
then a modify attribute on toto with values ["tutu","tata"]
will be created and executed before an add operation on attribute titi
.
@author nono