{
// Throw a Referral Exception
// Unlock the referral manager
directoryService.getReferralManager().unlock();
ReferralException exception = buildReferralException( parentEntry, childDn );
throw exception;
}
}
else if ( directoryService.getReferralManager().hasParentReferral( dn ) )
{
// We can't delete an entry which has an ancestor referral
// Depending on the Context.REFERRAL property value, we will throw
// a different exception.
if ( opContext.isReferralIgnored() )
{
directoryService.getReferralManager().unlock();
PartialResultException exception = buildPartialResultException( childDn );
throw exception;
}
else
{
// Unlock the referral manager
directoryService.getReferralManager().unlock();
ReferralException exception = buildReferralException( parentEntry, childDn );
throw exception;
}
}
}
// Now, check the destination
// Normalize the opContext DN
LdapDN parentDn = opContext.getParent();
parentDn.normalize( directoryService.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
// If he parent DN is a referral, or has a referral ancestor, we have to issue a AffectMultipleDsas result
// as stated by RFC 3296 Section 5.6.2
if ( directoryService.getReferralManager().isReferral( parentDn ) ||
directoryService.getReferralManager().hasParentReferral( parentDn ) )
{
// Unlock the referral manager
directoryService.getReferralManager().unlock();
// The parent DN is a referral, we have to issue a AffectMultipleDsas result
// as stated by RFC 3296 Section 5.6.2
LdapNamingException exception = new LdapNamingException( ResultCodeEnum.AFFECTS_MULTIPLE_DSAS );
exception.setRemainingName( dn );
throw exception;
}
// Unlock the ReferralManager