Interface Result
- All Superinterfaces:
ProtocolOp
,Response
- All Known Subinterfaces:
ExtendedResult
- All Known Implementing Classes:
BindResult
,CompareResult
,GenericExtendedResult
,PasswordModifyExtendedResult
,StartTlsExtendedResult
,WhoAmIExtendedResult
A Result is used to indicate the status of an operation performed by the server. A Result comprises several fields:
- The result code can be retrieved using the method
resultCode()
. This indicates the overall outcome of the operation. In particular, whether it succeeded which is indicated using a value ofResultCode.SUCCESS
. - The optional diagnostic message can be retrieved using the method
diagnosticMessage()
. 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. - The optional matched DN can be retrieved using the method
matchedDn()
. 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. - The optional referrals can be retrieved using the method
referralUris()
. Referrals are present in a Result if the result code is set toResultCode.REFERRAL
, and it are absent with all other result codes.
-
Method Summary
Modifier and TypeMethodDescriptioncause()
Returns the throwable cause associated with this result if available.Returns the diagnostic message associated with this result.default String
Returns the diagnostic message associated with this result as a string.default boolean
Indicates whether a referral needs to be chased in order to complete the operation.default boolean
Indicates whether the request succeeded or not.Returns the matched DN associated with this result.Returns aList
containing the referral URIs included with this result.Returns the result code associated with this result.Methods inherited from interface org.forgerock.opendj.ldap.messages.ProtocolOp
addControl, addControls, containsControl, controls, getControl, getControl, removeControls
-
Method Details
-
cause
Throwable cause()Returns the throwable cause associated with this result if available. A cause may be provided in cases where a result indicates a failure due to a client-side error.- Returns:
- The throwable cause, or
null
if none was provided.
-
diagnosticMessage
LocalizableMessage diagnosticMessage()Returns the diagnostic message associated with this result.- Returns:
- The diagnostic message, which may be empty if none was provided (never
null
).
-
diagnosticMessageAsString
Returns the diagnostic message associated with this result as a string.- Returns:
- The diagnostic message, which may be empty if none was provided (never
null
).
-
matchedDn
String matchedDn()Returns the matched DN associated with this result.- Returns:
- The matched DN, which may be empty if none was provided (never
null
).
-
referralUris
Returns aList
containing the referral URIs included with this result. The returnedList
may be modified if permitted by this result.- Returns:
- A
List
containing the referral URIs.
-
resultCode
ResultCode resultCode()Returns the result code associated with this result.- Returns:
- The result code.
-
isReferral
default boolean isReferral()Indicates whether a referral needs to be chased in order to complete the operation.Specifically, this method returns
true
if the result code is equal toResultCode.REFERRAL
.- Returns:
true
if a referral needs to be chased, otherwisefalse
.
-
isSuccess
default boolean isSuccess()Indicates whether the request succeeded or not. This method will return {code true} for all non-error responses.- Returns:
true
if the request succeeded, otherwisefalse
.
-