public class UserPrincipalImpl extends java.lang.Object implements UserPrincipal
| Modifier and Type | Class and Description |
|---|---|
static class |
UserPrincipalImpl.Builder
Builds and return a UserPrincipalImpl object
|
| Modifier | Constructor and Description |
|---|---|
protected |
UserPrincipalImpl(java.lang.String username,
java.lang.String firstName,
java.lang.String lastName,
java.lang.String email,
java.util.Set<UserRole> roles,
java.lang.String identityToken,
java.lang.String accessToken,
java.lang.String refreshToken)
Builds a new UserPrincipalImpl object
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAccessToken()
Returns the access token for the current logged user.
|
java.lang.Boolean |
getCustomBooleanAttribute(java.lang.String attributeName)
Returns the custom user attribute of type boolean.
|
java.lang.Integer |
getCustomIntegerAttribute(java.lang.String attributeName)
Returns the custom user attribute of type int.
|
java.lang.Long |
getCustomLongAttribute(java.lang.String attributeName)
Returns the custom user attribute of type long.
|
java.lang.String |
getCustomStringAttribute(java.lang.String attributeName)
Returns the custom user attribute of type string.
|
java.lang.String |
getEmail()
Returns the email
|
java.lang.String |
getFirstName()
Returns the first name of the user.
|
java.lang.String |
getIdentityToken()
Returns the identity token.
|
java.lang.String |
getLastName()
Returns the last name of the user.
|
java.lang.String |
getName()
Returns the full name of the user.
|
java.util.Set<UserRole> |
getRealmRoles()
Get's the user realm roles
|
java.lang.String |
getRefreshToken()
Returns the refresh token.
|
java.util.Set<UserRole> |
getResourceRoles()
Get's the user resource roles
|
java.util.Set<UserRole> |
getRoles()
Get's user roles
|
java.lang.String |
getUsername()
Returns the username
|
boolean |
hasRealmRole(java.lang.String role)
Checks if the user has the specified Realm role.
|
boolean |
hasResourceRole(java.lang.String role,
java.lang.String resourceId)
Checks if the user has the specified Resource role.
|
static UserPrincipalImpl.Builder |
newUser() |
java.lang.String |
toString() |
protected UserPrincipalImpl(java.lang.String username,
java.lang.String firstName,
java.lang.String lastName,
java.lang.String email,
java.util.Set<UserRole> roles,
java.lang.String identityToken,
java.lang.String accessToken,
java.lang.String refreshToken)
username - the username of the authenticated userfirstName - the first name of the authenticated userlastName - the last name of the authenticated useremail - the email of the authenticated userroles - roles assigned to the useridentityToken - the identity tokenaccessToken - the access tokenrefreshToken - the refresh tokenpublic boolean hasResourceRole(java.lang.String role,
java.lang.String resourceId)
hasResourceRole in interface UserPrincipalrole - role to be checkedresourceId - resourceId related to roletrue or falsepublic boolean hasRealmRole(java.lang.String role)
hasRealmRole in interface UserPrincipalrole - role to be checkedtrue or falsepublic java.lang.String getUsername()
UserPrincipalgetUsername in interface UserPrincipalpublic java.lang.String getFirstName()
UserPrincipalgetFirstName in interface UserPrincipalpublic java.lang.String getLastName()
UserPrincipalgetLastName in interface UserPrincipalpublic java.lang.String getName()
UserPrincipalgetName in interface UserPrincipalpublic java.util.Set<UserRole> getRoles()
getRoles in interface UserPrincipalpublic java.util.Set<UserRole> getRealmRoles()
getRealmRoles in interface UserPrincipalpublic java.util.Set<UserRole> getResourceRoles()
getResourceRoles in interface UserPrincipalpublic java.lang.String getEmail()
UserPrincipalgetEmail in interface UserPrincipalpublic static UserPrincipalImpl.Builder newUser()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getIdentityToken()
getIdentityToken in interface UserPrincipalpublic java.lang.String getAccessToken()
getAccessToken in interface UserPrincipalpublic java.lang.String getRefreshToken()
getRefreshToken in interface UserPrincipalpublic java.lang.String getCustomStringAttribute(java.lang.String attributeName)
getCustomStringAttribute in interface UserPrincipalattributeName - the user attribute to retrievepublic java.lang.Boolean getCustomBooleanAttribute(java.lang.String attributeName)
getCustomBooleanAttribute in interface UserPrincipalattributeName - the user attribute to retrievepublic java.lang.Long getCustomLongAttribute(java.lang.String attributeName)
getCustomLongAttribute in interface UserPrincipalattributeName - the user attribute to retrievepublic java.lang.Integer getCustomIntegerAttribute(java.lang.String attributeName)
getCustomIntegerAttribute in interface UserPrincipalattributeName - the user attribute to retrieve