String oldId = getEntryId( oldDn );
if ( oldId == null )
{
// This is not allowed : the old entry must exist
LdapNoSuchObjectException nse = new LdapNoSuchObjectException(
I18n.err( I18n.ERR_256_NO_SUCH_OBJECT, oldDn ) );
throw nse;
}
// Check that the new superior exist
String newSuperiorId = getEntryId( newSuperiorDn );
if ( newSuperiorId == null )
{
// This is not allowed : the new superior must exist
LdapNoSuchObjectException nse = new LdapNoSuchObjectException(
I18n.err( I18n.ERR_256_NO_SUCH_OBJECT, newSuperiorDn ) );
throw nse;
}
Dn newDn = newSuperiorDn.add( newRdn );