@ThreadSafe public class AuthenticationResult extends Object implements PrincipalSupportingComponent
| Modifier and Type | Field and Description |
|---|---|
private String |
authenticationFlowId
The identifier of the flow used to produce this result.
|
private long |
authenticationInstant
The time, in milliseconds since the epoch, that the authentication completed.
|
private long |
lastActivityInstant
The last time, in milliseconds since the epoch, this result was used to bypass authentication.
|
private Subject |
subject
The Subject established by the authentication result.
|
| Constructor and Description |
|---|
AuthenticationResult(String flowId,
Principal principal)
Constructor.
|
AuthenticationResult(String flowId,
Subject newSubject)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getAuthenticationFlowId()
Get the flow used to authenticate the principal.
|
long |
getAuthenticationInstant()
Get the time, in milliseconds since the epoch, that the authentication completed.
|
long |
getLastActivityInstant()
Get the last time, in milliseconds since the epoch, this result was used for authentication.
|
Subject |
getSubject()
Get the Subject identifying the authenticated entity.
|
private String |
getSubjectName()
Get a suitable principal name for logging/debugging use.
|
<T extends Principal> |
getSupportedPrincipals(Class<T> c)
Get an immutable set of supported custom principals that the component produces, supports, contains, etc.
|
int |
hashCode() |
void |
setAuthenticationInstant(long instant)
Set the the time, in milliseconds since the epoch, that the authentication completed.
|
void |
setLastActivityInstant(long instant)
Set the last time, in milliseconds since the epoch, result was used for authentication.
|
void |
setLastActivityInstantToNow()
Sets the last activity instant, in milliseconds since the epoch, for this result to the current time.
|
String |
toString() |
@Nonnull private final Subject subject
@Nonnull @NotEmpty private final String authenticationFlowId
@Positive private long authenticationInstant
@Positive private long lastActivityInstant
public AuthenticationResult(@Nonnull@NotEmpty String flowId, @Nonnull Subject newSubject)
Sets the authentication instant to the current time.
flowId - the workflow used to authenticate the subjectnewSubject - a Subject identifying the authenticated entitypublic AuthenticationResult(@Nonnull@NotEmpty String flowId, @Nonnull Principal principal)
Sets the authentication instant to the current time.
flowId - the workflow used to authenticate the subjectprincipal - a Principal identifying the authenticated entity@Nonnull public Subject getSubject()
@Nonnull @NonnullElements @Unmodifiable public <T extends Principal> Set<T> getSupportedPrincipals(@Nonnull Class<T> c)
getSupportedPrincipals in interface PrincipalSupportingComponentT - type of Principal to inquire onc - type of Principal to inquire on@Nonnull @NotEmpty public String getAuthenticationFlowId()
@Positive public long getAuthenticationInstant()
public void setAuthenticationInstant(@Positive
long instant)
instant - time, in milliseconds since the epoch, that the authentication completed, never non-positive@Positive public long getLastActivityInstant()
public void setLastActivityInstant(@Positive
long instant)
instant - last time, in milliseconds since the epoch, result was used to bypass authenticationpublic void setLastActivityInstantToNow()
Copyright © 1999–2015. All rights reserved.