* @param msgId message id number
*/
private int changeModifyEntry( LdifEntry entry, int messageId ) throws IOException, DecoderException,
InvalidNameException, NamingException, EncoderException
{
ModifyRequestCodec modifyRequest = new ModifyRequestCodec();
String dn = entry.getDn().getName();
if ( isDebugEnabled() )
{
System.out.println( "Modify of entry " + dn );
}
modifyRequest.setObject( new DN( dn ) );
modifyRequest.initModifications();
for ( Modification modification: entry.getModificationItems() )
{
modifyRequest.setCurrentOperation( modification.getOperation() );
modifyRequest.addAttributeTypeAndValues( modification.getAttribute().getId() );
for ( Value<?> value:modification.getAttribute() )
{
modifyRequest.addAttributeValue( value );
}
}
modifyRequest.setMessageId( messageId );
// Encode and send the delete request
ByteBuffer bb = modifyRequest.encode();
bb.flip();
sendMessage( bb );
bb.clear();