// Don't do anything if:
// 1. The configuration is disabled.
// 2. There is a change in the enable status
// i.e. (disable->enable or enable->disable). In this case, the
// ConfigManager will have already created the new Factory object.
return new ConfigChangeResult(resultCode, adminActionRequired,
messages);
}
// Since we have come here it means that this Factory is enabled and
// there is a change in the CollationMatchingRuleFactory's
// configuration.
// Deregister all the Matching Rule corresponding to this factory.
for (MatchingRule rule : getMatchingRules())
{
DirectoryServer.deregisterMatchingRule(rule);
}
// Clear the associated matching rules.
resetRules();
initializeMatchingRuleTypes(configuration.getMatchingRuleType());
for (String collation : configuration.getCollation())
{
CollationMapper mapper = new CollationMapper(collation);
String languageTag = mapper.getLanguageTag();
Locale locale = getLocale(languageTag);
createLessThanMatchingRule(mapper, locale);
createLessThanOrEqualToMatchingRule(mapper, locale);
createEqualityMatchingRule(mapper, locale);
createGreaterThanOrEqualToMatchingRule(mapper, locale);
createGreaterThanMatchingRule(mapper, locale);
createSubstringMatchingRule(mapper, locale);
}
try
{
for (MatchingRule matchingRule : getMatchingRules())
{
DirectoryServer.registerMatchingRule(matchingRule, false);
}
}
catch (DirectoryException de)
{
Message message =
WARN_CONFIG_SCHEMA_MR_CONFLICTING_MR.get(String
.valueOf(configuration.dn()), de.getMessageObject());
adminActionRequired = true;
messages.add(message);
}
currentConfig = configuration;
return new ConfigChangeResult(resultCode, adminActionRequired,
messages);
}