public interface CurrentUser
| Modifier and Type | Field and Description |
|---|---|
static org.joda.time.format.DateTimeFormatter |
DEFAULT_DATE_FORMAT |
| Modifier and Type | Method and Description |
|---|---|
default String |
format(Date date)
Return a string version of the provided timestamp in the user's preferred timezone and time format
|
default String |
format(org.joda.time.DateTime date)
Return a string version of the provided timestamp in the user's preferred timezone and time format
|
default String |
format(Instant date)
Return a string version of the provided timestamp in the user's preferred timezone and time format
|
AccessRefuser |
getAccessRefuser() |
String |
getAuthType()
Return the type of authentication used
|
Map<String,Object> |
getClaims()
Get all the (verified) claims for this user.
|
org.joda.time.DateTime |
getExpires()
Get the instant when the login must expire (or null if it will never expire or has not come through an authentication
system that uses expiration)
|
String |
getName()
Get the name of the current user
|
default String |
getSimpleClaim(String name)
Get a simple text/numeric claim as a String.
|
default List<String> |
getSimpleListClaim(String name)
Get a
List of simple text/numeric claims. |
default Set<String> |
getSimpleSetClaim(String name)
Get a
Set of simple text/numeric claims. |
String |
getUsername()
Get the username of the current user
|
boolean |
hasRole(String role)
Return whether the user has the named role
|
boolean |
isAnonymous()
Return true if the user is not authenticated
|
static final org.joda.time.format.DateTimeFormatter DEFAULT_DATE_FORMAT
String getAuthType()
boolean isAnonymous()
String getName()
String getUsername()
boolean hasRole(String role)
role - the role name to testorg.joda.time.DateTime getExpires()
Map<String,Object> getClaims()
default String getSimpleClaim(String name)
name - default List<String> getSimpleListClaim(String name)
List of simple text/numeric claims. Returns null if no such claim was made.name - default Set<String> getSimpleSetClaim(String name)
Set of simple text/numeric claims. Returns null if no such claim was made.name - default String format(org.joda.time.DateTime date)
date - default String format(Instant date)
date - default String format(Date date)
date - AccessRefuser getAccessRefuser()
Copyright © 2016. All rights reserved.