// That means the added Dn is already present. Check if it already has an element
if ( parentNode.hasElement() )
{
String message = "Cannot add a node to a node already having an element";
LOG.error( message );
throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, message );
}
// We may try to add twice the same Dn, without any element
else if ( element == null )
{
String message = "Cannot add a node with no element if it already exists";
LOG.error( message );
throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, message );
}
// All is fine : we are just injecting some data into an existing node
else
{
parentNode.setElement( element );