public class DefaultAuthenticationBuilder
extends java.lang.Object
implements org.apereo.cas.authentication.AuthenticationBuilder
Authentication objects using the builder pattern.| Constructor and Description |
|---|
DefaultAuthenticationBuilder()
Creates a new instance using the current date for the authentication date.
|
DefaultAuthenticationBuilder(org.apereo.cas.authentication.principal.Principal p)
Creates a new instance using the current date for the authentication date and the given
principal for the authenticated principal.
|
| Modifier and Type | Method and Description |
|---|---|
org.apereo.cas.authentication.AuthenticationBuilder |
addAttribute(java.lang.String key,
java.lang.Object value)
Adds an authentication metadata attribute key-value pair.
|
org.apereo.cas.authentication.AuthenticationBuilder |
addCredential(org.apereo.cas.authentication.CredentialMetaData credential)
Adds metadata about a credential presented for authentication.
|
org.apereo.cas.authentication.AuthenticationBuilder |
addCredentials(java.util.List<org.apereo.cas.authentication.CredentialMetaData> credentials) |
org.apereo.cas.authentication.AuthenticationBuilder |
addFailure(java.lang.String key,
java.lang.Class<? extends java.lang.Throwable> value)
Adds an authentication failure to the map of handler names to the authentication handler failures.
|
org.apereo.cas.authentication.AuthenticationBuilder |
addFailures(java.util.Map<java.lang.String,java.lang.Class<? extends java.lang.Throwable>> failures) |
org.apereo.cas.authentication.AuthenticationBuilder |
addSuccess(java.lang.String key,
org.apereo.cas.authentication.HandlerResult value)
Adds an authentication success to the map of handler names to successful authentication handler results.
|
org.apereo.cas.authentication.AuthenticationBuilder |
addSuccesses(java.util.Map<java.lang.String,org.apereo.cas.authentication.HandlerResult> successes) |
org.apereo.cas.authentication.Authentication |
build()
Creates an immutable authentication instance from builder data.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Gets the authentication attribute map.
|
java.time.ZonedDateTime |
getAuthenticationDate()
Gets the authentication date.
|
java.util.List<org.apereo.cas.authentication.CredentialMetaData> |
getCredentials()
Gets the list of credentials that were attempted to be authenticated.
|
java.util.Map<java.lang.String,java.lang.Class<? extends java.lang.Throwable>> |
getFailures()
Gets the authentication failure map.
|
org.apereo.cas.authentication.principal.Principal |
getPrincipal()
Gets the authenticated principal.
|
java.util.Map<java.lang.String,org.apereo.cas.authentication.HandlerResult> |
getSuccesses()
Gets the authentication success map.
|
boolean |
hasAttribute(java.lang.String name,
java.util.function.Predicate<java.lang.Object> predicate) |
org.apereo.cas.authentication.AuthenticationBuilder |
mergeAttribute(java.lang.String key,
java.lang.Object value) |
static org.apereo.cas.authentication.AuthenticationBuilder |
newInstance()
Creates a new builder.
|
static org.apereo.cas.authentication.AuthenticationBuilder |
newInstance(org.apereo.cas.authentication.Authentication source)
Creates a new builder initialized with data from the given authentication source.
|
org.apereo.cas.authentication.AuthenticationBuilder |
setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Sets the authentication metadata attributes.
|
org.apereo.cas.authentication.AuthenticationBuilder |
setAuthenticationDate(java.time.ZonedDateTime d)
Sets the authentication date and returns this instance.
|
org.apereo.cas.authentication.AuthenticationBuilder |
setCredentials(java.util.List<org.apereo.cas.authentication.CredentialMetaData> credentials)
Sets the list of metadata about credentials presented for authentication.
|
org.apereo.cas.authentication.AuthenticationBuilder |
setFailures(java.util.Map<java.lang.String,java.lang.Class<? extends java.lang.Throwable>> failures)
Sets the authentication handler failure map.
|
org.apereo.cas.authentication.AuthenticationBuilder |
setPrincipal(org.apereo.cas.authentication.principal.Principal p)
Sets the principal returns this instance.
|
org.apereo.cas.authentication.AuthenticationBuilder |
setSuccesses(java.util.Map<java.lang.String,org.apereo.cas.authentication.HandlerResult> successes)
Sets the authentication handler success map.
|
public DefaultAuthenticationBuilder()
public DefaultAuthenticationBuilder(org.apereo.cas.authentication.principal.Principal p)
p - Authenticated principal.public java.time.ZonedDateTime getAuthenticationDate()
public org.apereo.cas.authentication.AuthenticationBuilder setAuthenticationDate(java.time.ZonedDateTime d)
setAuthenticationDate in interface org.apereo.cas.authentication.AuthenticationBuilderd - Authentication date.public org.apereo.cas.authentication.principal.Principal getPrincipal()
getPrincipal in interface org.apereo.cas.authentication.AuthenticationBuilderpublic org.apereo.cas.authentication.AuthenticationBuilder addCredentials(java.util.List<org.apereo.cas.authentication.CredentialMetaData> credentials)
addCredentials in interface org.apereo.cas.authentication.AuthenticationBuilderpublic org.apereo.cas.authentication.AuthenticationBuilder setPrincipal(org.apereo.cas.authentication.principal.Principal p)
setPrincipal in interface org.apereo.cas.authentication.AuthenticationBuilderp - Authenticated principal.public java.util.List<org.apereo.cas.authentication.CredentialMetaData> getCredentials()
public org.apereo.cas.authentication.AuthenticationBuilder setCredentials(java.util.List<org.apereo.cas.authentication.CredentialMetaData> credentials)
credentials - Non-null list of credential metadata.public org.apereo.cas.authentication.AuthenticationBuilder addCredential(org.apereo.cas.authentication.CredentialMetaData credential)
addCredential in interface org.apereo.cas.authentication.AuthenticationBuildercredential - Credential metadata.public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
public org.apereo.cas.authentication.AuthenticationBuilder setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
setAttributes in interface org.apereo.cas.authentication.AuthenticationBuilderattributes - Non-null map of authentication metadata attributes.public org.apereo.cas.authentication.AuthenticationBuilder mergeAttribute(java.lang.String key,
java.lang.Object value)
mergeAttribute in interface org.apereo.cas.authentication.AuthenticationBuilderpublic boolean hasAttribute(java.lang.String name,
java.util.function.Predicate<java.lang.Object> predicate)
hasAttribute in interface org.apereo.cas.authentication.AuthenticationBuilderpublic org.apereo.cas.authentication.AuthenticationBuilder addAttribute(java.lang.String key,
java.lang.Object value)
addAttribute in interface org.apereo.cas.authentication.AuthenticationBuilderkey - Authentication attribute key.value - Authentication attribute value.public java.util.Map<java.lang.String,org.apereo.cas.authentication.HandlerResult> getSuccesses()
getSuccesses in interface org.apereo.cas.authentication.AuthenticationBuilderpublic org.apereo.cas.authentication.AuthenticationBuilder setSuccesses(java.util.Map<java.lang.String,org.apereo.cas.authentication.HandlerResult> successes)
setSuccesses in interface org.apereo.cas.authentication.AuthenticationBuildersuccesses - Non-null map of handler names to successful handler authentication results.public org.apereo.cas.authentication.AuthenticationBuilder addSuccesses(java.util.Map<java.lang.String,org.apereo.cas.authentication.HandlerResult> successes)
addSuccesses in interface org.apereo.cas.authentication.AuthenticationBuilderpublic org.apereo.cas.authentication.AuthenticationBuilder addSuccess(java.lang.String key,
org.apereo.cas.authentication.HandlerResult value)
addSuccess in interface org.apereo.cas.authentication.AuthenticationBuilderkey - Authentication handler name.value - Successful authentication handler result produced by handler of given name.public java.util.Map<java.lang.String,java.lang.Class<? extends java.lang.Throwable>> getFailures()
getFailures in interface org.apereo.cas.authentication.AuthenticationBuilderpublic org.apereo.cas.authentication.AuthenticationBuilder setFailures(java.util.Map<java.lang.String,java.lang.Class<? extends java.lang.Throwable>> failures)
setFailures in interface org.apereo.cas.authentication.AuthenticationBuilderfailures - Non-null map of handler name to authentication failures.public org.apereo.cas.authentication.AuthenticationBuilder addFailures(java.util.Map<java.lang.String,java.lang.Class<? extends java.lang.Throwable>> failures)
addFailures in interface org.apereo.cas.authentication.AuthenticationBuilderpublic org.apereo.cas.authentication.AuthenticationBuilder addFailure(java.lang.String key,
java.lang.Class<? extends java.lang.Throwable> value)
addFailure in interface org.apereo.cas.authentication.AuthenticationBuilderkey - Authentication handler name.value - Exception raised on handler failure to authenticate credential.public org.apereo.cas.authentication.Authentication build()
build in interface org.apereo.cas.authentication.AuthenticationBuilderpublic static org.apereo.cas.authentication.AuthenticationBuilder newInstance(org.apereo.cas.authentication.Authentication source)
source - Authentication source.public static org.apereo.cas.authentication.AuthenticationBuilder newInstance()