Package org.ldaptive.auth
Class AuthenticationResponse
- java.lang.Object
-
- org.ldaptive.AbstractMessage
-
- org.ldaptive.AbstractResult
-
- org.ldaptive.auth.AuthenticationResponse
-
public final class AuthenticationResponse extends AbstractResult implements Freezable
Synthetic response object that encapsulates data used for authentication.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AuthenticationResponse.Builder
-
Nested 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
Fields Modifier and Type Field Description private AccountState
accountState
Account state.private AuthenticationHandlerResponse
authenticationHandlerResponse
Result of the authentication operation.private static int
HASH_CODE_SEED
hash code seed.private boolean
immutable
Whether this object has been marked immutable.private LdapEntry
ldapEntry
Ldap entry of authenticated user.private String
resolvedDn
Resolved DN.-
Fields inherited from interface org.ldaptive.Result
ENCODE_CNTRL_CHARS
-
-
Constructor Summary
Constructors Modifier Constructor Description private
AuthenticationResponse()
Default constructor.AuthenticationResponse(AuthenticationHandlerResponse response, String dn, LdapEntry entry)
Creates a new authentication response.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertMutable()
Asserts that this object is in a state to permit mutations.(package private) static AuthenticationResponse.Builder
builder()
Creates a builder for this class.boolean
equals(Object o)
void
freeze()
Freezes this object, making it immutable.AccountState
getAccountState()
Returns the account state associated with the authenticated user.AuthenticationHandlerResponse
getAuthenticationHandlerResponse()
AuthenticationResultCode
getAuthenticationResultCode()
LdapEntry
getLdapEntry()
Returns the ldap entry of the authenticated user.String
getResolvedDn()
Returns the DN that was resolved in order to perform authentication.int
hashCode()
Returns the hash code for this object.boolean
isFrozen()
Determines whether this object is frozen, i.e. immutable.boolean
isSuccess()
Returns whether the authentication handler produced aAuthenticationResultCode.AUTHENTICATION_HANDLER_SUCCESS
result.void
setAccountState(AccountState state)
Sets the account state for the authenticated user.String
toString()
-
Methods inherited from class org.ldaptive.AbstractResult
addReferralURLs, copyValues, equalsResult, getDiagnosticMessage, getMatchedDN, getReferralURLs, getResultCode, setDiagnosticMessage, setMatchedDN, setResultCode
-
Methods inherited from class org.ldaptive.AbstractMessage
addControls, copyValues, equalsMessage, getControls, getMessageID, setMessageID
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ldaptive.Message
getControl, getControls, getMessageID
-
Methods inherited from interface org.ldaptive.Result
getEncodedDiagnosticMessage
-
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
authenticationHandlerResponse
private AuthenticationHandlerResponse authenticationHandlerResponse
Result of the authentication operation.
-
resolvedDn
private String resolvedDn
Resolved DN.
-
ldapEntry
private LdapEntry ldapEntry
Ldap entry of authenticated user.
-
accountState
private AccountState accountState
Account state.
-
immutable
private volatile boolean immutable
Whether this object has been marked immutable.
-
-
Constructor Detail
-
AuthenticationResponse
private AuthenticationResponse()
Default constructor.
-
AuthenticationResponse
public AuthenticationResponse(AuthenticationHandlerResponse response, String dn, LdapEntry entry)
Creates a new authentication response.- Parameters:
response
- authentication handler responsedn
- produced by the DN resolverentry
- of the authenticated user
-
-
Method Detail
-
freeze
public void freeze()
Description copied from interface:Freezable
Freezes this object, making it immutable.
-
isFrozen
public boolean isFrozen()
Description copied from interface:Freezable
Determines whether this object is frozen, i.e. immutable.- Specified by:
isFrozen
in interfaceFreezable
- Returns:
- True if
Freezable.freeze()
has been invoked, false otherwise.
-
assertMutable
public void assertMutable()
Description copied from interface:Freezable
Asserts 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:
assertMutable
in interfaceFreezable
-
isSuccess
public boolean isSuccess()
Returns whether the authentication handler produced aAuthenticationResultCode.AUTHENTICATION_HANDLER_SUCCESS
result.
-
getAuthenticationResultCode
public AuthenticationResultCode getAuthenticationResultCode()
-
getAuthenticationHandlerResponse
public AuthenticationHandlerResponse getAuthenticationHandlerResponse()
-
getResolvedDn
public String getResolvedDn()
Returns the DN that was resolved in order to perform authentication.- Returns:
- resolved dn
-
getLdapEntry
public LdapEntry getLdapEntry()
Returns the ldap entry of the authenticated user.- Returns:
- ldap entry
-
getAccountState
public AccountState getAccountState()
Returns the account state associated with the authenticated user.- Returns:
- account state
-
setAccountState
public void setAccountState(AccountState state)
Sets the account state for the authenticated user.- Parameters:
state
- for this user
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractResult
-
hashCode
public int hashCode()
Description copied from class:AbstractMessage
Returns the hash code for this object.- Specified by:
hashCode
in classAbstractMessage
- Returns:
- hash code
-
toString
public String toString()
- Overrides:
toString
in classAbstractResult
-
builder
static AuthenticationResponse.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-