Class DefaultAuthentication

java.lang.Object
org.apereo.cas.authentication.DefaultAuthentication
All Implemented Interfaces:
Serializable, org.apereo.cas.authentication.Authentication

public class DefaultAuthentication extends Object implements org.apereo.cas.authentication.Authentication
Immutable authentication event whose attributes may not change after creation. This class is designed for serialization and is suitable for long-term storage.
Since:
3.0.0
See Also:
  • Constructor Details

    • DefaultAuthentication

      public DefaultAuthentication()
    • DefaultAuthentication

      public DefaultAuthentication(ZonedDateTime authenticationDate, org.apereo.cas.authentication.principal.Principal principal, List<org.apereo.cas.authentication.MessageDescriptor> warnings, List<org.apereo.cas.authentication.Credential> credentials, Map<String,List<Object>> attributes, Map<String,org.apereo.cas.authentication.AuthenticationHandlerExecutionResult> successes, Map<String,Throwable> failures)
      Creates a new DefaultAuthentication instance.
      Parameters:
      authenticationDate - Authentication date stamp.
      principal - Authenticated principal.
      warnings - Authentication messages and warnings.
      credentials - List of metadata about credentials presented at authentication.
      attributes - Authentication metadata attributes.
      successes - Map of handler name to handler authentication success event.
      failures - Map of handler name to handler authentication failure cause.
  • Method Details

    • addAttribute

      public void addAttribute(String name, Object value)
      Specified by:
      addAttribute in interface org.apereo.cas.authentication.Authentication
    • containsAttribute

      public boolean containsAttribute(String name)
      Specified by:
      containsAttribute in interface org.apereo.cas.authentication.Authentication
    • updateAttributes

      public void updateAttributes(org.apereo.cas.authentication.Authentication authentication)
      Specified by:
      updateAttributes in interface org.apereo.cas.authentication.Authentication
    • replaceAttributes

      public void replaceAttributes(org.apereo.cas.authentication.Authentication authentication)
      Specified by:
      replaceAttributes in interface org.apereo.cas.authentication.Authentication
    • isEqualTo

      public boolean isEqualTo(org.apereo.cas.authentication.Authentication authn)
      Specified by:
      isEqualTo in interface org.apereo.cas.authentication.Authentication
    • getSingleValuedAttribute

      public <T> T getSingleValuedAttribute(String name, Class<T> expectedType)
      Specified by:
      getSingleValuedAttribute in interface org.apereo.cas.authentication.Authentication
    • getAuthenticationDate

      public ZonedDateTime getAuthenticationDate()
      Authentication date stamp.
      Specified by:
      getAuthenticationDate in interface org.apereo.cas.authentication.Authentication
    • getPrincipal

      public org.apereo.cas.authentication.principal.Principal getPrincipal()
      Authenticated principal.
      Specified by:
      getPrincipal in interface org.apereo.cas.authentication.Authentication
    • getWarnings

      public List<org.apereo.cas.authentication.MessageDescriptor> getWarnings()
      Authentication messages and warnings.
      Specified by:
      getWarnings in interface org.apereo.cas.authentication.Authentication
    • getCredentials

      public List<org.apereo.cas.authentication.Credential> getCredentials()
      List of metadata about credentials presented at authentication.
      Specified by:
      getCredentials in interface org.apereo.cas.authentication.Authentication
    • getAttributes

      public Map<String,List<Object>> getAttributes()
      Authentication metadata attributes.
      Specified by:
      getAttributes in interface org.apereo.cas.authentication.Authentication
    • getSuccesses

      public Map<String,org.apereo.cas.authentication.AuthenticationHandlerExecutionResult> getSuccesses()
      Map of handler name to handler authentication success event.
      Specified by:
      getSuccesses in interface org.apereo.cas.authentication.Authentication
    • getFailures

      public Map<String,Throwable> getFailures()
      Map of handler name to handler authentication failure cause.
      Specified by:
      getFailures in interface org.apereo.cas.authentication.Authentication
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object