Checkpoint commit for OPENDJ-1308 Migrate schema support
Code Review : CR-3230
Align OrderingMatchingRule class on the SDK and replace references to
this class by reference to MatchingRule interface
* Update MatchingRule interface to match SDK equivalent class
** Add comparator() method in
** Add getGreaterOrEqualAssertion() and getLessOrEqualAssertion() methods
* Implement new methods in AbstractMatchingRule and AbstractOrderingMatchingRule
classes
* Use Assertions instead of compareValues() method when using an OrderingMatchingRule
* Use comparator when needed
* Update all classes referencing OrderingMatchingRule class
| | |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.forgerock.opendj.ldap.schema.AttributeUsage; |
| | |
| | | } |
| | | } |
| | | |
| | | private OrderingMatchingRule getOrderingMatchingRule() |
| | | private MatchingRule getOrderingMatchingRule() |
| | | { |
| | | if (ordering.getSelectedIndex() == 0) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | return (OrderingMatchingRule)ordering.getSelectedItem(); |
| | | return (MatchingRule)ordering.getSelectedItem(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private OrderingMatchingRule getOrderingMatchingRule() |
| | | private MatchingRule getOrderingMatchingRule() |
| | | { |
| | | if (ordering.getSelectedIndex() == 0) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | return (OrderingMatchingRule)ordering.getSelectedItem(); |
| | | return (MatchingRule)ordering.getSelectedItem(); |
| | | } |
| | | } |
| | | |
| | |
| | | package org.opends.server.api; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Comparator; |
| | | |
| | | import org.forgerock.opendj.ldap.Assertion; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | |
| | | import org.forgerock.opendj.ldap.DecodeException; |
| | | import org.forgerock.opendj.ldap.schema.Schema; |
| | | import org.forgerock.opendj.ldap.schema.Syntax; |
| | | import org.forgerock.opendj.ldap.spi.IndexQueryFactory; |
| | | |
| | | /** |
| | | * This class provides default implementation of MatchingRule. A |
| | |
| | | public abstract class AbstractMatchingRule implements MatchingRule |
| | | { |
| | | |
| | | private static final Assertion UNDEFINED_ASSERTION = new Assertion() |
| | | { |
| | | @Override |
| | | public ConditionResult matches(final ByteSequence normalizedAttributeValue) |
| | | { |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | | @Override |
| | | public <T> T createIndexQuery(IndexQueryFactory<T> factory) |
| | | throws DecodeException |
| | | { |
| | | // Subclassing this class will always work, albeit inefficiently. |
| | | // This is better than throwing an exception for no good reason. |
| | | return factory.createMatchAllQuery(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Assertion getGreaterOrEqualAssertion(ByteSequence value) |
| | | throws DecodeException |
| | | { |
| | | return UNDEFINED_ASSERTION; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Assertion getLessOrEqualAssertion(ByteSequence value) |
| | | throws DecodeException |
| | | { |
| | | return UNDEFINED_ASSERTION; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isObsolete() |
| | | { |
| | | return false; |
| | |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | | private static final Comparator<ByteSequence> DEFAULT_COMPARATOR = |
| | | new Comparator<ByteSequence>() |
| | | { |
| | | @Override |
| | | public int compare(final ByteSequence o1, final ByteSequence o2) |
| | | { |
| | | return o1.compareTo(o2); |
| | | } |
| | | }; |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Comparator<ByteSequence> comparator() |
| | | { |
| | | return DEFAULT_COMPARATOR; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * attributes with this syntax, or {@code null} if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public abstract OrderingMatchingRule getOrderingMatchingRule(); |
| | | public abstract MatchingRule getOrderingMatchingRule(); |
| | | |
| | | |
| | | |
| | |
| | | package org.opends.server.api; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Comparator; |
| | | |
| | | import org.forgerock.opendj.ldap.Assertion; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | |
| | | /** |
| | | * Whole class to be replaced by the equivalent SDK class. |
| | | * |
| | | * @param value |
| | | * @param assertionValue |
| | | * the value |
| | | * @return SDK syntax |
| | | * @throws DecodeException |
| | | * if problem |
| | | */ |
| | | Assertion getAssertion(final ByteSequence value) throws DecodeException; |
| | | Assertion getAssertion(final ByteSequence assertionValue) throws DecodeException; |
| | | |
| | | /** |
| | | * Returns the normalized form of the provided assertion value, which is |
| | | * best suited for efficiently performing greater than or equal ordering |
| | | * matching operations on that value. The assertion value is guaranteed to |
| | | * be valid against this matching rule's assertion syntax. |
| | | * |
| | | * @param assertionValue |
| | | * The syntax checked assertion value to be normalized. |
| | | * @return The normalized version of the provided assertion value. |
| | | * @throws DecodeException |
| | | * if the syntax of the value is not valid. |
| | | */ |
| | | public Assertion getGreaterOrEqualAssertion(final ByteSequence assertionValue) throws DecodeException; |
| | | |
| | | /** |
| | | * Returns the normalized form of the provided assertion value, which is |
| | | * best suited for efficiently performing greater than or equal ordering |
| | | * matching operations on that value. The assertion value is guaranteed to |
| | | * be valid against this matching rule's assertion syntax. |
| | | * |
| | | * @param assertionValue |
| | | * The syntax checked assertion value to be normalized. |
| | | * @return The normalized version of the provided assertion value. |
| | | * @throws DecodeException |
| | | * if the syntax of the value is not valid. |
| | | */ |
| | | public Assertion getLessOrEqualAssertion(final ByteSequence assertionValue) throws DecodeException; |
| | | |
| | | /** |
| | | * Indicates whether this matching rule is declared "OBSOLETE". The |
| | |
| | | * The buffer to which the information should be appended. |
| | | */ |
| | | void toString(StringBuilder buffer); |
| | | |
| | | /** |
| | | * Get a comparator that can be used to compare the attribute values |
| | | * normalized by this matching rule. |
| | | * |
| | | * @return A comparator that can be used to compare the attribute values |
| | | * normalized by this matching rule. |
| | | */ |
| | | Comparator<ByteSequence> comparator(); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether this virtual attribute provider will generate |
| | | * any value for the provided entry that is greater than or equal to |
| | | * the given value. |
| | | * Indicates whether this virtual attribute provider will generate any value |
| | | * for the provided entry that is greater than or equal to the given value. |
| | | * |
| | | * @param entry The entry for which to make the determination. |
| | | * @param rule The virtual attribute rule which defines the |
| | | * constraints for the virtual attribute. |
| | | * @param value The value for which to make the determination. |
| | | * |
| | | * @return {@code UNDEFINED} if the associated attribute type does |
| | | * not have an ordering matching rule, {@code TRUE} if at |
| | | * least one of the generated values will be greater than |
| | | * or equal to the specified value, or {@code FALSE} if |
| | | * none of the generated values will be greater than or |
| | | * equal to the specified value. |
| | | * @param entry |
| | | * The entry for which to make the determination. |
| | | * @param rule |
| | | * The virtual attribute rule which defines the constraints for the |
| | | * virtual attribute. |
| | | * @param assertionValue |
| | | * The value for which to make the determination. |
| | | * @return {@code UNDEFINED} if the associated attribute type does not have an |
| | | * ordering matching rule, {@code TRUE} if at least one of the |
| | | * generated values will be greater than or equal to the specified |
| | | * value, or {@code FALSE} if none of the generated values will be |
| | | * greater than or equal to the specified value. |
| | | */ |
| | | public ConditionResult greaterThanOrEqualTo(Entry entry, |
| | | VirtualAttributeRule rule, |
| | | ByteString value) |
| | | ByteString assertionValue) |
| | | { |
| | | OrderingMatchingRule matchingRule = |
| | | rule.getAttributeType().getOrderingMatchingRule(); |
| | | MatchingRule matchingRule = rule.getAttributeType().getOrderingMatchingRule(); |
| | | if (matchingRule == null) |
| | | { |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | | ByteString normalizedValue; |
| | | Assertion assertion = null; |
| | | try |
| | | { |
| | | normalizedValue = matchingRule.normalizeAttributeValue(value); |
| | | assertion = matchingRule.getGreaterOrEqualAssertion(assertionValue); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize the provided value => return "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString nv = matchingRule.normalizeAttributeValue(v); |
| | | if (matchingRule.compareValues(nv, normalizedValue) >= 0) |
| | | if (assertion.matches(matchingRule.normalizeAttributeValue(v)).toBoolean()) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize one of the attribute values. |
| | | // We will return "undefined" if we can't find a definite match |
| | | result = ConditionResult.UNDEFINED; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether this virtual attribute provider will generate |
| | | * any value for the provided entry that is less than or equal to |
| | | * the given value. |
| | | * Indicates whether this virtual attribute provider will generate any value |
| | | * for the provided entry that is less than or equal to the given value. |
| | | * |
| | | * @param entry The entry for which to make the determination. |
| | | * @param rule The virtual attribute rule which defines the |
| | | * constraints for the virtual attribute. |
| | | * @param value The value for which to make the determination. |
| | | * |
| | | * @return {@code UNDEFINED} if the associated attribute type does |
| | | * not have an ordering matching rule, {@code TRUE} if at |
| | | * least one of the generated values will be less than or |
| | | * equal to the specified value, or {@code FALSE} if none |
| | | * of the generated values will be greater than or equal to |
| | | * the specified value. |
| | | * @param entry |
| | | * The entry for which to make the determination. |
| | | * @param rule |
| | | * The virtual attribute rule which defines the constraints for the |
| | | * virtual attribute. |
| | | * @param assertionValue |
| | | * The value for which to make the determination. |
| | | * @return {@code UNDEFINED} if the associated attribute type does not have an |
| | | * ordering matching rule, {@code TRUE} if at least one of the |
| | | * generated values will be less than or equal to the specified value, |
| | | * or {@code FALSE} if none of the generated values will be greater |
| | | * than or equal to the specified value. |
| | | */ |
| | | public ConditionResult lessThanOrEqualTo(Entry entry, |
| | | VirtualAttributeRule rule, |
| | | ByteString value) |
| | | ByteString assertionValue) |
| | | { |
| | | OrderingMatchingRule matchingRule = |
| | | rule.getAttributeType().getOrderingMatchingRule(); |
| | | MatchingRule matchingRule = rule.getAttributeType().getOrderingMatchingRule(); |
| | | if (matchingRule == null) |
| | | { |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | | ByteString normalizedValue; |
| | | Assertion assertion = null; |
| | | try |
| | | { |
| | | normalizedValue = matchingRule.normalizeAttributeValue(value); |
| | | assertion = matchingRule.getLessOrEqualAssertion(assertionValue); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize the provided value => return "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString nv = matchingRule.normalizeAttributeValue(v); |
| | | if (matchingRule.compareValues(nv, normalizedValue) <= 0) |
| | | if (assertion.matches(matchingRule.normalizeAttributeValue(v)).toBoolean()) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | |
| | | * @param entry The entry for which to make the determination. |
| | | * @param rule The virtual attribute rule which defines the |
| | | * constraints for the virtual attribute. |
| | | * @param value The value for which to make the determination. |
| | | * @param assertionValue The value for which to make the determination. |
| | | * |
| | | * @return {@code UNDEFINED} if the associated attribute type does |
| | | * not have an approximate matching rule, {@code TRUE} if at |
| | |
| | | */ |
| | | public ConditionResult approximatelyEqualTo(Entry entry, |
| | | VirtualAttributeRule rule, |
| | | ByteString value) |
| | | ByteString assertionValue) |
| | | { |
| | | MatchingRule matchingRule = rule.getAttributeType().getApproximateMatchingRule(); |
| | | if (matchingRule == null) |
| | |
| | | Assertion assertion = null; |
| | | try |
| | | { |
| | | assertion = matchingRule.getAssertion(value); |
| | | assertion = matchingRule.getAssertion(assertionValue); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | result = assertion.matches(matchingRule.normalizeAttributeValue(v)); |
| | | if (assertion.matches(matchingRule.normalizeAttributeValue(v)).toBoolean()) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | try |
| | | { |
| | | // Use the ordering matching rule to normalize the value. |
| | | OrderingMatchingRule orderingRule = |
| | | MatchingRule orderingRule = |
| | | filter.getAttributeType().getOrderingMatchingRule(); |
| | | // FIXME JNR this looks wrong, it should use normalizeAssertionValue() |
| | | byte[] normalizedValue = orderingRule.normalizeAttributeValue( |
| | |
| | | try |
| | | { |
| | | // Use the ordering matching rule to normalize the values. |
| | | OrderingMatchingRule orderingRule = |
| | | MatchingRule orderingRule = |
| | | getAttributeType().getOrderingMatchingRule(); |
| | | |
| | | // Set the lower and upper bounds for a range search. |
| | |
| | | import org.forgerock.opendj.ldap.schema.Schema; |
| | | import org.forgerock.opendj.ldap.spi.IndexingOptions; |
| | | import org.opends.server.api.ExtensibleIndexer; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.types.AttributeType; |
| | | |
| | | /** |
| | |
| | | * The attribute type ordering matching rule which is also the |
| | | * comparator for the index keys generated by this class. |
| | | */ |
| | | private OrderingMatchingRule orderingRule; |
| | | private MatchingRule orderingRule; |
| | | |
| | | |
| | | /** |
| | |
| | | import org.opends.server.admin.std.meta.LocalDBVLVIndexCfgDefn.Scope; |
| | | import org.opends.server.admin.std.server.LocalDBVLVIndexCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.controls.ServerSideSortRequestControl; |
| | | import org.opends.server.controls.VLVRequestControl; |
| | | import org.opends.server.controls.VLVResponseControl; |
| | |
| | | |
| | | String[] sortAttrs = config.getSortOrder().split(" "); |
| | | SortKey[] sortKeys = new SortKey[sortAttrs.length]; |
| | | OrderingMatchingRule[] orderingRules = |
| | | new OrderingMatchingRule[sortAttrs.length]; |
| | | MatchingRule[] orderingRules = |
| | | new MatchingRule[sortAttrs.length]; |
| | | boolean[] ascending = new boolean[sortAttrs.length]; |
| | | for(int i = 0; i < sortAttrs.length; i++) |
| | | { |
| | |
| | | |
| | | String[] sortAttrs = cfg.getSortOrder().split(" "); |
| | | SortKey[] sortKeys = new SortKey[sortAttrs.length]; |
| | | OrderingMatchingRule[] orderingRules = |
| | | new OrderingMatchingRule[sortAttrs.length]; |
| | | MatchingRule[] orderingRules = |
| | | new MatchingRule[sortAttrs.length]; |
| | | boolean[] ascending = new boolean[sortAttrs.length]; |
| | | for(int i = 0; i < sortAttrs.length; i++) |
| | | { |
| | |
| | | { |
| | | String[] sortAttrs = cfg.getSortOrder().split(" "); |
| | | SortKey[] sortKeys = new SortKey[sortAttrs.length]; |
| | | OrderingMatchingRule[] orderingRules = |
| | | new OrderingMatchingRule[sortAttrs.length]; |
| | | MatchingRule[] orderingRules = |
| | | new MatchingRule[sortAttrs.length]; |
| | | boolean[] ascending = new boolean[sortAttrs.length]; |
| | | for(int i = 0; i < sortAttrs.length; i++) |
| | | { |
| | |
| | | import java.io.Serializable; |
| | | import java.util.Comparator; |
| | | |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.DecodeException; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.DirectoryException; |
| | | |
| | |
| | | */ |
| | | static final long serialVersionUID = 1585167927344130604L; |
| | | |
| | | private OrderingMatchingRule[] orderingRules; |
| | | private MatchingRule[] orderingRules; |
| | | |
| | | private boolean[] ascending; |
| | | |
| | |
| | | * @param ascending The array of booleans indicating the ordering for |
| | | * each value. |
| | | */ |
| | | public VLVKeyComparator(OrderingMatchingRule[] orderingRules, |
| | | public VLVKeyComparator(MatchingRule[] orderingRules, |
| | | boolean[] ascending) |
| | | { |
| | | this.orderingRules = orderingRules; |
| | |
| | | return -1; |
| | | } |
| | | |
| | | int result; |
| | | if(ascending[j]) |
| | | { |
| | | result = orderingRules[j].compare(b1Bytes, b2Bytes); |
| | | } |
| | | else |
| | | { |
| | | result = orderingRules[j].compare(b2Bytes, b1Bytes); |
| | | } |
| | | final Comparator<ByteSequence> comp = orderingRules[j].comparator(); |
| | | final ByteString val1 = ByteString.valueOf(b1Bytes); |
| | | final ByteString val2 = ByteString.valueOf(b2Bytes); |
| | | final int result = ascending[j] ? comp.compare(val1, val2) : comp.compare(val2, val1); |
| | | |
| | | if(result != 0) |
| | | { |
| | |
| | | return -1; |
| | | } |
| | | |
| | | int result; |
| | | if(ascending[j]) |
| | | { |
| | | result = orderingRules[j].compareValues(b1Bytes, b2Bytes); |
| | | } |
| | | else |
| | | { |
| | | result = orderingRules[j].compareValues(b2Bytes, b1Bytes); |
| | | } |
| | | final Comparator<ByteSequence> comp = orderingRules[j].comparator(); |
| | | final int result = ascending[j] ? comp.compare(b1Bytes, b2Bytes) : comp.compare(b2Bytes, b1Bytes); |
| | | |
| | | if(result != 0) |
| | | { |
| | |
| | | import org.forgerock.opendj.ldap.Assertion; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ConditionResult; |
| | | import org.forgerock.opendj.ldap.DecodeException; |
| | | import org.forgerock.util.Reject; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | |
| | | private MatchingRule matchingRule; |
| | | |
| | | // The ordering matching rule for this matched values filter. |
| | | private OrderingMatchingRule orderingMatchingRule; |
| | | private MatchingRule orderingMatchingRule; |
| | | |
| | | // The matching rule ID for this matched values filter. |
| | | private final String matchingRuleID; |
| | |
| | | * @return The ordering matching rule that should be used for this matched |
| | | * values filter, or <CODE>null</CODE> if there is none. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | if (orderingMatchingRule == null) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString nv = orderingMatchingRule.normalizeAssertionValue(value); |
| | | return orderingMatchingRule.compareValues( |
| | | nv, orderingMatchingRule.normalizeAttributeValue(value)) >= 0; |
| | | ByteString normValue = orderingMatchingRule.normalizeAttributeValue(value); |
| | | Assertion assertion = orderingMatchingRule.getGreaterOrEqualAssertion(assertionValue); |
| | | return assertion.matches(normValue).toBoolean(); |
| | | } |
| | | catch (Exception e) |
| | | catch (DecodeException e) |
| | | { |
| | | logger.traceException(e); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString nv = orderingMatchingRule.normalizeAssertionValue(value); |
| | | return orderingMatchingRule.compareValues( |
| | | nv, orderingMatchingRule.normalizeAttributeValue(value)) <= 0; |
| | | ByteString normValue = orderingMatchingRule.normalizeAttributeValue(value); |
| | | Assertion assertion = orderingMatchingRule.getLessOrEqualAssertion(assertionValue); |
| | | return assertion.matches(normValue).toBoolean(); |
| | | } |
| | | catch (Exception e) |
| | | catch (DecodeException e) |
| | | { |
| | | logger.traceException(e); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString normValue = approximateMatchingRule.normalizeAttributeValue(value); |
| | | Assertion assertion = approximateMatchingRule.getAssertion(assertionValue); |
| | | ByteString nv = approximateMatchingRule.normalizeAttributeValue(value); |
| | | return assertion.matches(nv).toBoolean(); |
| | | return assertion.matches(normValue).toBoolean(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | |
| | | try |
| | | { |
| | | ByteString nv1 = matchingRule.normalizeAttributeValue(value); |
| | | ByteString normValue = matchingRule.normalizeAttributeValue(value); |
| | | Assertion assertion = matchingRule.getAssertion(assertionValue); |
| | | return assertion.matches(nv1) == ConditionResult.TRUE; |
| | | return assertion.matches(normValue).toBoolean(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | import java.util.StringTokenizer; |
| | | import java.io.IOException; |
| | | |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.forgerock.opendj.io.*; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | |
| | | new SortOrder(sortKeys.toArray(new SortKey[0]))); |
| | | } |
| | | |
| | | OrderingMatchingRule orderingRule = null; |
| | | MatchingRule orderingRule = null; |
| | | boolean ascending = true; |
| | | if(reader.hasNextElement() && |
| | | reader.peekType() == TYPE_ORDERING_RULE_ID) |
| | |
| | | return new SortOrder(sortKeys.toArray(new SortKey[0])); |
| | | } |
| | | |
| | | OrderingMatchingRule orderingRule = null; |
| | | MatchingRule orderingRule = null; |
| | | if(decodedKey[1] != null) |
| | | { |
| | | orderingRule = |
| | |
| | | import org.opends.server.api.KeyManagerProvider; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.api.MonitorProvider; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.PasswordGenerator; |
| | | import org.opends.server.api.PasswordStorageScheme; |
| | | import org.opends.server.api.PasswordValidator; |
| | |
| | | * @return The requested ordering matching rule, or <CODE>null</CODE> if no |
| | | * such matching rule has been defined in the server. |
| | | */ |
| | | public static OrderingMatchingRule getOrderingMatchingRule(String lowerName) |
| | | public static MatchingRule getOrderingMatchingRule(String lowerName) |
| | | { |
| | | return (OrderingMatchingRule) directoryServer.schema.getMatchingRule(lowerName); |
| | | return (MatchingRule) directoryServer.schema.getMatchingRule(lowerName); |
| | | } |
| | | |
| | | /** |
| | |
| | | * <CODE>false</CODE> |
| | | */ |
| | | public static void registerOrderingMatchingRule( |
| | | OrderingMatchingRule matchingRule, boolean overwriteExisting) |
| | | MatchingRule matchingRule, boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | directoryServer.schema.registerMatchingRule(matchingRule, overwriteExisting); |
| | |
| | | * |
| | | * @param matchingRule The matching rule to deregister with the server. |
| | | */ |
| | | public static void deregisterOrderingMatchingRule(OrderingMatchingRule |
| | | public static void deregisterOrderingMatchingRule(MatchingRule |
| | | matchingRule) |
| | | { |
| | | directoryServer.schema.deregisterMatchingRule(matchingRule); |
| | |
| | | import org.opends.server.admin.std.meta.MatchingRuleCfgDefn; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.types.AttributeType; |
| | |
| | | continue; |
| | | } |
| | | |
| | | OrderingMatchingRule omr = at.getOrderingMatchingRule(); |
| | | MatchingRule omr = at.getOrderingMatchingRule(); |
| | | if ((omr != null) && oid.equals(omr.getOID())) |
| | | { |
| | | LocalizableMessage message = |
| | |
| | | continue; |
| | | } |
| | | |
| | | OrderingMatchingRule omr = at.getOrderingMatchingRule(); |
| | | MatchingRule omr = at.getOrderingMatchingRule(); |
| | | if ((omr != null) && oid.equals(omr.getOID())) |
| | | { |
| | | LocalizableMessage message = |
| | |
| | | */ |
| | | package org.opends.server.schema; |
| | | |
| | | |
| | | import java.util.Comparator; |
| | | |
| | | import org.forgerock.opendj.ldap.*; |
| | | import org.opends.server.api.AbstractMatchingRule; |
| | | import org.opends.server.api.NotImplementedAssertion; |
| | |
| | | @Override |
| | | public ConditionResult matches(ByteSequence attributeValue) |
| | | { |
| | | return ConditionResult.valueOf( |
| | | compareValues(assertionValue, attributeValue) < 0); |
| | | return ConditionResult.valueOf(compareValues(attributeValue, assertionValue) < 0); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Assertion getGreaterOrEqualAssertion(ByteSequence value) throws DecodeException |
| | | { |
| | | final ByteString normAssertion = normalizeAssertionValue(value); |
| | | return new NotImplementedAssertion() |
| | | { |
| | | @Override |
| | | public ConditionResult matches(final ByteSequence normalizedAttributeValue) |
| | | { |
| | | return ConditionResult.valueOf(compareValues(normalizedAttributeValue, normAssertion) >= 0); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Assertion getLessOrEqualAssertion(ByteSequence value) throws DecodeException |
| | | { |
| | | final ByteString normAssertion = normalizeAssertionValue(value); |
| | | return new NotImplementedAssertion() |
| | | { |
| | | @Override |
| | | public ConditionResult matches(final ByteSequence normalizedAttributeValue) |
| | | { |
| | | return ConditionResult.valueOf(compareValues(normalizedAttributeValue, normAssertion) <= 0); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Comparator<ByteSequence> comparator() |
| | | { |
| | | return new Comparator<ByteSequence>() |
| | | { |
| | | @Override |
| | | public int compare(ByteSequence o1, ByteSequence o2) |
| | | { |
| | | return AbstractOrderingMatchingRule.this.compare(o1.toByteArray(), o2.toByteArray()); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // We don't have an orderingMatchingRule |
| | | return null; |
| | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | AttributeSyntax<?> syntax = DirectoryServer.getDefaultAttributeSyntax(); |
| | | MatchingRule approximateMatchingRule = null; |
| | | MatchingRule equalityMatchingRule = null; |
| | | OrderingMatchingRule orderingMatchingRule = null; |
| | | MatchingRule orderingMatchingRule = null; |
| | | SubstringMatchingRule substringMatchingRule = null; |
| | | AttributeUsage attributeUsage = AttributeUsage.USER_APPLICATIONS; |
| | | boolean isCollective = false; |
| | |
| | | // for this attribute type. |
| | | StringBuilder woidBuffer = new StringBuilder(); |
| | | pos = readWOID(lowerStr, woidBuffer, pos); |
| | | OrderingMatchingRule omr = |
| | | (OrderingMatchingRule) schema.getMatchingRule(woidBuffer.toString()); |
| | | MatchingRule omr = |
| | | (MatchingRule) schema.getMatchingRule(woidBuffer.toString()); |
| | | if (omr == null) |
| | | { |
| | | // This is bad because we have no idea what the ordering matching |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // There is no ordering matching rule by default. |
| | | return null; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // Ordering matches are not allowed by default. |
| | | return null; |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.util.ServerConstants; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // Ordering matches are not allowed by default. |
| | | return null; |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.CertificateAttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.CountryStringAttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.DirectoryStringAttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.DN; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // There is no ordering matching rule by default. |
| | | return null; |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.JPEGAttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return subSyntax.getOrderingMatchingRule(); |
| | | } |
| | |
| | | private SubstringMatchingRule substringMatchingRule; |
| | | |
| | | //The ordering matching rule. |
| | | private OrderingMatchingRule orderingMatchingRule; |
| | | private MatchingRule orderingMatchingRule; |
| | | |
| | | //The approximate matching rule. |
| | | private MatchingRule approximateMatchingRule; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | if(orderingMatchingRule == null) |
| | | { |
| | |
| | | private SubstringMatchingRule substringMatchingRule; |
| | | |
| | | //The ordering matching rule. |
| | | private OrderingMatchingRule orderingMatchingRule; |
| | | private MatchingRule orderingMatchingRule; |
| | | |
| | | //The approximate matching rule. |
| | | private MatchingRule approximateMatchingRule; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | if(orderingMatchingRule == null) |
| | | { |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // There is no ordering matching rule by default. |
| | | return null; |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // There is no ordering matching rule by default. |
| | | return null; |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // Ordering matching is not allowed by default. |
| | | return null; |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // Ordering matching will not be allowed by default. |
| | | return null; |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.DN; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * default. |
| | | */ |
| | | @Override |
| | | public OrderingMatchingRule getOrderingMatchingRule() { |
| | | public MatchingRule getOrderingMatchingRule() { |
| | | |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.TelephoneNumberAttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // There is no ordering matching rule by default. |
| | | return null; |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | // The default substring matching rule for this syntax. |
| | | private SubstringMatchingRule defaultSubstringMatchingRule; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | private MatchingRule defaultEqualityMatchingRule; |
| | | |
| | | // The default ordering matching rule for this syntax. |
| | | private OrderingMatchingRule defaultOrderingMatchingRule; |
| | | private MatchingRule defaultOrderingMatchingRule; |
| | | |
| | | |
| | | |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * attributes with this syntax, or <CODE>null</CODE> if ordering |
| | | * matches will not be allowed for this type by default. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | // There is no ordering matching rule by default. |
| | | return null; |
| | |
| | | import org.forgerock.util.Reject; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | |
| | |
| | | @Override |
| | | public final ConditionResult greaterThanOrEqualTo(ByteString value) |
| | | { |
| | | OrderingMatchingRule matchingRule = attributeType |
| | | .getOrderingMatchingRule(); |
| | | MatchingRule matchingRule = attributeType.getOrderingMatchingRule(); |
| | | if (matchingRule == null) |
| | | { |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | | ByteString normalizedValue; |
| | | Assertion assertion; |
| | | try |
| | | { |
| | | normalizedValue = matchingRule.normalizeAttributeValue(value); |
| | | assertion = matchingRule.getGreaterOrEqualAssertion(value); |
| | | } |
| | | catch (Exception e) |
| | | catch (DecodeException e) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize the provided value. We should return |
| | | // "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString nv = matchingRule.normalizeAttributeValue(v); |
| | | if (matchingRule.compareValues(nv, normalizedValue) >= 0) |
| | | if (assertion.matches(matchingRule.normalizeAttributeValue(v)).toBoolean()) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize one of the attribute values. If we |
| | | // can't find a definite match, then we should return |
| | | // "undefined". |
| | |
| | | @Override |
| | | public final ConditionResult lessThanOrEqualTo(ByteString value) |
| | | { |
| | | OrderingMatchingRule matchingRule = attributeType |
| | | .getOrderingMatchingRule(); |
| | | MatchingRule matchingRule = attributeType.getOrderingMatchingRule(); |
| | | if (matchingRule == null) |
| | | { |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | | ByteString normalizedValue; |
| | | Assertion assertion; |
| | | try |
| | | { |
| | | normalizedValue = matchingRule.normalizeAttributeValue(value); |
| | | assertion = matchingRule.getLessOrEqualAssertion(value); |
| | | } |
| | | catch (Exception e) |
| | | catch (DecodeException e) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize the provided value. We should return |
| | | // "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString nv = matchingRule.normalizeAttributeValue(v); |
| | | if (matchingRule.compareValues(nv, normalizedValue) <= 0) |
| | | if (assertion.matches(matchingRule.normalizeAttributeValue(v)).toBoolean()) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize one of the attribute values. If we |
| | | // can't find a definite match, then we should return |
| | | // "undefined". |
| | | // can't find a definite match, then we should return "undefined". |
| | | result = ConditionResult.UNDEFINED; |
| | | } |
| | | } |
| | |
| | | import org.forgerock.opendj.ldap.schema.AttributeUsage; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | |
| | |
| | | private final MatchingRule equalityMatchingRule; |
| | | |
| | | // The ordering matching rule for this attribute type. |
| | | private final OrderingMatchingRule orderingMatchingRule; |
| | | private final MatchingRule orderingMatchingRule; |
| | | |
| | | // The definition string used to create this attribute type. |
| | | private final String definition; |
| | |
| | | AttributeSyntax<?> syntax, |
| | | MatchingRule approximateMatchingRule, |
| | | MatchingRule equalityMatchingRule, |
| | | OrderingMatchingRule orderingMatchingRule, |
| | | MatchingRule orderingMatchingRule, |
| | | SubstringMatchingRule substringMatchingRule, |
| | | AttributeUsage attributeUsage, |
| | | boolean isCollective, |
| | |
| | | * @return The matching rule that should be used for ordering with |
| | | * this attribute type. |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | public MatchingRule getOrderingMatchingRule() |
| | | { |
| | | return orderingMatchingRule; |
| | | } |
| | |
| | | import org.opends.server.api.ConfigHandler; |
| | | import org.opends.server.api.ExtendedOperationHandler; |
| | | import org.opends.server.api.InvokableComponent; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SASLMechanismHandler; |
| | | import org.opends.server.api.ServerShutdownListener; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | |
| | | * <CODE>null</CODE> if no such matching rule has been |
| | | * defined in the server. |
| | | */ |
| | | public static OrderingMatchingRule |
| | | public static MatchingRule |
| | | getOrderingMatchingRule(String lowerName) |
| | | { |
| | | return DirectoryServer.getOrderingMatchingRule(lowerName); |
| | |
| | | import org.forgerock.opendj.ldap.DecodeException; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | |
| | | import static org.opends.messages.CoreMessages.*; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Compares two attribute values by using the provided OrderingMatchingRule if |
| | | * Compares two attribute values by using the provided MatchingRule if |
| | | * it is not null, or relying on alphabetical ordering otherwise. |
| | | * |
| | | * @param value1 |
| | |
| | | * @param value2 |
| | | * the second attribute value to compare |
| | | * @param type |
| | | * the type whose OrderingMatchingRule is to be used for comparison |
| | | * the type whose MatchingRule is to be used for comparison |
| | | * @return A negative integer if this value1 should come before the value2, a |
| | | * positive integer if value1 should come after value2, or zero if |
| | | * there is no difference with regard to ordering. |
| | | */ |
| | | private int compare(ByteString value1, ByteString value2, AttributeType type) |
| | | { |
| | | final OrderingMatchingRule omr = type.getOrderingMatchingRule(); |
| | | final MatchingRule emr = type.getEqualityMatchingRule(); |
| | | final MatchingRule orderingRule = type.getOrderingMatchingRule(); |
| | | final MatchingRule rule = orderingRule != null ? orderingRule : type.getEqualityMatchingRule(); |
| | | |
| | | ByteString val1; |
| | | ByteString val2; |
| | | try |
| | | { |
| | | final MatchingRule rule = omr != null ? omr : emr; |
| | | val1 = rule.normalizeAttributeValue(value1); |
| | | val2 = rule.normalizeAttributeValue(value2); |
| | | } |
| | |
| | | val1 = value1; |
| | | val2 = value2; |
| | | } |
| | | |
| | | if (omr != null) |
| | | { |
| | | return omr.compareValues(val1, val2); |
| | | } |
| | | return val1.compareTo(val2); |
| | | return rule.comparator().compare(val1, val2); |
| | | } |
| | | } |
| | |
| | | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | |
| | | /** |
| | | * This class defines a data structure that may be used as a sort key. |
| | |
| | | private boolean ascending; |
| | | |
| | | // The ordering matching rule to use with this sort key. |
| | | private OrderingMatchingRule orderingRule; |
| | | private MatchingRule orderingRule; |
| | | |
| | | |
| | | |
| | |
| | | * @param orderingRule The ordering matching rule to use with |
| | | * this sort key. |
| | | */ |
| | | public SortKey(AttributeType attributeType, boolean ascending, |
| | | OrderingMatchingRule orderingRule) |
| | | public SortKey(AttributeType attributeType, boolean ascending, MatchingRule orderingRule) |
| | | { |
| | | this.attributeType = attributeType; |
| | | this.ascending = ascending; |
| | |
| | | * |
| | | * @return The ordering matching rule to use with this sort key. |
| | | */ |
| | | public OrderingMatchingRule getOrderingRule() |
| | | public MatchingRule getOrderingRule() |
| | | { |
| | | return orderingRule; |
| | | } |
| | |
| | | { |
| | | return compareValues(orderingRule, value1, value2); |
| | | } |
| | | final OrderingMatchingRule rule = attributeType.getOrderingMatchingRule(); |
| | | final MatchingRule rule = attributeType.getOrderingMatchingRule(); |
| | | if (rule != null) |
| | | { |
| | | return compareValues(rule, value1, value2); |
| | |
| | | return 0; |
| | | } |
| | | |
| | | private int compareValues(OrderingMatchingRule rule, ByteString value1, |
| | | private int compareValues(MatchingRule rule, ByteString value1, |
| | | ByteString value2) |
| | | { |
| | | try |
| | |
| | | final ByteString val2 = rule.normalizeAttributeValue(value2); |
| | | if (ascending) |
| | | { |
| | | return rule.compareValues(val1, val2); |
| | | return rule.comparator().compare(val1, val2); |
| | | } |
| | | else |
| | | { |
| | | return rule.compareValues(val2, val1); |
| | | return rule.comparator().compare(val2, val1); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | import org.assertj.core.api.Assertions; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.Assertion; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ConditionResult; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.admin.std.meta.ReplicationDomainCfgDefn.AssuredType; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | public void basicRuleTest() throws Exception |
| | | { |
| | | // Creates a rule |
| | | HistoricalCsnOrderingMatchingRule r = |
| | | HistoricalCsnOrderingMatchingRule rule = |
| | | new HistoricalCsnOrderingMatchingRule(); |
| | | |
| | | CSN del1 = new CSN(1, 0, 1); |
| | |
| | | ByteString v1 = ByteString.valueOf("a" + ":" + del1); |
| | | ByteString v2 = ByteString.valueOf("a" + ":" + del2); |
| | | |
| | | assertEquals(r.compareValues(v1, v1), 0); |
| | | assertEquals(r.compareValues(v1, v2), -1); |
| | | assertEquals(r.compareValues(v2, v1), 1); |
| | | Assertion assert1 = rule.getAssertion(v2); |
| | | assertEquals(assert1.matches(rule.normalizeAttributeValue(v1)), ConditionResult.TRUE); |
| | | assertEquals(assert1.matches(rule.normalizeAttributeValue(v2)), ConditionResult.FALSE); |
| | | |
| | | Assertion assert2 = rule.getLessOrEqualAssertion(v2); |
| | | assertEquals(assert2.matches(rule.normalizeAttributeValue(v1)), ConditionResult.TRUE); |
| | | assertEquals(assert2.matches(rule.normalizeAttributeValue(v2)), ConditionResult.TRUE); |
| | | |
| | | Assertion assert3 = rule.getGreaterOrEqualAssertion(v2); |
| | | assertEquals(assert3.matches(rule.normalizeAttributeValue(v1)), ConditionResult.FALSE); |
| | | assertEquals(assert3.matches(rule.normalizeAttributeValue(v2)), ConditionResult.TRUE); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | package org.opends.server.schema; |
| | | |
| | | import org.forgerock.opendj.ldap.Assertion; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ConditionResult; |
| | | import org.forgerock.opendj.ldap.DecodeException; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * Test the comparison of valid values. |
| | | */ |
| | | @Test(dataProvider= "Orderingmatchingrules") |
| | | public void OrderingMatchingRules(String value1,String value2, int result) |
| | | public void testAssertionMatches(String attributeValue, String assertionValue, int expectedResult) |
| | | throws Exception |
| | | { |
| | | // Make sure that the specified class can be instantiated as a task. |
| | | OrderingMatchingRule ruleInstance = getRule(); |
| | | |
| | | // we should call initializeMatchingRule but they all seem empty at the |
| | | // moment. |
| | | // we should call initializeMatchingRule but they all seem empty at the moment. |
| | | // ruleInstance.initializeMatchingRule(configEntry); |
| | | |
| | | ByteString normalizedValue1 = |
| | | ruleInstance.normalizeAttributeValue(ByteString.valueOf(value1)); |
| | | ByteString normalizedValue2 = |
| | | ruleInstance.normalizeAttributeValue(ByteString.valueOf(value2)); |
| | | int res = ruleInstance.compareValues(normalizedValue1, normalizedValue2); |
| | | ByteString normalizedAttrValue = ruleInstance.normalizeAttributeValue(ByteString.valueOf(attributeValue)); |
| | | |
| | | Assertion assert1 = ruleInstance.getAssertion(ByteString.valueOf(assertionValue)); |
| | | ConditionResult result = assert1.matches(normalizedAttrValue); |
| | | assertEquals(result.toBoolean(), expectedResult < 0); |
| | | |
| | | Assertion assert2 = ruleInstance.getLessOrEqualAssertion(ByteString.valueOf(assertionValue)); |
| | | ConditionResult result2 = assert2.matches(normalizedAttrValue); |
| | | assertEquals(result2.toBoolean(), expectedResult <= 0); |
| | | |
| | | Assertion assert3 = ruleInstance.getGreaterOrEqualAssertion(ByteString.valueOf(assertionValue)); |
| | | ConditionResult result3 = assert3.matches(normalizedAttrValue); |
| | | assertEquals(result3.toBoolean(), expectedResult >= 0); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * Test the comparison of valid values. |
| | | */ |
| | | @Test(dataProvider= "Orderingmatchingrules") |
| | | public void testComparison(String value1, String value2, int result) throws Exception |
| | | { |
| | | OrderingMatchingRule rule = getRule(); |
| | | |
| | | // we should call initializeMatchingRule but they all seem empty at the moment. |
| | | // ruleInstance.initializeMatchingRule(configEntry); |
| | | |
| | | ByteString normalizedValue1 = rule.normalizeAttributeValue(ByteString.valueOf(value1)); |
| | | ByteString normalizedValue2 = rule.normalizeAttributeValue(ByteString.valueOf(value2)); |
| | | int res = rule.comparator().compare(normalizedValue1, normalizedValue2); |
| | | if (result == 0) |
| | | { |
| | | if (res != 0) |
| | | { |
| | | fail(ruleInstance + ".compareValues should return 0 for values " + |
| | | fail(rule + ".compareValues should return 0 for values " + |
| | | value1 + " and " + value2); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (res <= 0) |
| | | { |
| | | fail(ruleInstance + ".compareValues should return a positive integer " |
| | | fail(rule + ".compareValues should return a positive integer " |
| | | + "for values : " + value1 + " and " + value2); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (res >= 0) |
| | | { |
| | | fail(ruleInstance + ".compareValues should return a negative integer " |
| | | fail(rule + ".compareValues should return a negative integer " |
| | | + "for values : " + value1 + " and " + value2); |
| | | } |
| | | } |
| | |
| | | * Test that invalid values are rejected. |
| | | */ |
| | | @Test(dataProvider= "OrderingMatchingRuleInvalidValues") |
| | | public void OrderingMatchingRulesInvalidValues(String value) throws Exception |
| | | public void orderingMatchingRulesInvalidValues(String value) throws Exception |
| | | { |
| | | // Make sure that the specified class can be instantiated as a task. |
| | | OrderingMatchingRule ruleInstance = getRule(); |
| | |
| | | * Test that invalid values are rejected. |
| | | */ |
| | | @Test(dataProvider= "OrderingMatchingRuleInvalidValues") |
| | | public void OrderingMatchingRulesInvalidValuesWarn(String value) |
| | | public void orderingMatchingRulesInvalidValuesWarn(String value) |
| | | throws Exception |
| | | { |
| | | // Make sure that the specified class can be instantiated as a task. |
| | |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.testng.Assert; |
| | |
| | | private MatchingRule equalityMatchingRule; |
| | | |
| | | // The ordering matching rule for this attribute type. |
| | | private OrderingMatchingRule orderingMatchingRule; |
| | | private MatchingRule orderingMatchingRule; |
| | | |
| | | // The substring matching rule for this attribute type. |
| | | private SubstringMatchingRule substringMatchingRule; |
| | |
| | | * The orderingMatchingRule. |
| | | */ |
| | | public void setOrderingMatchingRule( |
| | | OrderingMatchingRule orderingMatchingRule) { |
| | | MatchingRule orderingMatchingRule) { |
| | | this.orderingMatchingRule = orderingMatchingRule; |
| | | } |
| | | |
| | |
| | | { "cn=hello world\\ ,dc=com", "cn=hello world,dc=com", 0 }, |
| | | { "cn=HELLO WORLD,dc=com", "cn=hello world,dc=com", 0 }, |
| | | { "cn=HELLO+sn=WORLD,dc=com", "sn=world+cn=hello,dc=com", 0 }, |
| | | { "x-test-integer-type=10,dc=com", |
| | | "x-test-integer-type=9,dc=com", 1 }, |
| | | { "x-test-integer-type=999,dc=com", |
| | | "x-test-integer-type=1000,dc=com", -1 }, |
| | | { "x-test-integer-type=-1,dc=com", |
| | | "x-test-integer-type=0,dc=com", -1 }, |
| | | { "x-test-integer-type=0,dc=com", |
| | | "x-test-integer-type=-1,dc=com", 1 }, |
| | | { "x-test-integer-type=10,dc=com", "x-test-integer-type=9,dc=com", 1 }, |
| | | { "x-test-integer-type=999,dc=com", "x-test-integer-type=1000,dc=com", -1 }, |
| | | { "x-test-integer-type=-1,dc=com", "x-test-integer-type=0,dc=com", -1 }, |
| | | { "x-test-integer-type=0,dc=com", "x-test-integer-type=-1,dc=com", 1 }, |
| | | { "cn=aaa,dc=com", "cn=aaaa,dc=com", -1 }, |
| | | { "cn=AAA,dc=com", "cn=aaaa,dc=com", -1 }, |
| | | { "cn=aaa,dc=com", "cn=AAAA,dc=com", -1 }, |