Package org.cyclos.entities.users
Class BasicUser
- java.lang.Object
-
- org.cyclos.entities.SimpleEntity
-
- org.cyclos.entities.NetworkedEntity
-
- org.cyclos.entities.BaseEntity
-
- org.cyclos.entities.users.BasicUser
-
- All Implemented Interfaces:
Cloneable,HasNetwork,ProcessableForDataTranslation,DefinesNetwork,EntityWithCustomValues<UserCustomField,UserCustomFieldPossibleValueCategory,UserCustomFieldPossibleValue,UserCustomFieldValue>,RoleContainer,AccountOwner,InternalAccountOwner,IEntity,INamedEntity,IUser
@Entity public abstract class BasicUser extends BaseEntity implements IUser, INamedEntity, DefinesNetwork, RoleContainer, EntityWithCustomValues<UserCustomField,UserCustomFieldPossibleValueCategory,UserCustomFieldPossibleValue,UserCustomFieldValue>
The root class for user hierarchy
-
-
Constructor Summary
Constructors Constructor Description BasicUser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddFcmToken(UserFcmToken fcmToken)Add the given token to the user Warning: This method blindly add the given fcm token without checking if the token value already was assignedUserActivitygetActivity()DategetCreationDate()Class<UserCustomField>getCustomFieldClass()Returns custom field the class on this entityClass<UserCustomFieldValue>getCustomFieldValueClass()Returns the class for storing custom field valuesSet<UserCustomFieldValue>getCustomValues()Returns all custom field valuesStringgetDisplayForManagers()StringgetDisplayForOthers()StringgetEmail()Set<UserFcmToken>getFcmTokens()StringgetForgotPasswordCode()DategetForgotPasswordCodeDate()FrontendgetFrontend()StringgetIdentityProviderRequestId()List<LandLinePhone>getLandLinePhones()Returns only the land-line phonesStringgetLocale()abstract RolegetMainRole()DategetMessagesLastViewDate()Returns the last view date for the messages from the user activity, if any.List<MobilePhone>getMobilePhones()Returns only the mobile phonesStringgetName()abstract UserNaturegetNature()NetworkgetNetwork()Returns the network this entity belongs toStringgetNewEmail()DategetNotificationsLastViewDate()Returns the last view date for the notifications from the user activity, if any.Set<Password>getPasswords()StringgetPasswordStatuses()Set<Phone>getPhones()LandLinePhonegetPreferredLandLinePhone()The preferred land-line phone - actually the first returned land-line phoneMobilePhonegetPreferredMobilePhone()The preferred mobile phone - if there is a verified mobile, returns it.PhonegetPreferredPhone()First attemptsgetPreferredMobilePhone().BasicUsergetRegisteredBy()DategetRegistrationConfirmationDate()UserRegistrationgetRegistrationType()StringgetSecurityAnswer()SecurityQuestiongetSecurityQuestion()UserStatusgetStatus()abstract UsergetUser()Returns the user associated with this basic userStringgetUsername()StringgetValidationKey()DategetValidationKeyDate()ValidationKeyTypegetValidationKeyType()booleanhasMobileEnabledForSMS()booleanisActive()booleanisAdmin()Returns whether theRole.ADMINis grantedbooleanisAliasOperator()Returns whether theRole.ALIAS_OPERATORis grantedbooleanisBlocked()booleanisBroker()Returns whether theRole.BROKERis grantedbooleanisEmailVerified()booleanisGlobalAdmin()Returns whether theRole.GLOBAL_ADMINis granted Returns true if the user is the "root" user.booleanisInactive()booleanisMember()returns true if user has member role.booleanisNetworkAdmin()Returns whether theRole.NETWORK_ADMINis grantedbooleanisOperator()Returns whether theRole.OPERATORis grantedbooleanisPendingNewEmailValidation()Returns true if the user's email modification is pending from being validated.booleanisPendingValidation()booleanisPurged()booleanisRemoved()booleanisRestrictedOperator()Returns whether theRole.RESTRICTED_OPERATORis grantedbooleanisSendActivationEmail()booleanisUserManager()Returns whether theRole.ADMINorRole.BROKERroles are grantedvoidremoveFcmToken(UserFcmToken fcmToken)voidsetActivity(UserActivity activity)voidsetCreationDate(Date creationDate)voidsetCustomValues(Set<UserCustomFieldValue> customValues)voidsetDisplayForManagers(String displayForManagers)voidsetDisplayForOthers(String displayForOthers)voidsetEmail(String email)voidsetEmailVerified(boolean emailVerified)voidsetFcmTokens(Set<UserFcmToken> fcmTokens)voidsetForgotPasswordCode(String forgotPasswordCode)voidsetForgotPasswordCodeDate(Date forgotPasswordCodeDate)voidsetFrontend(Frontend frontend)voidsetIdentityProviderRequestId(String identityProviderRequestId)voidsetLocale(String locale)voidsetName(String name)voidsetNetwork(Network network)voidsetNewEmail(String newEmail)voidsetPasswords(Set<Password> passwords)voidsetPasswordStatuses(String passwordStatuses)voidsetPhones(Set<Phone> phones)voidsetRegisteredBy(BasicUser registeredBy)voidsetRegistrationConfirmationDate(Date registrationConfirmationDate)voidsetRegistrationType(UserRegistration registrationType)voidsetSecurityAnswer(String securityAnswer)voidsetSecurityQuestion(SecurityQuestion securityQuestion)voidsetSendActivationEmail(boolean sendActivationEmail)voidsetStatus(UserStatus status)voidsetUsername(String username)voidsetValidationKey(String validationKey)voidsetValidationKeyDate(Date validationKeyDate)voidsetValidationKeyType(ValidationKeyType validationKeyType)StringtoString()-
Methods inherited from class org.cyclos.entities.BaseEntity
getDataTranslationType, getVersion
-
Methods inherited from class org.cyclos.entities.NetworkedEntity
isGlobal
-
Methods inherited from class org.cyclos.entities.SimpleEntity
clone, equals, getId, hashCode, id, ids, isPersistent, isTransient, setId, toShortString, uniqueIds, uniqueIds
-
-
-
-
Method Detail
-
addFcmToken
public void addFcmToken(UserFcmToken fcmToken)
Add the given token to the user Warning: This method blindly add the given fcm token without checking if the token value already was assigned
-
getActivity
public UserActivity getActivity()
-
getCreationDate
public Date getCreationDate()
-
getCustomFieldClass
public Class<UserCustomField> getCustomFieldClass()
Description copied from interface:EntityWithCustomValuesReturns custom field the class on this entity- Specified by:
getCustomFieldClassin interfaceEntityWithCustomValues<UserCustomField,UserCustomFieldPossibleValueCategory,UserCustomFieldPossibleValue,UserCustomFieldValue>
-
getCustomFieldValueClass
public Class<UserCustomFieldValue> getCustomFieldValueClass()
Description copied from interface:EntityWithCustomValuesReturns the class for storing custom field values
-
getCustomValues
public Set<UserCustomFieldValue> getCustomValues()
Description copied from interface:EntityWithCustomValuesReturns all custom field values- Specified by:
getCustomValuesin interfaceEntityWithCustomValues<UserCustomField,UserCustomFieldPossibleValueCategory,UserCustomFieldPossibleValue,UserCustomFieldValue>
-
getDisplayForManagers
public String getDisplayForManagers()
-
getDisplayForOthers
public String getDisplayForOthers()
-
getEmail
public String getEmail()
-
getFcmTokens
public Set<UserFcmToken> getFcmTokens()
-
getForgotPasswordCode
public String getForgotPasswordCode()
-
getForgotPasswordCodeDate
public Date getForgotPasswordCodeDate()
-
getFrontend
public Frontend getFrontend()
-
getIdentityProviderRequestId
public String getIdentityProviderRequestId()
-
getLandLinePhones
public List<LandLinePhone> getLandLinePhones()
Returns only the land-line phones
-
getLocale
public String getLocale()
-
getMainRole
public abstract Role getMainRole()
-
getMessagesLastViewDate
public Date getMessagesLastViewDate()
Returns the last view date for the messages from the user activity, if any.
-
getMobilePhones
public List<MobilePhone> getMobilePhones()
Returns only the mobile phones
-
getName
public String getName()
- Specified by:
getNamein interfaceINamedEntity
-
getNature
public abstract UserNature getNature()
-
getNetwork
public Network getNetwork()
Description copied from interface:HasNetworkReturns the network this entity belongs to- Specified by:
getNetworkin interfaceHasNetwork
-
getNewEmail
public String getNewEmail()
-
getNotificationsLastViewDate
public Date getNotificationsLastViewDate()
Returns the last view date for the notifications from the user activity, if any.
-
getPasswordStatuses
public String getPasswordStatuses()
-
getPreferredLandLinePhone
public LandLinePhone getPreferredLandLinePhone()
The preferred land-line phone - actually the first returned land-line phone
-
getPreferredMobilePhone
public MobilePhone getPreferredMobilePhone()
The preferred mobile phone - if there is a verified mobile, returns it. Otherwise, any mobile phone.
-
getPreferredPhone
public Phone getPreferredPhone()
First attemptsgetPreferredMobilePhone(). If none is found, returns the first land-line. Otherwise returns null.
-
getRegisteredBy
public BasicUser getRegisteredBy()
-
getRegistrationConfirmationDate
public Date getRegistrationConfirmationDate()
-
getRegistrationType
public UserRegistration getRegistrationType()
-
getSecurityAnswer
public String getSecurityAnswer()
-
getSecurityQuestion
public SecurityQuestion getSecurityQuestion()
-
getStatus
public UserStatus getStatus()
-
getUser
public abstract User getUser()
Returns the user associated with this basic user
-
getUsername
public String getUsername()
-
getValidationKey
public String getValidationKey()
-
getValidationKeyDate
public Date getValidationKeyDate()
-
getValidationKeyType
public ValidationKeyType getValidationKeyType()
-
hasMobileEnabledForSMS
public boolean hasMobileEnabledForSMS()
-
isActive
public boolean isActive()
-
isAdmin
public boolean isAdmin()
Description copied from interface:RoleContainerReturns whether theRole.ADMINis granted- Specified by:
isAdminin interfaceRoleContainer
-
isAliasOperator
public boolean isAliasOperator()
Description copied from interface:RoleContainerReturns whether theRole.ALIAS_OPERATORis granted- Specified by:
isAliasOperatorin interfaceRoleContainer
-
isBlocked
public boolean isBlocked()
-
isBroker
public boolean isBroker()
Description copied from interface:RoleContainerReturns whether theRole.BROKERis granted- Specified by:
isBrokerin interfaceRoleContainer
-
isEmailVerified
public boolean isEmailVerified()
-
isGlobalAdmin
public boolean isGlobalAdmin()
Description copied from interface:RoleContainerReturns whether theRole.GLOBAL_ADMINis granted Returns true if the user is the "root" user. For multi-networks administrators it returns false- Specified by:
isGlobalAdminin interfaceRoleContainer- See Also:
RoleContainer.isGlobalAdmin()
-
isInactive
public boolean isInactive()
-
isMember
public boolean isMember()
returns true if user has member role.- Specified by:
isMemberin interfaceRoleContainer
-
isNetworkAdmin
public boolean isNetworkAdmin()
Description copied from interface:RoleContainerReturns whether theRole.NETWORK_ADMINis granted- Specified by:
isNetworkAdminin interfaceRoleContainer
-
isOperator
public boolean isOperator()
Description copied from interface:RoleContainerReturns whether theRole.OPERATORis granted- Specified by:
isOperatorin interfaceRoleContainer
-
isPendingNewEmailValidation
public boolean isPendingNewEmailValidation()
Returns true if the user's email modification is pending from being validated.
-
isPendingValidation
public boolean isPendingValidation()
-
isPurged
public boolean isPurged()
-
isRemoved
public boolean isRemoved()
-
isRestrictedOperator
public boolean isRestrictedOperator()
Description copied from interface:RoleContainerReturns whether theRole.RESTRICTED_OPERATORis granted- Specified by:
isRestrictedOperatorin interfaceRoleContainer
-
isSendActivationEmail
public boolean isSendActivationEmail()
-
isUserManager
public boolean isUserManager()
Description copied from interface:RoleContainerReturns whether theRole.ADMINorRole.BROKERroles are granted- Specified by:
isUserManagerin interfaceRoleContainer
-
removeFcmToken
public void removeFcmToken(UserFcmToken fcmToken)
-
setActivity
public void setActivity(UserActivity activity)
-
setCreationDate
public void setCreationDate(Date creationDate)
-
setCustomValues
public void setCustomValues(Set<UserCustomFieldValue> customValues)
-
setDisplayForManagers
public void setDisplayForManagers(String displayForManagers)
-
setDisplayForOthers
public void setDisplayForOthers(String displayForOthers)
-
setEmail
public void setEmail(String email)
-
setEmailVerified
public void setEmailVerified(boolean emailVerified)
-
setFcmTokens
public void setFcmTokens(Set<UserFcmToken> fcmTokens)
-
setForgotPasswordCode
public void setForgotPasswordCode(String forgotPasswordCode)
-
setForgotPasswordCodeDate
public void setForgotPasswordCodeDate(Date forgotPasswordCodeDate)
-
setFrontend
public void setFrontend(Frontend frontend)
-
setIdentityProviderRequestId
public void setIdentityProviderRequestId(String identityProviderRequestId)
-
setLocale
public void setLocale(String locale)
-
setName
public void setName(String name)
- Specified by:
setNamein interfaceINamedEntity
-
setNetwork
public void setNetwork(Network network)
- Specified by:
setNetworkin interfaceDefinesNetwork
-
setNewEmail
public void setNewEmail(String newEmail)
-
setPasswordStatuses
public void setPasswordStatuses(String passwordStatuses)
-
setRegisteredBy
public void setRegisteredBy(BasicUser registeredBy)
-
setRegistrationConfirmationDate
public void setRegistrationConfirmationDate(Date registrationConfirmationDate)
-
setRegistrationType
public void setRegistrationType(UserRegistration registrationType)
-
setSecurityAnswer
public void setSecurityAnswer(String securityAnswer)
-
setSecurityQuestion
public void setSecurityQuestion(SecurityQuestion securityQuestion)
-
setSendActivationEmail
public void setSendActivationEmail(boolean sendActivationEmail)
-
setStatus
public void setStatus(UserStatus status)
-
setUsername
public void setUsername(String username)
-
setValidationKey
public void setValidationKey(String validationKey)
-
setValidationKeyDate
public void setValidationKeyDate(Date validationKeyDate)
-
setValidationKeyType
public void setValidationKeyType(ValidationKeyType validationKeyType)
-
toString
public String toString()
- Overrides:
toStringin classSimpleEntity
-
-