public final class MatchedValuesRequestControl extends Object implements Control
The matched values request control supports a subset of the LDAP filter type defined in RFC 4511, and is defined as follows:
ValuesReturnFilter ::= SEQUENCE OF SimpleFilterItem SimpleFilterItem ::= CHOICE { equalityMatch [3] AttributeValueAssertion, substrings [4] SubstringFilter, greaterOrEqual [5] AttributeValueAssertion, lessOrEqual [6] AttributeValueAssertion, present [7] AttributeDescription, approxMatch [8] AttributeValueAssertion, extensibleMatch [9] SimpleMatchingAssertion } SimpleMatchingAssertion ::= SEQUENCE { matchingRule [1] MatchingRuleId OPTIONAL, type [2] AttributeDescription OPTIONAL, --- at least one of the above must be present matchValue [3] AssertionValue}For example Barbara Jensen's entry contains two common name values, Barbara Jensen and Babs Jensen. The following code retrieves only the latter.
String DN = "uid=bjensen,ou=People,dc=example,dc=com"; SearchRequest request = Requests.newSearchRequest(DN, SearchScope.BASE_OBJECT, "(objectclass=*)", "cn") .addControl(MatchedValuesRequestControl .newControl(true, "(cn=Babs Jensen)")); // Get the entry, retrieving cn: Babs Jensen, not cn: Barbara Jensen SearchResultEntry entry = connection.searchSingleEntry(request);
Modifier and Type | Field and Description |
---|---|
static ControlDecoder<MatchedValuesRequestControl> |
DECODER
A decoder which can be used for decoding the matched values request control.
|
static String |
OID
The OID for the matched values request control used to specify which
particular attribute values should be returned in a search result entry.
|
Modifier and Type | Method and Description |
---|---|
Collection<Filter> |
getFilters()
Returns an unmodifiable collection containing the list of filters
associated with this matched values control.
|
String |
getOid()
Returns the numeric OID associated with this control.
|
ByteString |
getValue()
Returns the value, if any, associated with this control.
|
boolean |
hasValue()
Returns
true if this control has a value. |
boolean |
isCritical()
Returns
true if it is unacceptable to perform the operation
without applying the semantics of this control. |
static MatchedValuesRequestControl |
newControl(boolean isCritical,
Collection<Filter> filters)
Creates a new matched values request control with the provided
criticality and list of filters.
|
static MatchedValuesRequestControl |
newControl(boolean isCritical,
String... filters)
Creates a new matched values request control with the provided
criticality and list of filters.
|
String |
toString() |
public static final String OID
public static final ControlDecoder<MatchedValuesRequestControl> DECODER
public static MatchedValuesRequestControl newControl(boolean isCritical, Collection<Filter> filters)
isCritical
- true
if it is unacceptable to perform the operation
without applying the semantics of this control, or
false
if it can be ignored.filters
- The list of filters of which at least one must match an
attribute value in order for the attribute value to be
returned to the client. The list must not be empty.LocalizedIllegalArgumentException
- If one or more filters failed to conform to the filter
constraints defined in RFC 3876.IllegalArgumentException
- If filters
was empty.NullPointerException
- If filters
was null
.public static MatchedValuesRequestControl newControl(boolean isCritical, String... filters)
isCritical
- true
if it is unacceptable to perform the operation
without applying the semantics of this control, or
false
if it can be ignored.filters
- The list of filters of which at least one must match an
attribute value in order for the attribute value to be
returned to the client. The list must not be empty.LocalizedIllegalArgumentException
- If one or more filters could not be parsed, or if one or more
filters failed to conform to the filter constraints defined
in RFC 3876.NullPointerException
- If filters
was null
.public Collection<Filter> getFilters()
public String getOid()
Control
public ByteString getValue()
Control
public boolean hasValue()
Control
true
if this control has a value. In some circumstances
it may be useful to determine if a control has a value, without actually
calculating the value and incurring any performance costs.public boolean isCritical()
Control
true
if it is unacceptable to perform the operation
without applying the semantics of this control.
The criticality field only has meaning in controls attached to request
messages (except UnbindRequest). For controls attached to response
messages and the UnbindRequest, the criticality field SHOULD be
false
, and MUST be ignored by the receiving protocol peer. A
value of true
indicates that it is unacceptable to perform the
operation without applying the semantics of the control.
isCritical
in interface Control
true
if this control must be processed by the Directory
Server, or false
if it can be ignored.Copyright 2010-2022 ForgeRock AS.