public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
ServerEntry entry, boolean cascade ) throws Exception
{
checkNewParent( newParentName );
Schema oldSchema = getSchema( oriChildName );
MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries, oldSchema.getSchemaName() );
Set<ServerEntry> dependees = dao.listMatchingRuleDependents( oldMr );
if ( dependees != null && dependees.size() > 0 )
{
throw new LdapOperationNotSupportedException( "The matchingRule with OID " + oldMr.getOid()
+ " cannot be deleted until all entities"
+ " using this matchingRule have also been deleted. The following dependees exist: "
+ getOids( dependees ),
ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Schema newSchema = getSchema( newParentName );
ServerEntry targetEntry = ( ServerEntry ) entry.clone();
String newOid = ( String ) newRdn.getValue();
checkOidIsUnique( newOid );
targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries, newSchema.getSchemaName() );
if ( ! oldSchema.isDisabled() )
{
matchingRuleRegistry.unregister( oldMr.getOid() );
}
unregisterOids( oldMr.getOid() );
if ( ! newSchema.isDisabled() )
{
matchingRuleRegistry.register( mr );
}
else
{