checkOidIsUnique( entry );
// Build the new MatchingRule from the given entry
String schemaName = getSchemaName( dn );
MatchingRule matchingRule = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(),
schemaName );
// At this point, the constructed MatchingRule has not been checked against the
// existing Registries. It may be broken (missing SUP, or such), it will be checked
// there, if the schema and the MatchingRule are both enabled.
Schema schema = schemaManager.getLoadedSchema( schemaName );
if ( schema.isEnabled() && matchingRule.isEnabled() )
{
if ( schemaManager.add( matchingRule ) )
{
LOG.debug( "Added {} into the enabled schema {}", dn.getName(), schemaName );
}