Class User
- java.lang.Object
-
- com.broadleafcommerce.customer.messaging.domain.User
-
- All Implemented Interfaces:
Serializable
public class User extends Object implements Serializable
The domain object of a User. This User is defined in Authentication- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description User()
User(String id, String firstName, String middleName, String lastName, String fullName, String username, String email, String phone, String serviceId, String type, String externalId, String tenantId, String customerContextId, Map<String,Object> attributes, boolean locked, List<AccountRole> accountRoles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
List<AccountRole>
getAccountRoles()
Roles this user has under specific Account contexts.<T> T
getAttribute(String key)
Map<String,Object>
getAttributes()
Additional attributes of a user.String
getCustomerContextId()
This field only applies toUserType.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.String
getId()
String
getLastName()
The last name of the user, if the fullName is not being used for the user.String
getMiddleName()
The middle name of the user, if the fullName is not being used for the user.String
getPhone()
The user's phone numberString
getServiceId()
If the auth service received this user 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
isLocked()
Indicates the user has been locked due to too many failed login attempts.void
setAccountRoles(List<AccountRole> accountRoles)
Roles this user has under specific Account contexts.void
setAttributes(Map<String,Object> attributes)
Additional attributes of a user.void
setCustomerContextId(String customerContextId)
This field only applies toUserType.CUSTOMER
users.void
setEmail(String email)
The user's email address.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.void
setId(String id)
void
setLastName(String lastName)
The last name of the user, if the fullName is not being used for the user.void
setLocked(boolean locked)
Indicates the user has been locked due to too many failed login attempts.void
setMiddleName(String middleName)
The middle name of the user, if the fullName is not being used for the user.void
setPhone(String phone)
The user's phone numbervoid
setServiceId(String serviceId)
If the auth service received this user 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
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()
-
-
-
Constructor Detail
-
User
public User()
-
User
public User(String id, String firstName, String middleName, String lastName, String fullName, String username, String email, String phone, @Nullable String serviceId, @Nullable String type, @Nullable String externalId, @Nullable String tenantId, @Nullable String customerContextId, Map<String,Object> attributes, boolean locked, List<AccountRole> accountRoles)
-
-
Method Detail
-
getAttribute
public <T> T getAttribute(String key)
-
hasAttribute
public boolean hasAttribute(String key)
-
getId
public String getId()
-
getFirstName
public String getFirstName()
The first name of the user, if the fullName is not being used for the user.- Returns:
- The first name of the user.
- See Also:
Customer.getName()
-
getMiddleName
public String getMiddleName()
The middle name of the user, if the fullName is not being used for the user.- Returns:
- The middle name of the user.
- See Also:
Customer.getName()
-
getLastName
public String getLastName()
The last name of the user, if the fullName is not being used for the user.- Returns:
- The last name of the user.
- See Also:
Customer.getName()
-
getFullName
public String getFullName()
The full name of the user.- See Also:
Customer.getName()
-
getUsername
public String getUsername()
What this user uses to actually log in. Often the same asemail
.
-
getEmail
public String getEmail()
The user's email address.
-
getPhone
public String getPhone()
The user's phone number
-
getServiceId
@Nullable public String getServiceId()
If the auth service received this user 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.If this value is set, there should also be a value set for
type
.Only if both values are non-null, a combination of this field and
type
will be unique across all records in the authentication service. There is no uniqueness guarantee for records which have a null service ID or nulltype
.- See Also:
type
-
getType
@Nullable public String getType()
Represents the type of user this is. This value must be supplied ifserviceId
is set.
-
getExternalId
@Nullable public String getExternalId()
Intended to hold any unique identifier for this user as known by an external (non-BLC) system. For example, many implementations may integrate or import/export data from other systems that manage their own unique identifiers.- Returns:
- a unique identifier for this user in a non-BLC system
-
getTenantId
@Nullable public String getTenantId()
The id of the tenant this user is associated with.
-
getCustomerContextId
@Nullable public String getCustomerContextId()
This field only applies toUserType.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.
-
getAttributes
public Map<String,Object> getAttributes()
Additional attributes of a user. All of a User's attributes that are available at the time of registration are available.
-
isLocked
public boolean isLocked()
Indicates the user has been locked due to too many failed login attempts.
-
getAccountRoles
public List<AccountRole> getAccountRoles()
Roles this user has under specific Account contexts.
-
setId
public void setId(String id)
-
setFirstName
public void setFirstName(String firstName)
The first name of the user, if the fullName is not being used for the user.- Parameters:
name
- The first name of the user- See Also:
Customer.getName()
-
setMiddleName
public void setMiddleName(String middleName)
The middle name of the user, if the fullName is not being used for the user.- Parameters:
name
- The middle name of the user- See Also:
Customer.getName()
-
setLastName
public void setLastName(String lastName)
The last name of the user, if the fullName is not being used for the user.- Parameters:
name
- The last name of the user- See Also:
Customer.getName()
-
setFullName
public void setFullName(String fullName)
The full name of the user.- See Also:
Customer.getName()
-
setUsername
public void setUsername(String username)
What this user uses to actually log in. Often the same asemail
.
-
setEmail
public void setEmail(String email)
The user's email address.
-
setPhone
public void setPhone(String phone)
The user's phone number
-
setServiceId
public void setServiceId(@Nullable String serviceId)
If the auth service received this user 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.If this value is set, there should also be a value set for
type
.Only if both values are non-null, a combination of this field and
type
will be unique across all records in the authentication service. There is no uniqueness guarantee for records which have a null service ID or nulltype
.- See Also:
type
-
setType
public void setType(@Nullable String type)
Represents the type of user this is. This value must be supplied ifserviceId
is set.
-
setExternalId
public void setExternalId(@Nullable String externalId)
Intended to hold any unique identifier for this user as known by an external (non-BLC) system. For example, many implementations may integrate or import/export data from other systems that manage their own unique identifiers.- Parameters:
externalId
- a unique identifier for this user in a non-BLC system
-
setTenantId
public void setTenantId(@Nullable String tenantId)
The id of the tenant this user is associated with.
-
setCustomerContextId
public void setCustomerContextId(@Nullable String customerContextId)
This field only applies toUserType.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.
-
setAttributes
public void setAttributes(Map<String,Object> attributes)
Additional attributes of a user. All of a User's attributes that are available at the time of registration are available.
-
setLocked
public void setLocked(boolean locked)
Indicates the user has been locked due to too many failed login attempts.
-
setAccountRoles
public void setAccountRoles(List<AccountRole> accountRoles)
Roles this user has under specific Account contexts.
-
canEqual
protected boolean canEqual(Object other)
-
-