Package org.nasutekds.server.api

Examples of org.nasutekds.server.api.MatchingRule


   * Tests the assertion syntax of the relative time matching rules.
   */
  @Test(dataProvider= "relativeTimeValues")
  public void testRelativeTimeMatchingRuleAssertionSyntax(String assertion,boolean isValid)
  {
    MatchingRule relativeTimeLTRule =
            DirectoryServer.getOrderingMatchingRule(
            EXT_OMR_RELATIVE_TIME_LT_ALT_NAME.toLowerCase());
    boolean exception = false;
    try
    {
      relativeTimeLTRule.normalizeAssertionValue(ByteString.valueOf(assertion));
    }
    catch(DirectoryException e)
    {
      //invalid values will throw an exception.
      exception = true;
View Full Code Here


   * Tests the assertion syntax of the partial date and time matching rules.
   */
  @Test(dataProvider= "partialDateTimeSyntaxes")
  public void testPartialDateTimeMatchingRuleAssertionSyntax(String assertion,boolean isValid)
  {
    MatchingRule partialDTRule =
            DirectoryServer.getMatchingRule(EXT_PARTIAL_DATE_TIME_OID);
    boolean exception = false;
    try
    {
      partialDTRule.normalizeAssertionValue(ByteString.valueOf(assertion));
    }
    catch(DirectoryException e)
    {
      //invalid values will throw an exception.
      exception = true;
View Full Code Here

      HashMap<String, MatchingRule> matchingRuleNameMap = new HashMap<String,
      MatchingRule>();
      for (String key : schema.getMatchingRules().keySet())
      {
        MatchingRule rule = schema.getMatchingRule(key);
        matchingRuleNameMap.put(rule.getNameOrOID(), rule);
      }

      orderedKeys.clear();
      orderedKeys.addAll(matchingRuleNameMap.keySet());
      for (String key : orderedKeys)
      {
        MatchingRule matchingRule = matchingRuleNameMap.get(key);
        if (matchingRule instanceof ApproximateMatchingRule)
        {
          approximateElements.add(matchingRule);
        }
        else if (matchingRule instanceof EqualityMatchingRule)
View Full Code Here

        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);
              }
            }
View Full Code Here

      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);
          }
        }
       }
View Full Code Here

      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);
              }
           }
View Full Code Here

      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);
            }
          }
View Full Code Here

      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);
            }
          }
View Full Code Here

        Message message = ERR_LDAP_FILTER_VALUE_WITH_NO_ATTR_OR_MR.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      else
      {
        MatchingRule mr =
             DirectoryServer.getMatchingRule(toLowerCase(matchingRuleID));
        if (mr == null)
        {
          Message message =
              ERR_LDAP_FILTER_UNKNOWN_MATCHING_RULE.get(matchingRuleID);
          throw new DirectoryException(ResultCode.INAPPROPRIATE_MATCHING,
                                       message);
        }
        else
        {
          ByteString normalizedValue = mr.normalizeValue(assertionValue);
          value = AttributeValues.create(assertionValue,
              normalizedValue);
        }
      }
    }
View Full Code Here

      }
    }

    if (schemaName == null)
    {
      MatchingRule matchingRule = DirectoryServer.getMatchingRule(lowerValue);
      if (matchingRule != null)
      {
        schemaName = matchingRule.getNameOrOID();
      }
    }

    if (schemaName == null)
    {
View Full Code Here

TOP

Related Classes of org.nasutekds.server.api.MatchingRule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.