public interface Result extends Response
getResultCode()
. This indicates the overall outcome of the operation.
In particular, whether it succeeded which is indicated using a value
of ResultCode.SUCCESS
.
getDiagnosticMessage()
. At the server's discretion, a diagnostic
message may be included in a Result in order to supplement the result code
with additional human-readable information.
getMatchedDn()
. For certain result codes, this is used to indicate to
the client the last entry used in finding the Request's target (or base)
entry.
getReferralUris()
. Referrals are present in a Result if the result
code is set to ResultCode.REFERRAL
, and it are absent with all other
result codes.
Modifier and Type | Method and Description |
---|---|
Result |
addControl(Control control)
Adds the provided control to this protocol-op.
|
Result |
addControls(Iterable<? extends Control> controls)
Adds the provided controls to this protocol-op.
|
Result |
addReferralUri(String uri)
Adds the provided referral URI to this result.
|
default Result |
copyFrom(Result result)
Copies the result code, cause, diagnostic message, matched DN and referral URIs from the provided result 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 protocol-op having an OID
corresponding to the provided control decoder.
|
List<Control> |
getControls()
Returns a
List containing the controls included with this
protocol-op. |
LocalizableMessage |
getDiagnosticMessage()
Returns the diagnostic message associated with this result.
|
String |
getDiagnosticMessageAsString()
Returns the diagnostic message associated with this result as a string.
|
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.
|
Result |
setCause(Throwable cause)
Sets the throwable cause associated with this result if available.
|
Result |
setDiagnosticMessage(CharSequence message)
Sets the diagnostic message associated with this result.
|
Result |
setMatchedDn(Dn dn)
Sets the matched DN associated with this result.
|
Result |
setMatchedDn(String dn)
Sets the matched DN associated with this result.
|
Result |
setResultCode(ResultCode resultCode)
Sets the result code associated with this result.
|
containsControl, getControl
Result addControl(Control control)
ProtocolOp
addControl
in interface ProtocolOp
addControl
in interface Response
control
- The control to be added to this protocol-op.Result addControls(Iterable<? extends Control> controls)
ProtocolOp
addControls
in interface ProtocolOp
addControls
in interface Response
controls
- The controls to be added to this protocol-op.Result addReferralUri(String uri)
uri
- The referral URI to be added.UnsupportedOperationException
- If this result does not permit referrals to be added.NullPointerException
- If uri
was null
.Throwable getCause()
null
if none was provided.<C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException
ProtocolOp
getControl
in interface ProtocolOp
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 protocol-op.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()
ProtocolOp
List
containing the controls included with this
protocol-op. The returned List
may be modified if permitted by this
protocol-op.getControls
in interface ProtocolOp
List
containing the controls.LocalizableMessage getDiagnosticMessage()
null
).String getDiagnosticMessageAsString()
null
).String getMatchedDn()
null
).List<String> getReferralUris()
List
containing the referral URIs included with this
result. The returned List
may be modified if permitted by this
result.List
containing the referral URIs.ResultCode getResultCode()
boolean isReferral()
Specifically, this method returns true
if the result code is
equal to ResultCode.REFERRAL
.
true
if a referral needs to be chased, otherwise
false
.boolean isSuccess()
true
if the request succeeded, otherwise false
.Result setCause(Throwable cause)
cause
- The throwable cause, which may be null
indicating that
none was provided.UnsupportedOperationException
- If this result does not permit the cause to be set.Result setDiagnosticMessage(CharSequence message)
message
- The diagnostic message, which may be empty or null
indicating that none was provided.UnsupportedOperationException
- If this result does not permit the diagnostic message to be
set.Result setMatchedDn(String dn)
dn
- The matched DN associated, which may be empty or null
indicating that none was provided.UnsupportedOperationException
- If this result does not permit the matched DN to be set.Result setMatchedDn(Dn dn)
dn
- The matched DN associated, which may be empty or null
indicating that none was provided.UnsupportedOperationException
- If this result does not permit the matched DN to be set.Result setResultCode(ResultCode resultCode)
resultCode
- The result code.UnsupportedOperationException
- If this result does not permit the result code to be set.NullPointerException
- If resultCode
was null
.default Result copyFrom(Result result)
The current result code, cause, diagnostic message and matched DN will be overwritten, while the provided referral URIs will be added to the list of referral URIs.
result
- The result from which to copy the attributes.Copyright 2010-2022 ForgeRock AS.