Class DefaultAuthentication

  • All Implemented Interfaces:
    java.io.Serializable, org.apereo.cas.authentication.Authentication

    public class DefaultAuthentication
    extends java.lang.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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultAuthentication​(java.time.ZonedDateTime date, java.util.List<org.apereo.cas.authentication.CredentialMetaData> credentials, org.apereo.cas.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.String,org.apereo.cas.authentication.AuthenticationHandlerExecutionResult> successes, java.util.Map<java.lang.String,java.lang.Throwable> failures)
      Creates a new instance with the given data.
      DefaultAuthentication​(java.time.ZonedDateTime date, org.apereo.cas.authentication.principal.Principal principal, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.String,org.apereo.cas.authentication.AuthenticationHandlerExecutionResult> successes)
      Creates a new instance with the given data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAttribute​(java.lang.String name, java.lang.Object value)  
      void update​(org.apereo.cas.authentication.Authentication authn)  
      void updateAll​(org.apereo.cas.authentication.Authentication authn)  
      • Methods inherited from interface org.apereo.cas.authentication.Authentication

        getAttributes, getAuthenticationDate, getCredentials, getFailures, getPrincipal, getSuccesses
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultAuthentication

        public DefaultAuthentication​(@NonNull
                                     java.time.ZonedDateTime date,
                                     @NonNull
                                     org.apereo.cas.authentication.principal.Principal principal,
                                     @NonNull
                                     java.util.Map<java.lang.String,java.lang.Object> attributes,
                                     @NonNull
                                     java.util.Map<java.lang.String,org.apereo.cas.authentication.AuthenticationHandlerExecutionResult> successes)
        Creates a new instance with the given data.
        Parameters:
        date - Non-null authentication date.
        principal - Non-null authenticated principal.
        attributes - Nullable map of authentication metadata.
        successes - Non-null map of authentication successes containing at least one entry.
      • DefaultAuthentication

        public DefaultAuthentication​(@NonNull
                                     java.time.ZonedDateTime date,
                                     @NonNull
                                     java.util.List<org.apereo.cas.authentication.CredentialMetaData> credentials,
                                     @NonNull
                                     org.apereo.cas.authentication.principal.Principal principal,
                                     @NonNull
                                     java.util.Map<java.lang.String,java.lang.Object> attributes,
                                     @NonNull
                                     java.util.Map<java.lang.String,org.apereo.cas.authentication.AuthenticationHandlerExecutionResult> successes,
                                     @NonNull
                                     java.util.Map<java.lang.String,java.lang.Throwable> failures)
        Creates a new instance with the given data.
        Parameters:
        date - Non-null authentication date.
        credentials - Non-null list of credential metadata containing at least one entry.
        principal - Non-null authenticated principal.
        attributes - Nullable map of authentication metadata.
        successes - Non-null map of authentication successes containing at least one entry.
        failures - Nullable map of authentication failures.
    • Method Detail

      • update

        public void update​(org.apereo.cas.authentication.Authentication authn)
        Specified by:
        update in interface org.apereo.cas.authentication.Authentication
      • updateAll

        public void updateAll​(org.apereo.cas.authentication.Authentication authn)
        Specified by:
        updateAll in interface org.apereo.cas.authentication.Authentication
      • addAttribute

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