Interface BindResult
-
- All Superinterfaces:
ProtocolOp
,Response
,Result
public interface BindResult extends Result
A Bind result indicates the status of the client's request for authentication.A successful Bind operation is indicated by a Bind result with a result code set to
ResultCode.SUCCESS
and can be determined by invoking theisSuccess()
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 theisSaslBindInProgress()
method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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>
CgetControl(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 aList
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 aList
containing the referral URIs included with this result.ResultCode
getResultCode()
Returns the result code associated with this result.SaslServer
getSaslServer()
Returns theSaslServer
to use by the underlying connection, ornull
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(String dn)
Sets the matched DN associated with this result.BindResult
setMatchedDn(Dn 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 theSaslServer
to use by the underlying connection.BindResult
setServerSaslCredentials(ByteString credentials)
Sets the server SASL credentials associated with this bind result.-
Methods inherited from interface org.forgerock.opendj.ldap.messages.ProtocolOp
containsControl, getControl
-
-
-
-
Method Detail
-
addControl
BindResult addControl(Control control)
Description copied from interface:ProtocolOp
Adds the provided control to this protocol-op.- Specified by:
addControl
in interfaceProtocolOp
- Specified by:
addControl
in interfaceResponse
- Specified by:
addControl
in interfaceResult
- Parameters:
control
- The control to be added to this protocol-op.- Returns:
- This protocol-op.
-
addControls
BindResult addControls(Iterable<? extends Control> controls)
Description copied from interface:ProtocolOp
Adds the provided controls to this protocol-op.- Specified by:
addControls
in interfaceProtocolOp
- Specified by:
addControls
in interfaceResponse
- Specified by:
addControls
in interfaceResult
- Parameters:
controls
- The controls to be added to this protocol-op.- Returns:
- This protocol-op.
-
addReferralUri
BindResult addReferralUri(String uri)
Description copied from interface:Result
Adds the provided referral URI to this result.- Specified by:
addReferralUri
in interfaceResult
- Parameters:
uri
- The referral URI to be added.- Returns:
- This result.
-
getCause
Throwable getCause()
Description copied from interface:Result
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.
-
getControl
<C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException
Description copied from interface:ProtocolOp
Decodes and returns the first control in this protocol-op having an OID corresponding to the provided control decoder.- Specified by:
getControl
in interfaceProtocolOp
- Specified by:
getControl
in interfaceResult
- Type Parameters:
C
- The type of control to be decoded and returned.- Parameters:
decoder
- The control decoder.options
- The set of decode options which should be used when decoding the control.- Returns:
- The decoded control, or
null
if the control is not included with this protocol-op. - Throws:
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).
-
getControls
List<Control> getControls()
Description copied from interface:ProtocolOp
Returns aList
containing the controls included with this protocol-op. The returnedList
may be modified if permitted by this protocol-op.- Specified by:
getControls
in interfaceProtocolOp
- Specified by:
getControls
in interfaceResult
- Returns:
- A
List
containing the controls.
-
getDiagnosticMessage
LocalizableMessage getDiagnosticMessage()
Description copied from interface:Result
Returns the diagnostic message associated with this result.- Specified by:
getDiagnosticMessage
in interfaceResult
- Returns:
- The diagnostic message, which may be empty if none was provided
(never
null
).
-
getDiagnosticMessageAsString
String getDiagnosticMessageAsString()
Description copied from interface:Result
Returns the diagnostic message associated with this result as a string.- Specified by:
getDiagnosticMessageAsString
in interfaceResult
- Returns:
- The diagnostic message, which may be empty if none was provided
(never
null
).
-
getMatchedDn
String getMatchedDn()
Description copied from interface:Result
Returns the matched DN associated with this result.- Specified by:
getMatchedDn
in interfaceResult
- Returns:
- The matched DN, which may be empty if none was provided (never
null
).
-
getReferralUris
List<String> getReferralUris()
Description copied from interface:Result
Returns aList
containing the referral URIs included with this result. The returnedList
may be modified if permitted by this result.- Specified by:
getReferralUris
in interfaceResult
- Returns:
- A
List
containing the referral URIs.
-
getResultCode
ResultCode getResultCode()
Description copied from interface:Result
Returns the result code associated with this result.- Specified by:
getResultCode
in interfaceResult
- Returns:
- The result code.
-
getSaslServer
SaslServer getSaslServer()
Returns theSaslServer
to use by the underlying connection, ornull
if SASL integrity and/or privacy protection must not be enabled.- Returns:
- The
SaslServer
to use by the underlying connection, ornull
if SASL integrity and/or privacy protection must not enabled.
-
getServerSaslCredentials
ByteString getServerSaslCredentials()
Returns the server SASL credentials associated with this bind result.- Returns:
- The server SASL credentials, or
null
indicating that none was provided.
-
isReferral
boolean isReferral()
Description copied from interface:Result
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
.- Specified by:
isReferral
in interfaceResult
- Returns:
true
if a referral needs to be chased, otherwisefalse
.
-
isSaslBindInProgress
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. This typically occurs during multi-stage (challenge response) authentication.Specifically, this method returns
true
if the result code is equal toResultCode.SASL_BIND_IN_PROGRESS
.- Returns:
true
if the server requires the client to send a new SASL Bind request, otherwisefalse
.
-
isSuccess
boolean isSuccess()
Description copied from interface:Result
Indicates whether the request succeeded or not. This method will return {code true} for all non-error responses.
-
setCause
BindResult setCause(Throwable cause)
Description copied from interface:Result
Sets 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.
-
setDiagnosticMessage
BindResult setDiagnosticMessage(CharSequence message)
Description copied from interface:Result
Sets the diagnostic message associated with this result.- Specified by:
setDiagnosticMessage
in interfaceResult
- Parameters:
message
- The diagnostic message, which may be empty ornull
indicating that none was provided.- Returns:
- This result.
-
setMatchedDn
BindResult setMatchedDn(String dn)
Description copied from interface:Result
Sets the matched DN associated with this result.- Specified by:
setMatchedDn
in interfaceResult
- Parameters:
dn
- The matched DN associated, which may be empty ornull
indicating that none was provided.- Returns:
- This result.
-
setMatchedDn
BindResult setMatchedDn(Dn dn)
Description copied from interface:Result
Sets the matched DN associated with this result.- Specified by:
setMatchedDn
in interfaceResult
- Parameters:
dn
- The matched DN associated, which may be empty ornull
indicating that none was provided.- Returns:
- This result.
-
setResultCode
BindResult setResultCode(ResultCode resultCode)
Description copied from interface:Result
Sets the result code associated with this result.- Specified by:
setResultCode
in interfaceResult
- Parameters:
resultCode
- The result code.- Returns:
- This result.
-
setSaslServer
BindResult setSaslServer(SaslServer saslServer)
Sets theSaslServer
to use by the underlying connection.- Parameters:
saslServer
- TheSaslServer
to use by the underlying connection, ornull
if SASL integrity and/or privacy protection must not enabled.- Returns:
- This bind result.
- Throws:
UnsupportedOperationException
- If this bind result does not permit the server SASL credentials to be set.
-
setServerSaslCredentials
BindResult setServerSaslCredentials(ByteString credentials)
Sets the server SASL credentials associated with this bind result.- Parameters:
credentials
- The server SASL credentials associated with this bind result, which may benull
indicating that none was provided.- Returns:
- This bind result.
- Throws:
UnsupportedOperationException
- If this bind result does not permit the server SASL credentials to be set.
-
-