public class User extends Object implements Serializable
roles
and permissions
.
This domain is synchronized from other services such as the admin user service
(AdminUserPersistenceHandler
) and the customer service
(CustomerPersistenceHandler
).
Constructor and Description |
---|
User() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
Set<String> |
getApplicationIds()
This field only applies to
UserType.ADMIN users. |
<T> T |
getAttribute(String key) |
Map<String,Object> |
getAttributes()
Arbitrary attributes associated with this user.
|
String |
getCompleteName()
Get the complete name of the user.
|
String |
getCustomerContextId()
This field only applies to
UserType.CUSTOMER users. |
String |
getEmail()
The user's email address.
|
String |
getExternalId()
Intended to hold any unique identifier for this user as known by an external (non-BLC)
system.
|
String |
getFirstName()
The first name of the user, if the fullName is not being used for the user.
|
String |
getFullName()
The full name of the user, if the component parts firstName, middleName, and lastName are not
being used to comprise the full name.
|
String |
getId() |
String |
getLastName()
The last name of the user, if the fullName is not being used for the user.
|
Instant |
getLastUpdated()
Indicates when this record was last updated.
|
Instant |
getLockedTime()
If this user is locked out, the time that the user was locked.
|
String |
getMiddleName()
The middle name of the user, if the fullName is not being used for the user.
|
String |
getPassword()
Encrypted password that should generally only be used in mapping exercises before saving into
the data store
|
Set<UserPermissionRef> |
getPermissions()
The permissions that this user is directly assigned (in addition to permissions granted
through
roles ). |
Set<RestrictedPermission> |
getRestrictedPermissions()
The permissions that this user is directly assigned that are restricted to only apply when
accessing certain segments of data.
|
Set<RestrictedRole> |
getRestrictedRoles()
The roles that this user is directly assigned that are restricted to only apply when
accessing certain segments of data.
|
Set<Restriction> |
getRestrictions()
The data restrictions that control the data this user is permitted to access.
|
Set<UserRoleRef> |
getRoles()
The roles that this user is assigned.
|
String |
getServerId()
The ID of the authorization server that this user is a member of.
|
String |
getServiceId()
If this user was synchronized from a BLC service (ex: the admin user service or the customer
service), this field will be the ID value used by that service for this user.
|
String |
getTenantId()
The id of the tenant this user is associated with.
|
String |
getType()
Represents the type of user this is.
|
String |
getUsername()
What this user uses to actually log in.
|
boolean |
hasAttribute(String key) |
int |
hashCode() |
boolean |
isActive()
A flag indicating whether the user account is enabled.
|
boolean |
isApplicationAccess()
Indicates whether this user has access at the application level or not.
|
boolean |
isArchived()
This entity is soft-deleted instead of hard-deleted, and this field is set to
true
when the entity is soft-deleted. |
boolean |
isChangePasswordRequired()
A flag indicating whether the admin user account requires a password reset.
|
boolean |
isExpired()
A flag indicating whether the admin user account is expired.
|
boolean |
isImpersonationAllowed()
A flag indicated whether or not this user is allowed to be impersonated.
|
boolean |
isLocked()
A flag indicating whether the admin user account is locked.
|
boolean |
isTenantAccess()
Indicates whether this user has access at the tenant level or not.
|
void |
setActive(boolean active)
A flag indicating whether the user account is enabled.
|
void |
setApplicationAccess(boolean applicationAccess)
Indicates whether this user has access at the application level or not.
|
void |
setApplicationIds(Set<String> applicationIds)
This field only applies to
UserType.ADMIN users. |
void |
setArchived(boolean archived)
This entity is soft-deleted instead of hard-deleted, and this field is set to
true
when the entity is soft-deleted. |
void |
setAttributes(Map<String,Object> attributes)
Arbitrary attributes associated with this user.
|
void |
setChangePasswordRequired(boolean changePasswordRequired)
A flag indicating whether the admin user account requires a password reset.
|
void |
setCustomerContextId(String customerContextId)
This field only applies to
UserType.CUSTOMER users. |
void |
setEmail(String email)
The user's email address.
|
void |
setExpired(boolean expired)
A flag indicating whether the admin user account is expired.
|
void |
setExternalId(String externalId)
Intended to hold any unique identifier for this user as known by an external (non-BLC)
system.
|
void |
setFirstName(String firstName)
The first name of the user, if the fullName is not being used for the user.
|
void |
setFullName(String fullName)
The full name of the user, if the component parts firstName, middleName, and lastName are not
being used to comprise the full name.
|
void |
setId(String id) |
void |
setImpersonationAllowed(boolean impersonationAllowed)
A flag indicated whether or not this user is allowed to be impersonated.
|
void |
setLastName(String lastName)
The last name of the user, if the fullName is not being used for the user.
|
void |
setLastUpdated(Instant lastUpdated)
Indicates when this record was last updated.
|
void |
setLocked(boolean locked)
A flag indicating whether the admin user account is locked.
|
void |
setLockedTime(Instant lockedTime)
If this user is locked out, the time that the user was locked.
|
void |
setMiddleName(String middleName)
The middle name of the user, if the fullName is not being used for the user.
|
void |
setPassword(String password)
Encrypted password that should generally only be used in mapping exercises before saving into
the data store
|
void |
setPermissions(Set<UserPermissionRef> permissions)
The permissions that this user is directly assigned (in addition to permissions granted
through
roles ). |
void |
setRestrictedPermissions(Set<RestrictedPermission> restrictedPermissions)
The permissions that this user is directly assigned that are restricted to only apply when
accessing certain segments of data.
|
void |
setRestrictedRoles(Set<RestrictedRole> restrictedRoles)
The roles that this user is directly assigned that are restricted to only apply when
accessing certain segments of data.
|
void |
setRestrictions(Set<Restriction> restrictions)
The data restrictions that control the data this user is permitted to access.
|
void |
setRoles(Set<UserRoleRef> roles)
The roles that this user is assigned.
|
void |
setServerId(String serverId)
The ID of the authorization server that this user is a member of.
|
void |
setServiceId(String serviceId)
If this user was synchronized from a BLC service (ex: the admin user service or the customer
service), this field will be the ID value used by that service for this user.
|
void |
setTenantAccess(boolean tenantAccess)
Indicates whether this user has access at the tenant level or not.
|
void |
setTenantId(String tenantId)
The id of the tenant this user is associated with.
|
void |
setType(String type)
Represents the type of user this is.
|
void |
setUsername(String username)
What this user uses to actually log in.
|
String |
toString() |
public String getCompleteName()
fullName
takes priority. Whether a single name or
multiple name fields are used is a client implementation detail.public <T> T getAttribute(String key)
public boolean hasAttribute(String key)
public String getId()
public String getFirstName()
public String getMiddleName()
public String getLastName()
public String getFullName()
public String getUsername()
email
, but that is not
required.
The username is case insensitive, so it will always be stored lowercase.
public String getEmail()
@Nullable public String getServiceId()
If this value is set, there should also be a value set for type
.
There is a requirement that only if both values are non-null, a combination
of this field and type
will be unique across all records. There is no uniqueness
guarantee for records which have a null service ID or null type
.
type
@Nullable public String getType()
serviceId
is
set.@Nullable public String getExternalId()
@Nullable public String getTenantId()
public Set<String> getApplicationIds()
UserType.ADMIN
users.
The ids of applications this user is a member of. If this is non-empty, this user is restricted to these applications.
public boolean isTenantAccess()
This field only applies to UserType.ADMIN
users.
public boolean isApplicationAccess()
This field only applies to UserType.ADMIN
users. UserType.CUSTOMER
will always have application level access regardless of this value.
@Nullable public String getCustomerContextId()
UserType.CUSTOMER
users.
The id of the customer context this user is a member of. If this is set, this user is restricted to this customer context.
public Map<String,Object> getAttributes()
public String getPassword()
public boolean isActive()
This flag should be used if a user needs to be enabled/disabled for administrative reasons.
public boolean isLocked()
LockedException
will be
thrown on a login attempt.
This flag is used to limit invalid login attempt.
public boolean isExpired()
This flag can be used to declare an account as expired and unusable, but currently there is
no logic for that. It will always be false
.
public boolean isChangePasswordRequired()
public boolean isImpersonationAllowed()
public String getServerId()
public Instant getLastUpdated()
public boolean isArchived()
true
when the entity is soft-deleted.public Set<UserRoleRef> getRoles()
public Set<UserPermissionRef> getPermissions()
roles
).public Set<Restriction> getRestrictions()
public Set<RestrictedRole> getRestrictedRoles()
public Set<RestrictedPermission> getRestrictedPermissions()
public Instant getLockedTime()
public void setId(String id)
public void setFirstName(String firstName)
firstName
- the first name of the userpublic void setMiddleName(String middleName)
middleName
- the middle name of the userpublic void setLastName(String lastName)
lastName
- the last name of the userpublic void setFullName(String fullName)
fullName
- the full name of the userpublic void setUsername(String username)
email
, but that is not
required.
The username is case insensitive, so it will always be stored lowercase.
public void setEmail(String email)
public void setServiceId(@Nullable String serviceId)
If this value is set, there should also be a value set for type
.
There is a requirement that only if both values are non-null, a combination
of this field and type
will be unique across all records. There is no uniqueness
guarantee for records which have a null service ID or null type
.
type
public void setType(@Nullable String type)
serviceId
is
set.public void setExternalId(@Nullable String externalId)
externalId
- a unique identifier for this user in a non-BLC systempublic void setTenantId(@Nullable String tenantId)
public void setApplicationIds(Set<String> applicationIds)
UserType.ADMIN
users.
The ids of applications this user is a member of. If this is non-empty, this user is restricted to these applications.
public void setTenantAccess(boolean tenantAccess)
This field only applies to UserType.ADMIN
users.
tenantAccess
- Does this user have tenant level access?public void setApplicationAccess(boolean applicationAccess)
This field only applies to UserType.ADMIN
users. UserType.CUSTOMER
will always have application level access regardless of this value.
applicationAccess
- Does this user have application level access?public void setCustomerContextId(@Nullable String customerContextId)
UserType.CUSTOMER
users.
The id of the customer context this user is a member of. If this is set, this user is restricted to this customer context.
public void setAttributes(Map<String,Object> attributes)
public void setPassword(String password)
public void setActive(boolean active)
This flag should be used if a user needs to be enabled/disabled for administrative reasons.
active
- true if the user account is enabled, false otherwisepublic void setLocked(boolean locked)
LockedException
will be
thrown on a login attempt.
This flag is used to limit invalid login attempt.
locked
- true if the admin user account is locked, false otherwisepublic void setExpired(boolean expired)
This flag can be used to declare an account as expired and unusable, but currently there is
no logic for that. It will always be false
.
expired
- true if the admin user account is expired, false otherwisepublic void setChangePasswordRequired(boolean changePasswordRequired)
changePasswordRequired
- true if the admin user's password is expired and requires a
reset, false otherwisepublic void setImpersonationAllowed(boolean impersonationAllowed)
impersonationAllowed
- true if impersonation is allowedpublic void setServerId(String serverId)
serverId
- The authorization server IDpublic void setLastUpdated(Instant lastUpdated)
public void setArchived(boolean archived)
true
when the entity is soft-deleted.public void setRoles(Set<UserRoleRef> roles)
public void setPermissions(Set<UserPermissionRef> permissions)
roles
).public void setRestrictions(Set<Restriction> restrictions)
public void setRestrictedRoles(Set<RestrictedRole> restrictedRoles)
public void setRestrictedPermissions(Set<RestrictedPermission> restrictedPermissions)
public void setLockedTime(Instant lockedTime)
protected boolean canEqual(Object other)
Copyright © 2021. All rights reserved.