Package org.opends.server.controls
Class MatchedValuesFilter
- java.lang.Object
-
- org.opends.server.controls.MatchedValuesFilter
-
public class MatchedValuesFilter extends Object
This class defines a filter that may be used in conjunction with the matched values control to indicate which particular values of a multivalued attribute should be returned. The matched values filter is essentially a subset of an LDAP search filter, lacking support for AND, OR, and NOT components, and lacking support for the dnAttributes component of extensible matching filters.
-
-
Field Summary
Fields Modifier and Type Field Description static byteAPPROXIMATE_MATCH_TYPEThe BER type associated with the approxMatch filter type.static byteEQUALITY_MATCH_TYPEThe BER type associated with the equalityMatch filter type.static byteEXTENSIBLE_MATCH_TYPEThe BER type associated with the extensibleMatch filter type.static byteGREATER_OR_EQUAL_TYPEThe BER type associated with the greaterOrEqual filter type.static byteLESS_OR_EQUAL_TYPEThe BER type associated with the lessOrEqual filter type.static bytePRESENT_TYPEThe BER type associated with the present filter type.static byteSUBSTRINGS_TYPEThe BER type associated with the substrings filter type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MatchedValuesFiltercreateApproximateFilter(String rawAttributeType, ByteString rawAssertionValue)Creates a new approxMatch filter with the provided information.static MatchedValuesFiltercreateApproximateFilter(AttributeType attributeType, ByteString assertionValue)Creates a new approxMatch filter with the provided information.static MatchedValuesFiltercreateEqualityFilter(String rawAttributeType, ByteString rawAssertionValue)Creates a new equalityMatch filter with the provided information.static MatchedValuesFiltercreateEqualityFilter(AttributeType attributeType, ByteString assertionValue)Creates a new equalityMatch filter with the provided information.static MatchedValuesFiltercreateExtensibleMatchFilter(String rawAttributeType, String matchingRuleID, ByteString rawAssertionValue)Creates a new extensibleMatch filter with the provided information.static MatchedValuesFiltercreateExtensibleMatchFilter(AttributeType attributeType, MatchingRule matchingRule, ByteString assertionValue)Creates a new extensibleMatch filter with the provided information.static MatchedValuesFiltercreateFromLDAPFilter(RawFilter filter)Creates a new matched values filter from the provided LDAP filter.static MatchedValuesFiltercreateGreaterOrEqualFilter(String rawAttributeType, ByteString rawAssertionValue)Creates a new greaterOrEqual filter with the provided information.static MatchedValuesFiltercreateGreaterOrEqualFilter(AttributeType attributeType, ByteString assertionValue)Creates a new greaterOrEqual filter with the provided information.static MatchedValuesFiltercreateLessOrEqualFilter(String rawAttributeType, ByteString rawAssertionValue)Creates a new lessOrEqual filter with the provided information.static MatchedValuesFiltercreateLessOrEqualFilter(AttributeType attributeType, ByteString assertionValue)Creates a new lessOrEqual filter with the provided information.static MatchedValuesFiltercreatePresentFilter(String rawAttributeType)Creates a new present filter with the provided information.static MatchedValuesFiltercreatePresentFilter(AttributeType attributeType)Creates a new present filter with the provided information.static MatchedValuesFiltercreateSubstringsFilter(String rawAttributeType, ByteString subInitial, List<ByteString> subAny, ByteString subFinal)Creates a new substrings filter with the provided information.static MatchedValuesFiltercreateSubstringsFilter(AttributeType attributeType, ByteString subInitial, List<ByteString> subAny, ByteString subFinal)Creates a new substrings filter with the provided information.static MatchedValuesFilterdecode(ASN1Reader reader)Decodes the provided ASN.1 element as a matched values filter item.voidencode(ASN1Writer writer)Encodes this matched values filter as an ASN.1 element.MatchingRulegetApproximateMatchingRule()Retrieves the approximate matching rule that should be used for this matched values filter.ByteStringgetAssertionValue()Retrieves the assertion value for this matched values filter.AttributeTypegetAttributeType()Retrieves the attribute type for this matched values filter.MatchingRulegetEqualityMatchingRule()Retrieves the equality matching rule that should be used for this matched values filter.MatchingRulegetMatchingRule()Retrieves the matching rule for this matched values filter.StringgetMatchingRuleID()Retrieves the matching rule ID for this matched values filter.bytegetMatchType()Retrieves the match type for this matched values filter.MatchingRulegetOrderingMatchingRule()Retrieves the ordering matching rule that should be used for this matched values filter.ByteStringgetRawAssertionValue()Retrieves the raw, unprocessed assertion value for this matched values filter.StringgetRawAttributeType()Retrieves the raw, unprocessed attribute type for this matched values filter.List<ByteString>getSubAnyElements()Retrieves the set of subAny elements for this matched values filter.ByteStringgetSubFinalElement()Retrieves the subFinal element for this matched values filter.ByteStringgetSubInitialElement()Retrieves the subInitial element for this matched values filter.MatchingRulegetSubstringMatchingRule()Retrieves the substring matching rule that should be used for this matched values filter.StringtoString()Retrieves a string representation of this matched values filter, as an RFC 2254-compliant filter string.voidtoString(StringBuilder buffer)Appends a string representation of this matched values filter, as an RFC 2254-compliant filter string, to the provided buffer.booleanvalueMatches(AttributeType type, ByteString value)Indicates whether the specified attribute value matches the criteria defined in this matched values filter.
-
-
-
Field Detail
-
EQUALITY_MATCH_TYPE
public static final byte EQUALITY_MATCH_TYPE
The BER type associated with the equalityMatch filter type.- See Also:
- Constant Field Values
-
SUBSTRINGS_TYPE
public static final byte SUBSTRINGS_TYPE
The BER type associated with the substrings filter type.- See Also:
- Constant Field Values
-
GREATER_OR_EQUAL_TYPE
public static final byte GREATER_OR_EQUAL_TYPE
The BER type associated with the greaterOrEqual filter type.- See Also:
- Constant Field Values
-
LESS_OR_EQUAL_TYPE
public static final byte LESS_OR_EQUAL_TYPE
The BER type associated with the lessOrEqual filter type.- See Also:
- Constant Field Values
-
PRESENT_TYPE
public static final byte PRESENT_TYPE
The BER type associated with the present filter type.- See Also:
- Constant Field Values
-
APPROXIMATE_MATCH_TYPE
public static final byte APPROXIMATE_MATCH_TYPE
The BER type associated with the approxMatch filter type.- See Also:
- Constant Field Values
-
EXTENSIBLE_MATCH_TYPE
public static final byte EXTENSIBLE_MATCH_TYPE
The BER type associated with the extensibleMatch filter type.- See Also:
- Constant Field Values
-
-
Method Detail
-
createEqualityFilter
public static MatchedValuesFilter createEqualityFilter(String rawAttributeType, ByteString rawAssertionValue)
Creates a new equalityMatch filter with the provided information.- Parameters:
rawAttributeType- The raw, unprocessed attribute type.rawAssertionValue- The raw, unprocessed assertion value.- Returns:
- The created equalityMatch filter.
-
createEqualityFilter
public static MatchedValuesFilter createEqualityFilter(AttributeType attributeType, ByteString assertionValue)
Creates a new equalityMatch filter with the provided information.- Parameters:
attributeType- The attribute type.assertionValue- The assertion value.- Returns:
- The created equalityMatch filter.
-
createSubstringsFilter
public static MatchedValuesFilter createSubstringsFilter(String rawAttributeType, ByteString subInitial, List<ByteString> subAny, ByteString subFinal)
Creates a new substrings filter with the provided information.- Parameters:
rawAttributeType- The raw, unprocessed attribute type.subInitial- The subInitial element.subAny- The set of subAny elements.subFinal- The subFinal element.- Returns:
- The created substrings filter.
-
createSubstringsFilter
public static MatchedValuesFilter createSubstringsFilter(AttributeType attributeType, ByteString subInitial, List<ByteString> subAny, ByteString subFinal)
Creates a new substrings filter with the provided information.- Parameters:
attributeType- The raw, unprocessed attribute type.subInitial- The subInitial element.subAny- The set of subAny elements.subFinal- The subFinal element.- Returns:
- The created substrings filter.
-
createGreaterOrEqualFilter
public static MatchedValuesFilter createGreaterOrEqualFilter(String rawAttributeType, ByteString rawAssertionValue)
Creates a new greaterOrEqual filter with the provided information.- Parameters:
rawAttributeType- The raw, unprocessed attribute type.rawAssertionValue- The raw, unprocessed assertion value.- Returns:
- The created greaterOrEqual filter.
-
createGreaterOrEqualFilter
public static MatchedValuesFilter createGreaterOrEqualFilter(AttributeType attributeType, ByteString assertionValue)
Creates a new greaterOrEqual filter with the provided information.- Parameters:
attributeType- The attribute type.assertionValue- The assertion value.- Returns:
- The created greaterOrEqual filter.
-
createLessOrEqualFilter
public static MatchedValuesFilter createLessOrEqualFilter(String rawAttributeType, ByteString rawAssertionValue)
Creates a new lessOrEqual filter with the provided information.- Parameters:
rawAttributeType- The raw, unprocessed attribute type.rawAssertionValue- The raw, unprocessed assertion value.- Returns:
- The created lessOrEqual filter.
-
createLessOrEqualFilter
public static MatchedValuesFilter createLessOrEqualFilter(AttributeType attributeType, ByteString assertionValue)
Creates a new lessOrEqual filter with the provided information.- Parameters:
attributeType- The attribute type.assertionValue- The assertion value.- Returns:
- The created lessOrEqual filter.
-
createPresentFilter
public static MatchedValuesFilter createPresentFilter(String rawAttributeType)
Creates a new present filter with the provided information.- Parameters:
rawAttributeType- The raw, unprocessed attribute type.- Returns:
- The created present filter.
-
createPresentFilter
public static MatchedValuesFilter createPresentFilter(AttributeType attributeType)
Creates a new present filter with the provided information.- Parameters:
attributeType- The attribute type.- Returns:
- The created present filter.
-
createApproximateFilter
public static MatchedValuesFilter createApproximateFilter(String rawAttributeType, ByteString rawAssertionValue)
Creates a new approxMatch filter with the provided information.- Parameters:
rawAttributeType- The raw, unprocessed attribute type.rawAssertionValue- The raw, unprocessed assertion value.- Returns:
- The created approxMatch filter.
-
createApproximateFilter
public static MatchedValuesFilter createApproximateFilter(AttributeType attributeType, ByteString assertionValue)
Creates a new approxMatch filter with the provided information.- Parameters:
attributeType- The attribute type.assertionValue- The assertion value.- Returns:
- The created approxMatch filter.
-
createExtensibleMatchFilter
public static MatchedValuesFilter createExtensibleMatchFilter(String rawAttributeType, String matchingRuleID, ByteString rawAssertionValue)
Creates a new extensibleMatch filter with the provided information.- Parameters:
rawAttributeType- The raw, unprocessed attribute type.matchingRuleID- The matching rule ID.rawAssertionValue- The raw, unprocessed assertion value.- Returns:
- The created extensibleMatch filter.
-
createExtensibleMatchFilter
public static MatchedValuesFilter createExtensibleMatchFilter(AttributeType attributeType, MatchingRule matchingRule, ByteString assertionValue)
Creates a new extensibleMatch filter with the provided information.- Parameters:
attributeType- The attribute type.matchingRule- The matching rule.assertionValue- The assertion value.- Returns:
- The created extensibleMatch filter.
-
createFromLDAPFilter
public static MatchedValuesFilter createFromLDAPFilter(RawFilter filter) throws LDAPException
Creates a new matched values filter from the provided LDAP filter.- Parameters:
filter- The LDAP filter to use for this matched values filter.- Returns:
- The corresponding matched values filter.
- Throws:
LDAPException- If the provided LDAP filter cannot be treated as a matched values filter.
-
encode
public void encode(ASN1Writer writer) throws IOException
Encodes this matched values filter as an ASN.1 element.- Parameters:
writer- The ASN1Writer to use to encode this matched values filter.- Throws:
IOException- if an error occurs while encoding.
-
decode
public static MatchedValuesFilter decode(ASN1Reader reader) throws LDAPException
Decodes the provided ASN.1 element as a matched values filter item.- Parameters:
reader- The ASN.1 reader.- Returns:
- The decoded matched values filter.
- Throws:
LDAPException- If a problem occurs while attempting to decode the filter item.
-
getMatchType
public byte getMatchType()
Retrieves the match type for this matched values filter.- Returns:
- The match type for this matched values filter.
-
getRawAttributeType
public String getRawAttributeType()
Retrieves the raw, unprocessed attribute type for this matched values filter.- Returns:
- The raw, unprocessed attribute type for this matched values
filter, or
nullif there is none.
-
getAttributeType
public AttributeType getAttributeType()
Retrieves the attribute type for this matched values filter.- Returns:
- The attribute type for this matched values filter, or
nullif there is none.
-
getRawAssertionValue
public ByteString getRawAssertionValue()
Retrieves the raw, unprocessed assertion value for this matched values filter.- Returns:
- The raw, unprocessed assertion value for this matched values
filter, or
nullif there is none.
-
getAssertionValue
public ByteString getAssertionValue()
Retrieves the assertion value for this matched values filter.- Returns:
- The assertion value for this matched values filter, or
nullif there is none.
-
getSubInitialElement
public ByteString getSubInitialElement()
Retrieves the subInitial element for this matched values filter.- Returns:
- The subInitial element for this matched values filter, or
nullif there is none.
-
getSubAnyElements
public List<ByteString> getSubAnyElements()
Retrieves the set of subAny elements for this matched values filter.- Returns:
- The set of subAny elements for this matched values filter. If
there are none, then the return value may be either
nullor an empty list.
-
getSubFinalElement
public ByteString getSubFinalElement()
Retrieves the subFinal element for this matched values filter.- Returns:
- The subFinal element for this matched values filter, or
nullif there is none.
-
getMatchingRuleID
public String getMatchingRuleID()
Retrieves the matching rule ID for this matched values filter.- Returns:
- The matching rule ID for this matched values filter, or
nullif there is none.
-
getMatchingRule
public MatchingRule getMatchingRule()
Retrieves the matching rule for this matched values filter.- Returns:
- The matching rule for this matched values filter, or
nullif there is none.
-
getApproximateMatchingRule
public MatchingRule getApproximateMatchingRule()
Retrieves the approximate matching rule that should be used for this matched values filter.- Returns:
- The approximate matching rule that should be used for this matched
values filter, or
nullif there is none.
-
getEqualityMatchingRule
public MatchingRule getEqualityMatchingRule()
Retrieves the equality matching rule that should be used for this matched values filter.- Returns:
- The equality matching rule that should be used for this matched
values filter, or
nullif there is none.
-
getOrderingMatchingRule
public MatchingRule getOrderingMatchingRule()
Retrieves the ordering matching rule that should be used for this matched values filter.- Returns:
- The ordering matching rule that should be used for this matched
values filter, or
nullif there is none.
-
getSubstringMatchingRule
public MatchingRule getSubstringMatchingRule()
Retrieves the substring matching rule that should be used for this matched values filter.- Returns:
- The substring matching rule that should be used for this matched
values filter, or
nullif there is none.
-
valueMatches
public boolean valueMatches(AttributeType type, ByteString value)
Indicates whether the specified attribute value matches the criteria defined in this matched values filter.- Parameters:
type- The attribute type with which the provided value is associated.value- The attribute value for which to make the determination.- Returns:
trueif the specified attribute value matches the criteria defined in this matched values filter, orfalseif not.
-
toString
public String toString()
Retrieves a string representation of this matched values filter, as an RFC 2254-compliant filter string.
-
toString
public void toString(StringBuilder buffer)
Appends a string representation of this matched values filter, as an RFC 2254-compliant filter string, to the provided buffer.- Parameters:
buffer- The buffer to which the filter string should be appended.
-
-