public class AuthenticationBuilder extends Object
Authentication objects using the builder pattern.| Constructor and Description |
|---|
AuthenticationBuilder()
Creates a new instance using the current date for the authentication date.
|
AuthenticationBuilder(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 |
|---|---|
AuthenticationBuilder |
addAttribute(String key,
Object value)
Adds an authentication metadata attribute key-value pair.
|
AuthenticationBuilder |
addCredential(CredentialMetaData credential)
Adds metadata about a credential presented for authentication.
|
AuthenticationBuilder |
addFailure(String key,
Class<? extends Exception> value)
Adds an authentication failure to the map of handler names to the authentication handler failures.
|
AuthenticationBuilder |
addSuccess(String key,
HandlerResult value)
Adds an authentication success to the map of handler names to successful authentication handler results.
|
Authentication |
build()
Creates an immutable authentication instance from builder data.
|
Map<String,Object> |
getAttributes()
Gets the authentication attribute map.
|
Date |
getAuthenticationDate()
Gets the authentication date.
|
List<CredentialMetaData> |
getCredentials()
Gets the list of credentials that were attempted to be authenticated.
|
Map<String,Class<? extends Exception>> |
getFailures()
Gets the authentication failure map.
|
Principal |
getPrincipal()
Gets the authenticated principal.
|
Map<String,HandlerResult> |
getSuccesses()
Gets the authentication success map.
|
static AuthenticationBuilder |
newInstance(Authentication source)
Creates a new builder initialized with data from the given authentication source.
|
AuthenticationBuilder |
setAttributes(Map<String,Object> attributes)
Sets the authentication metadata attributes.
|
AuthenticationBuilder |
setAuthenticationDate(Date d)
Sets the authentication date and returns this instance.
|
AuthenticationBuilder |
setCredentials(List<CredentialMetaData> credentials)
Sets the list of metadata about credentials presented for authentication.
|
AuthenticationBuilder |
setFailures(Map<String,Class<? extends Exception>> failures)
Sets the authentication handler failure map.
|
AuthenticationBuilder |
setPrincipal(Principal p)
Sets the principal returns this instance.
|
AuthenticationBuilder |
setSuccesses(Map<String,HandlerResult> successes)
Sets the authentication handler success map.
|
public AuthenticationBuilder()
public AuthenticationBuilder(Principal p)
p - Authenticated principal.public Date getAuthenticationDate()
public AuthenticationBuilder setAuthenticationDate(Date d)
d - Authentication date.public Principal getPrincipal()
public AuthenticationBuilder setPrincipal(Principal p)
p - Authenticated principal.public List<CredentialMetaData> getCredentials()
public AuthenticationBuilder setCredentials(List<CredentialMetaData> credentials)
credentials - Non-null list of credential metadata.public AuthenticationBuilder addCredential(CredentialMetaData credential)
credential - Credential metadata.public Map<String,Object> getAttributes()
public AuthenticationBuilder setAttributes(Map<String,Object> attributes)
attributes - Non-null map of authentication metadata attributes.public AuthenticationBuilder addAttribute(String key, Object value)
key - Authentication attribute key.value - Authentication attribute value.public Map<String,HandlerResult> getSuccesses()
public AuthenticationBuilder setSuccesses(Map<String,HandlerResult> successes)
successes - Non-null map of handler names to successful handler authentication results.public AuthenticationBuilder addSuccess(String key, HandlerResult value)
key - Authentication handler name.value - Successful authentication handler result produced by handler of given name.public Map<String,Class<? extends Exception>> getFailures()
public AuthenticationBuilder setFailures(Map<String,Class<? extends Exception>> failures)
failures - Non-null map of handler name to authentication failures.public AuthenticationBuilder addFailure(String key, Class<? extends Exception> value)
key - Authentication handler name.value - Exception raised on handler failure to authenticate credential.public Authentication build()
public static AuthenticationBuilder newInstance(Authentication source)
source - Authentication source.Copyright © 2004-2014 Jasig. All Rights Reserved.