Package org.ldaptive.auth
Class AuthenticationResponse
java.lang.Object
org.ldaptive.AbstractMessage
org.ldaptive.AbstractResult
org.ldaptive.auth.AuthenticationResponse
Synthetic response object that encapsulates data used for authentication.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.ldaptive.AbstractResult
AbstractResult.AbstractBuilder<B,T extends AbstractResult>, AbstractResult.DiagnosticMessageHandler, AbstractResult.MatchedDNHandler, AbstractResult.ReferralHandler, AbstractResult.ResultCodeHandler Nested classes/interfaces inherited from class org.ldaptive.AbstractMessage
AbstractMessage.ControlParser, AbstractMessage.ControlsHandler, AbstractMessage.MessageIDHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AccountStateAccount state.private AuthenticationHandlerResponseResult of the authentication operation.private static final inthash code seed.private LdapEntryLdap entry of authenticated user.private StringResolved DN.Fields inherited from interface org.ldaptive.Result
ENCODE_CNTRL_CHARS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDefault constructor.AuthenticationResponse(AuthenticationHandlerResponse response, String dn, LdapEntry entry) Creates a new authentication response. -
Method Summary
Modifier and TypeMethodDescriptionprotected static AuthenticationResponse.Builderbuilder()Creates a builder for this class.booleanReturns the account state associated with the authenticated user.Returns the ldap entry of the authenticated user.Returns the DN that was resolved in order to perform authentication.inthashCode()Returns the hash code for this object.booleanReturns whether the authentication handler produced aAuthenticationResultCode.AUTHENTICATION_HANDLER_SUCCESSresult.voidsetAccountState(AccountState state) Sets the account state for the authenticated user.toString()Methods inherited from class org.ldaptive.AbstractResult
addReferralURLs, copyValues, getDiagnosticMessage, getMatchedDN, getReferralURLs, getResultCode, setDiagnosticMessage, setMatchedDN, setResultCodeMethods inherited from class org.ldaptive.AbstractMessage
addControls, copyValues, getControls, getMessageID, setMessageIDMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ldaptive.Message
getControl, getControls, getMessageIDMethods inherited from interface org.ldaptive.Result
getEncodedDiagnosticMessage
-
Field Details
-
HASH_CODE_SEED
private static final int HASH_CODE_SEEDhash code seed.- See Also:
-
authenticationHandlerResponse
Result of the authentication operation. -
resolvedDn
Resolved DN. -
ldapEntry
Ldap entry of authenticated user. -
accountState
Account state.
-
-
Constructor Details
-
AuthenticationResponse
private AuthenticationResponse()Default constructor. -
AuthenticationResponse
Creates a new authentication response.- Parameters:
response- authentication handler responsedn- produced by the DN resolverentry- of the authenticated user
-
-
Method Details
-
isSuccess
public boolean isSuccess()Returns whether the authentication handler produced aAuthenticationResultCode.AUTHENTICATION_HANDLER_SUCCESSresult.- Returns:
- whether authentication was successful
-
getAuthenticationResultCode
-
getAuthenticationHandlerResponse
-
getResolvedDn
Returns the DN that was resolved in order to perform authentication.- Returns:
- resolved dn
-
getLdapEntry
Returns the ldap entry of the authenticated user.- Returns:
- ldap entry
-
getAccountState
Returns the account state associated with the authenticated user.- Returns:
- account state
-
setAccountState
Sets the account state for the authenticated user.- Parameters:
state- for this user
-
equals
- Overrides:
equalsin classAbstractResult
-
hashCode
public int hashCode()Description copied from class:AbstractMessageReturns the hash code for this object.- Specified by:
hashCodein classAbstractMessage- Returns:
- hash code
-
toString
- Overrides:
toStringin classAbstractResult
-
builder
Creates a builder for this class.- Returns:
- new builder
-