ID newParentId = getEntryId( newSuperiorDn );
if ( newParentId == null )
{
// This is not allowed : the parent must exist
LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException(
I18n.err( I18n.ERR_256_NO_SUCH_OBJECT, newSuperiorDn.getName() ) );
throw ne;
}
// Now check that the new entry does not exist
ID newId = getEntryId( newDn );
if ( newId != null )
{
// This is not allowed : we should not be able to move an entry
// to an existing position
LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException(
I18n.err( I18n.ERR_250_ENTRY_ALREADY_EXISTS, newSuperiorDn.getName() ) );
throw ne;
}
// Get the entry and the old parent IDs