| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |