mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
02.04.2016 0ae0ba233fdf098993f9fc2361328ed4e3983636
opendj-server-legacy/src/main/java/org/opends/server/api/Backend.java
@@ -35,6 +35,7 @@
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.forgerock.opendj.ldap.schema.MatchingRule;
import org.forgerock.opendj.ldap.schema.UnknownSchemaElementException;
import org.opends.server.backends.RebuildConfig;
import org.opends.server.backends.VerifyConfig;
import org.opends.server.core.AddOperation;
@@ -322,9 +323,7 @@
        }
        String matchingRuleID = filter.getMatchingRuleID();
        MatchingRule matchingRule = matchingRuleID != null
            ? DirectoryServer.getMatchingRule(matchingRuleID)
            : attrType.getEqualityMatchingRule();
        MatchingRule matchingRule = getMatchingRule(attrType, matchingRuleID);
        // FIXME isIndexed() always return false down below
        return matchingRule != null && isIndexed(attrType, matchingRule);
@@ -334,6 +333,23 @@
    }
  }
  private MatchingRule getMatchingRule(AttributeType attrType, String matchingRuleID)
  {
    if (matchingRuleID == null)
    {
      return attrType.getEqualityMatchingRule();
    }
    try
    {
      return DirectoryServer.getSchema().getMatchingRule(matchingRuleID);
    }
    catch (UnknownSchemaElementException e)
    {
      return null;
    }
  }
  /**
   * Retrieves the requested entry from this backend. The caller is not required to hold any locks
   * on the specified DN.