new LinkedList<AttributeValue>();
newEntry.removeAttribute(a, missingValues);
if (missingValues.isEmpty())
{
modifications.add(new Modification(ModificationType.DELETE, a));
}
}
}
// Add the new RDN values to the entry.
int newRDNValues = newRDN.getNumValues();
for (int i=0; i < newRDNValues; i++)
{
Attribute a = Attributes.create(
newRDN.getAttributeType(i),
newRDN.getAttributeName(i),
newRDN.getAttributeValue(i));
LinkedList<AttributeValue> duplicateValues =
new LinkedList<AttributeValue>();
newEntry.addAttribute(a, duplicateValues);
if (duplicateValues.isEmpty())
{
// If the associated attribute type is marked NO-USER-MODIFICATION, then
// refuse the update.
if (a.getAttributeType().isNoUserModification())
{
if (! (isInternalOperation() || isSynchronizationOperation()))
{
throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
ERR_MODDN_NEW_RDN_ATTR_IS_NO_USER_MOD.get(
String.valueOf(entryDN), a.getName()));
}
}
else
{
modifications.add(new Modification(ModificationType.ADD, a));
}
}
}
// If the server is configured to check the schema and the operation is not