public interface BindResult extends Result
A successful Bind operation is indicated by a Bind result with a result code
set to ResultCode.SUCCESS
and can be determined by invoking the
isSuccess()
method.
The server SASL credentials field is used as part of a SASL-defined bind mechanism to allow the client to authenticate the server to which it is communicating, or to perform "challenge-response" authentication. If the client bound using a form of simple authentication, or the SASL mechanism does not require the server to return information to the client, then this field shall not be included in the Bind result.
If the server requires the client to send a new SASL Bind request in order to
continue the authentication process then the result code is set to
ResultCode.SASL_BIND_IN_PROGRESS
and can be determined by invoking
the isSaslBindInProgress()
method.
Modifier and Type | Method and Description |
---|---|
BindResult |
addControl(Control control)
Adds the provided control to this protocol-op.
|
BindResult |
addControls(Iterable<? extends Control> controls)
Adds the provided controls to this protocol-op.
|
BindResult |
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 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.
|
SaslServer |
getSaslServer()
Returns the
SaslServer to use by the underlying connection, or null if SASL integrity and/or
privacy protection must not be enabled. |
ByteString |
getServerSaslCredentials()
Returns the server SASL credentials associated with this bind result.
|
boolean |
isReferral()
Indicates whether a referral needs to be chased in order to
complete the operation.
|
boolean |
isSaslBindInProgress()
Indicates whether the server requires the client to send a new
SASL Bind request with the same SASL mechanism in order to continue the
authentication process.
|
boolean |
isSuccess()
Indicates whether the request succeeded or not.
|
BindResult |
setCause(Throwable cause)
Sets the throwable cause associated with this result if available.
|
BindResult |
setDiagnosticMessage(CharSequence message)
Sets the diagnostic message associated with this result.
|
BindResult |
setMatchedDn(Dn dn)
Sets the matched DN associated with this result.
|
BindResult |
setMatchedDn(String dn)
Sets the matched DN associated with this result.
|
BindResult |
setResultCode(ResultCode resultCode)
Sets the result code associated with this result.
|
BindResult |
setSaslServer(SaslServer saslServer)
Sets the
SaslServer to use by the underlying connection. |
BindResult |
setServerSaslCredentials(ByteString credentials)
Sets the server SASL credentials associated with this bind result.
|
containsControl, getControl
BindResult addControl(Control control)
ProtocolOp
addControl
in interface ProtocolOp
addControl
in interface Response
addControl
in interface Result
control
- The control to be added to this protocol-op.BindResult addControls(Iterable<? extends Control> controls)
ProtocolOp
addControls
in interface ProtocolOp
addControls
in interface Response
addControls
in interface Result
controls
- The controls to be added to this protocol-op.BindResult 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
ProtocolOp
getControl
in interface ProtocolOp
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 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
getControls
in interface Result
List
containing the controls.LocalizableMessage getDiagnosticMessage()
Result
getDiagnosticMessage
in interface Result
null
).String getDiagnosticMessageAsString()
Result
getDiagnosticMessageAsString
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
SaslServer getSaslServer()
SaslServer
to use by the underlying connection, or null
if SASL integrity and/or
privacy protection must not be enabled.SaslServer
to use by the underlying connection, or null
if SASL integrity and/or
privacy protection must not enabled.ByteString getServerSaslCredentials()
null
indicating that none
was provided.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 isSaslBindInProgress()
Specifically, this method returns true
if the result code is
equal to ResultCode.SASL_BIND_IN_PROGRESS
.
true
if the server requires the client to send a new SASL
Bind request, otherwise false
.boolean isSuccess()
Result
BindResult setCause(Throwable cause)
Result
BindResult setDiagnosticMessage(CharSequence message)
Result
setDiagnosticMessage
in interface Result
message
- The diagnostic message, which may be empty or null
indicating that none was provided.BindResult setMatchedDn(String dn)
Result
setMatchedDn
in interface Result
dn
- The matched DN associated, which may be empty or null
indicating that none was provided.BindResult setMatchedDn(Dn dn)
Result
setMatchedDn
in interface Result
dn
- The matched DN associated, which may be empty or null
indicating that none was provided.BindResult setResultCode(ResultCode resultCode)
Result
setResultCode
in interface Result
resultCode
- The result code.BindResult setSaslServer(SaslServer saslServer)
SaslServer
to use by the underlying connection.saslServer
- The SaslServer
to use by the underlying connection, or null
if SASL integrity and/or
privacy protection must not enabled.UnsupportedOperationException
- If this bind result does not permit the server SASL credentials to be set.BindResult setServerSaslCredentials(ByteString credentials)
credentials
- The server SASL credentials associated with this bind result,
which may be null
indicating that none was provided.UnsupportedOperationException
- If this bind result does not permit the server SASL
credentials to be set.Copyright 2010-2022 ForgeRock AS.