Class AuthenticationResponse

All Implemented Interfaces:
Freezable, Message, Result

public final class AuthenticationResponse extends AbstractResult implements Freezable
Synthetic response object that encapsulates data used for authentication.
  • Field Details

    • HASH_CODE_SEED

      private static final int HASH_CODE_SEED
      hash code seed.
      See Also:
    • 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 Details

    • AuthenticationResponse

      private AuthenticationResponse()
      Default constructor.
    • AuthenticationResponse

      public AuthenticationResponse(AuthenticationHandlerResponse response, String dn, LdapEntry entry)
      Creates a new authentication response.
      Parameters:
      response - authentication handler response
      dn - produced by the DN resolver
      entry - of the authenticated user
  • Method Details

    • freeze

      public void freeze()
      Description copied from interface: Freezable
      Freezes this object, making it immutable.
      Specified by:
      freeze in interface Freezable
    • isFrozen

      public boolean isFrozen()
      Description copied from interface: Freezable
      Determines whether this object is frozen, i.e. immutable.
      Specified by:
      isFrozen in interface Freezable
      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 interface Freezable
    • isSuccess

      public boolean isSuccess()
      Returns whether the authentication handler produced a AuthenticationResultCode.AUTHENTICATION_HANDLER_SUCCESS result.
      Specified by:
      isSuccess in interface Result
      Returns:
      whether authentication was successful
    • getAuthenticationResultCode

      public AuthenticationResultCode getAuthenticationResultCode()
      Return authentication result code.
      Returns:
      authentication result code
    • getAuthenticationHandlerResponse

      public AuthenticationHandlerResponse getAuthenticationHandlerResponse()
      Return authentication handler response.
      Returns:
      authentication handler response
    • 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 class AbstractResult
    • hashCode

      public int hashCode()
      Description copied from class: AbstractMessage
      Returns the hash code for this object.
      Specified by:
      hashCode in class AbstractMessage
      Returns:
      hash code
    • toString

      public String toString()
      Overrides:
      toString in class AbstractResult
    • builder

      Creates a builder for this class.
      Returns:
      new builder