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 booleanWhether this object has been marked immutable.private LdapEntryLdap entry of authenticated user.private StringResolved DN. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDefault constructor.AuthenticationResponse(AuthenticationHandlerResponse response, String dn, LdapEntry entry) Creates a new authentication response. -
Method Summary
Modifier and TypeMethodDescriptionvoidAsserts that this object is in a state to permit mutations.(package private) static AuthenticationResponse.Builderbuilder()Creates a builder for this class.booleanvoidfreeze()Freezes this object, making it immutable.Returns the account state associated with the authenticated user.Return authentication handler response.Return authentication result code.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.booleanisFrozen()Determines whether this object is frozen, i.e. immutable.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, equalsResult, getDiagnosticMessage, getMatchedDN, getReferralURLs, getResultCode, setDiagnosticMessage, setMatchedDN, setResultCodeMethods inherited from class org.ldaptive.AbstractMessage
addControls, copyValues, equalsMessage, 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. -
immutable
private volatile boolean immutableWhether this object has been marked immutable.
-
-
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
-
freeze
public void freeze()Description copied from interface:FreezableFreezes this object, making it immutable. -
isFrozen
public boolean isFrozen()Description copied from interface:FreezableDetermines whether this object is frozen, i.e. immutable.- Specified by:
isFrozenin interfaceFreezable- Returns:
- True if
Freezable.freeze()has been invoked, false otherwise.
-
assertMutable
public void assertMutable()Description copied from interface:FreezableAsserts that this object is in a state to permit mutations. Classes that implement this interface should invoke this method prior to performing any mutation of internal state as a means of implementing the "frozen" usage contract.- Specified by:
assertMutablein interfaceFreezable
-
isSuccess
public boolean isSuccess()Returns whether the authentication handler produced aAuthenticationResultCode.AUTHENTICATION_HANDLER_SUCCESSresult. -
getAuthenticationResultCode
Return authentication result code.- Returns:
- authentication result code
-
getAuthenticationHandlerResponse
Return authentication handler response.- Returns:
- authentication handler response
-
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
-