h2. Modification A *Modification* is a class containing an operation applie don one *[DIRAPI:Attribute]* into an *[DIRAPI:Entry]*. This is used by the *[Modify|Message (...)#ModifyRequest]* message. We can apply more than one *Modification* on an *[DIRAPI:Entry]*. There are three kind of operation we can do: * Add : add a new value, or a new attribute if it does not exist already * Delete : remove a single value, or the attribute if we remove the last value or if the value is null * Replace : replace the existing values with the newly provided values, or delete the attribute if no values are provided As usual, we have two kind of *Modification*, schema aware and schema agnostic ones. h3. Creating a modification We have two parameters to provide to create a *Modification* : * an operation (add, delete or replace) * an *[DIRAPI:Attribute]* instance, containing the values and the attribute type We can also pass a *[SchemaManager (...)]* instance, if we want the *Modification* to be schema aware. Changing an operation to make it schema aware is just a matter to call the _apply()_ method. All the other methods are basic setters and getters. Let see a simple example : {code:java} @Test public void testModification() throws LdapException { // Add the test1 and test2 values to the "cn" attribute Attribute attribute = new DefaultAttribute( atCn, "test1", "test2" ); DefaultModification modCn1 = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute ); // Remove the "test2" value attribute = new DefaultAttribute( atCn, "test2" ); DefaultModification modCn2 = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute ); // Replace the "cn" values by the test4 "value" attribute = new DefaultAttribute( atCn, "test4" ); DefaultModification modCn3 = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute ); } {code} This code does nothing but creating some modifications. They have to be sent through a *[DIRAPI:Modify]* request to the server to be effective.