if (! overwriteExisting)
{
String oid = toLowerCase(matchingRule.getOID());
if (matchingRules.containsKey(oid))
{
MatchingRule conflictingRule = matchingRules.get(oid);
Message message = ERR_SCHEMA_CONFLICTING_MR_OID.
get(matchingRule.getNameOrOID(), oid,
conflictingRule.getNameOrOID());
throw new DirectoryException(
ResultCode.CONSTRAINT_VIOLATION, message);
}
for(String name:matchingRule.getAllNames())
{
if (name != null)
{
name = toLowerCase(name);
if (matchingRules.containsKey(name))
{
MatchingRule conflictingRule = matchingRules.get(name);
Message message = ERR_SCHEMA_CONFLICTING_MR_NAME.
get(matchingRule.getOID(), name,
conflictingRule.getOID());
throw new DirectoryException(
ResultCode.CONSTRAINT_VIOLATION, message);
}
}
}