Dn dn = candidate.getDn();
dn.apply( schemaManager );
if ( evaluator.evaluate( ss, apName, dn, candidate ) )
{
nexus.modify( new ModifyOperationContext( moveContext.getSession(), dn, getOperationalModsForReplace(
oldDn, newName, subentry, candidate ) ) );
}
}
subentries.close();
}
catch ( Exception e )
{
throw new LdapOperationException( e.getMessage(), e );
}
}
else
{
// A normal entry. It may be part of a SubtreeSpecifciation. In this
// case, we have to update the opAttrs (removing old ones and adding the
// new ones)
// First, an moved entry which has an AP in one of its descendant
// can't be moved.
if ( hasAdministrativeDescendant( moveContext, oldDn ) )
{
String msg = I18n.err( I18n.ERR_308 );
LOG.warn( msg );
throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
// Move the entry
next.move( moveContext );
// calculate the new Dn now for use below to modify subentry operational
// attributes contained within this regular entry with name changes
Dn newDn = moveContext.getNewDn();
List<Modification> mods = getModsOnEntryRdnChange( oldDn, newDn, entry );
// Update the entry operational attributes
if ( mods.size() > 0 )
{
nexus.modify( new ModifyOperationContext( moveContext.getSession(), newDn, mods ) );
}
}
}