Package org.forgerock.opendj.ldap.schema
Interface MatchingRuleImpl
- All Known Implementing Classes:
AbstractOrderingMatchingRuleImpl
,HistoricalCsnOrderingMatchingRuleImpl
,HistoricalCsnRangeMatchingRuleImpl
public interface MatchingRuleImpl
This interface defines the set of methods that must be implemented to define
a new matching rule.
-
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends Indexer>
createIndexers
(Schema schema, IndexingOptions options) Returns the indexers for this matching rule.getAssertion
(Schema schema, ByteString assertionValue) Compiles the provided assertion value as anAssertion
suitable for use with equalityMatch, approxMatch and extensibleMatch search filters.default Assertion
getOrderingAssertion
(Schema schema, ByteString lower, ByteString upper, boolean lowerIncluded, boolean upperIncluded) Compiles the provided ordering assertion value range as anAssertion
suitable for use with ordering search filters, including greaterOrEqual and lessOrEqual.default Assertion
getSubstringAssertion
(Schema schema, ByteString subInitial, List<ByteString> subAnyElements, ByteString subFinal) Compiles the provided substring assertion fragments as anAssertion
suitable for use with substrings search filters.getType()
Returns the type of this matching rule.normalizeAttributeValue
(Schema schema, ByteString value) Retrieves the normalized form of the provided attribute value, which is best suited for efficiently performing matching operations on that value.
-
Method Details
-
getType
MatchingRule.MatchingRuleType getType()Returns the type of this matching rule.- Returns:
- the type of this matching rule.
-
getAssertion
Compiles the provided assertion value as anAssertion
suitable for use with equalityMatch, approxMatch and extensibleMatch search filters.- Parameters:
schema
- The schema in which this matching rule is defined.assertionValue
- The assertion value.- Returns:
- The compiled assertion.
- Throws:
DecodeException
- If the assertion value does not conform to the matching rule's assertion syntax.
-
getSubstringAssertion
default Assertion getSubstringAssertion(Schema schema, ByteString subInitial, List<ByteString> subAnyElements, ByteString subFinal) throws DecodeException Compiles the provided substring assertion fragments as anAssertion
suitable for use with substrings search filters.- Parameters:
schema
- The schema in which this matching rule is defined.subInitial
- The substring value fragment that should appear at the beginning of the target value.subAnyElements
- The substring value fragments that should appear in the middle of the target value.subFinal
- The substring value fragment that should appear at the end of the target value.- Returns:
- The compiled substring assertion.
- Throws:
DecodeException
- If the assertion value fragments do not conform to the matching rule's assertion syntax or if the matching rule does not support substring matching.
-
getOrderingAssertion
default Assertion getOrderingAssertion(Schema schema, ByteString lower, ByteString upper, boolean lowerIncluded, boolean upperIncluded) throws DecodeException Compiles the provided ordering assertion value range as anAssertion
suitable for use with ordering search filters, including greaterOrEqual and lessOrEqual.- Parameters:
schema
- The schema in which this matching rule is defined.lower
- The lower bound assertion value, ornull
if there is no lower bound and the range will start from the smallest key.upper
- The upper bound assertion value to be normalized, ornull
if there is no upper bound and the range will end at the largest key.lowerIncluded
-true
if a key exactly matching the lower bound is included in the range,false
if only keys strictly greater than the lower bound are included. This value is ignored if the lower bound is not specified.upperIncluded
-true
if a key exactly matching the upper bound is included in the range,false
if only keys strictly less than the upper bound are included. This value is ignored if the upper bound is not specified.- Returns:
- The compiled ordering assertion.
- Throws:
DecodeException
- If the upper or lower bounds do not conform to the matching rule's assertion syntax or if the matching rule does not support ordering matching.
-
normalizeAttributeValue
Retrieves the normalized form of the provided attribute value, which is best suited for efficiently performing matching operations on that value. Equality and ordering matching rules should return a normalized representation which can be compared with other normalized values usingByteString.equals(Object)
andByteString.compareTo(ByteString)
.- Parameters:
schema
- The schema in which this matching rule is defined.value
- The attribute value to be normalized.- Returns:
- The normalized version of the provided attribute value.
- Throws:
DecodeException
- If an syntax error occurred while parsing the value.
-
createIndexers
Returns the indexers for this matching rule.- Parameters:
schema
- The schema in which this matching rule is defined.options
- The indexing options.- Returns:
- a non null collection of indexers for this matching rule.
-