S
- The type of Extended result.public abstract class AbstractExtendedResult<S extends ExtendedResult> extends Object implements ExtendedResult
Modifier | Constructor and Description |
---|---|
protected |
AbstractExtendedResult(ExtendedResult extendedResult)
Creates a new extended result that is an exact copy of the provided
result.
|
protected |
AbstractExtendedResult(ResultCode resultCode)
Creates a new extended result using the provided result code.
|
Modifier and Type | Method and Description |
---|---|
S |
addControl(Control control)
Adds the provided control to this response.
|
S |
addReferralURI(String uri)
Adds the provided referral URI to this result.
|
boolean |
containsControl(String oid)
Returns
true if this response contains the specified response
control. |
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.
|
abstract String |
getOID()
Returns the numeric OID, if any, associated with this extended 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.
|
abstract ByteString |
getValue()
Returns the value, if any, associated with this extended result.
|
abstract boolean |
hasValue()
Returns
true if this extended result has a value. |
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.
|
S |
setCause(Throwable cause)
Sets the throwable cause associated with this result if available.
|
S |
setDiagnosticMessage(String message)
Sets the diagnostic message associated with this result.
|
S |
setMatchedDN(String dn)
Sets the matched DN associated with this result.
|
S |
setResultCode(ResultCode resultCode)
Sets the result code associated with this result.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addControl, addReferralURI, getCause, getControl, getControls, getDiagnosticMessage, getMatchedDN, getReferralURIs, getResultCode, isReferral, isSuccess, setCause, setDiagnosticMessage, setMatchedDN, setResultCode
containsControl
protected AbstractExtendedResult(ExtendedResult extendedResult)
extendedResult
- The extended result to be copied.NullPointerException
- If extendedResult
was null
.protected AbstractExtendedResult(ResultCode resultCode)
resultCode
- The result code.NullPointerException
- If resultCode
was null
.public abstract String getOID()
ExtendedResult
getOID
in interface ExtendedResult
null
if there is no OID.public abstract ByteString getValue()
ExtendedResult
getValue
in interface ExtendedResult
null
if there is no value.public abstract boolean hasValue()
ExtendedResult
true
if this extended result has a value. In some
circumstances it may be useful to determine if a extended result has a
value, without actually calculating the value and incurring any
performance costs.hasValue
in interface ExtendedResult
true
if this extended result has a value, or
false
if there is no value.public final S addReferralURI(String uri)
Result
addReferralURI
in interface Result
uri
- The referral URI to be added.public final Throwable getCause()
Result
public final String getDiagnosticMessage()
Result
getDiagnosticMessage
in interface Result
null
).public final String getMatchedDN()
Result
getMatchedDN
in interface Result
null
).public final 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.public final ResultCode getResultCode()
Result
getResultCode
in interface Result
public final 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
.public final boolean isSuccess()
Result
public final S setCause(Throwable cause)
Result
public final S setDiagnosticMessage(String message)
Result
setDiagnosticMessage
in interface Result
message
- The diagnostic message, which may be empty or null
indicating that none was provided.public final S setMatchedDN(String dn)
Result
setMatchedDN
in interface Result
dn
- The matched DN associated, which may be empty or null
indicating that none was provided.public final S setResultCode(ResultCode resultCode)
Result
setResultCode
in interface Result
resultCode
- The result code.public final S addControl(Control control)
Response
addControl
in interface Response
control
- The control to be added.public boolean containsControl(String oid)
Response
true
if this response contains the specified response
control.containsControl
in interface Response
oid
- The numeric OID of the response control.true
if this response contains the specified response
control.public final <C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException
Response
getControl
in interface Response
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).public final 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
List
containing the controls.Copyright 2010-2017 ForgeRock AS.