DN dn = candidate.getDn();
dn.normalize( schemaManager.getNormalizerMapping() );
if ( evaluator.evaluate( ssOld, apName, dn, candidate ) )
{
nexus.modify( new ModifyOperationContext( opContext.getSession(), dn,
getOperationalModsForRemove( name, candidate ) ) );
}
}
// search for all selected entries by the new SS and add references to subentry
Subentry subentry = subentryCache.getSubentry( name.toNormName() );
ServerEntry operational = getSubentryOperatationalAttributes( name, subentry );
DN newBaseDn = ( DN ) apName.clone();
newBaseDn.addAll( ssNew.getBase() );
searchOperationContext = new SearchOperationContext( opContext.getSession(), newBaseDn,
filter, controls );
searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );
subentries = nexus.search( searchOperationContext );
while ( subentries.next() )
{
ServerEntry candidate = subentries.get();
DN dn = candidate.getDn();
dn.normalize( schemaManager.getNormalizerMapping() );
if ( evaluator.evaluate( ssNew, apName, dn, candidate ) )
{
nexus.modify( new ModifyOperationContext( opContext.getSession(), dn,
getOperationalModsForAdd( candidate, operational ) ) );
}
}
}
else
{
next.modify( opContext );
if ( !objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
{
ServerEntry newEntry = opContext.lookup( name, ByPassConstants.LOOKUP_BYPASS );
List<Modification> subentriesOpAttrMods = getModsOnEntryModification( name, oldEntry, newEntry );
if ( subentriesOpAttrMods.size() > 0 )
{
nexus.modify( new ModifyOperationContext( opContext.getSession(), name, subentriesOpAttrMods ) );
}
}
}
}