public interface CompareResult extends Result
If the attribute value assertion in the Compare request matched a value of
the attribute or sub-type according to the attribute's equality matching rule
then the result code is set to ResultCode.COMPARE_TRUE
and can be
determined by invoking the matched()
method.
The following excerpt shows how to use the Compare operation to check whether a member belongs to a (possibly large) static group.
Connection connection = ...; String groupDN = ...; String memberDN = ...; CompareRequest request = Requests.newCompareRequest(groupDN, "member", memberDN); CompareResult result = connection.compare(request); if (result.matched()) { // The member belongs to the group. }
Modifier and Type | Method and Description |
---|---|
CompareResult |
addControl(Control control)
Adds the provided control to this response.
|
CompareResult |
addReferralURI(String uri)
Adds the provided referral URI to this result.
|
Throwable |
getCause()
Returns the throwable cause associated with this result if available.
|
<C extends Control> |
getControl(ControlDecoder<C> decoder,
DecodeOptions options)
Decodes and returns the first control in this response having an OID
corresponding to the provided control decoder.
|
List<Control> |
getControls()
Returns a
List containing the controls included with this
response. |
String |
getDiagnosticMessage()
Returns the diagnostic message associated with this result.
|
String |
getMatchedDN()
Returns the matched DN associated with this result.
|
List<String> |
getReferralURIs()
Returns a
List containing the referral URIs included with this
result. |
ResultCode |
getResultCode()
Returns the result code associated with this result.
|
boolean |
isReferral()
Indicates whether a referral needs to be chased in order to
complete the operation.
|
boolean |
isSuccess()
Indicates whether the request succeeded or not.
|
boolean |
matched()
Indicates whether the attribute value assertion in the Compare
request matched a value of the attribute or sub-type according to the
attribute's equality matching rule.
|
CompareResult |
setCause(Throwable cause)
Sets the throwable cause associated with this result if available.
|
CompareResult |
setDiagnosticMessage(String message)
Sets the diagnostic message associated with this result.
|
CompareResult |
setMatchedDN(String dn)
Sets the matched DN associated with this result.
|
CompareResult |
setResultCode(ResultCode resultCode)
Sets the result code associated with this result.
|
containsControl
CompareResult addControl(Control control)
Response
addControl
in interface Response
addControl
in interface Result
control
- The control to be added.CompareResult addReferralURI(String uri)
Result
addReferralURI
in interface Result
uri
- The referral URI to be added.Throwable getCause()
Result
<C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException
Response
getControl
in interface Response
getControl
in interface Result
C
- The type of control to be decoded and returned.decoder
- The control decoder.options
- The set of decode options which should be used when decoding
the control.null
if the control is not
included with this response.DecodeException
- If the control could not be decoded because it was malformed
in some way (e.g. the control value was missing, or its
content could not be decoded).List<Control> getControls()
Response
List
containing the controls included with this
response. The returned List
may be modified if permitted by this
response.getControls
in interface Response
getControls
in interface Result
List
containing the controls.String getDiagnosticMessage()
Result
getDiagnosticMessage
in interface Result
null
).String getMatchedDN()
Result
getMatchedDN
in interface Result
null
).List<String> getReferralURIs()
Result
List
containing the referral URIs included with this
result. The returned List
may be modified if permitted by this
result.getReferralURIs
in interface Result
List
containing the referral URIs.ResultCode getResultCode()
Result
getResultCode
in interface Result
boolean isReferral()
Result
Specifically, this method returns true
if the result code is
equal to ResultCode.REFERRAL
.
isReferral
in interface Result
true
if a referral needs to be chased, otherwise
false
.boolean isSuccess()
Result
boolean matched()
Specifically, this method returns true
if the result code is
equal to ResultCode.COMPARE_TRUE
.
true
if the attribute value assertion matched, otherwise
false
.CompareResult setCause(Throwable cause)
Result
CompareResult setDiagnosticMessage(String message)
Result
setDiagnosticMessage
in interface Result
message
- The diagnostic message, which may be empty or null
indicating that none was provided.CompareResult setMatchedDN(String dn)
Result
setMatchedDN
in interface Result
dn
- The matched DN associated, which may be empty or null
indicating that none was provided.CompareResult setResultCode(ResultCode resultCode)
Result
setResultCode
in interface Result
resultCode
- The result code.Copyright 2010-2017 ForgeRock AS.