Package org.cyclos.entities.users
Class User
- java.lang.Object
-
- org.cyclos.entities.SimpleEntity
-
- org.cyclos.entities.NetworkedEntity
-
- org.cyclos.entities.BaseEntity
-
- org.cyclos.entities.users.BasicUser
-
- org.cyclos.entities.users.User
-
- All Implemented Interfaces:
Cloneable,OtpOwner,HasNetwork,ProcessableForProxying,DefinesNetwork,EntityWithCustomValues<UserCustomField,UserCustomFieldPossibleValueCategory,UserCustomFieldPossibleValue,UserCustomFieldValue>,ImageOwner<User,UserImage>,ProductOwner,RoleContainer,AccountOwner,InternalAccountOwner,IEntity,INamedEntity,IUser
@Entity public class User extends BasicUser implements ProductOwner, ImageOwner<User,UserImage>
The user extends the BasicUser with the relationship with a group, so that all user subclasses are required to have a group
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.cyclos.entities.SimpleEntity
SimpleEntity.EntityLoadNotifier
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAgreementLog(AgreementLog log)This method must be used to leave the data model consistent.Set<Product>doGetProducts()StringgetAcceptedAgreementIds()Set<Agreement>getAcceptedAgreements()DategetActivationDate()Set<UserAddress>getAddresses()Set<BasicAd>getAds()Set<AgreementLog>getAgreementLogs()Set<UserAlert>getAlerts()Set<User>getBrokeredUsers()Set<Long>getBrokerIds()Set<BrokeringLog>getBrokeringLogs()Set<Brokering>getBrokerings()Set<Brokering>getBrokeringsAsUser()Set<User>getBrokers()UserChannelgetChannel(Channel channel)Set<UserChannel>getChannels()Set<ContactInfo>getContactInfos()Set<UserQuickAccess>getDashboardActions()UserAddressgetDefaultAddress()ExternalPaymentgetExternalPayment()GroupgetGroup()Set<UserGroupLog>getGroupHistory()GroupSetgetGroupSet()Set<User>getIgnoreFeedback()UserImagegetImage()Either the single image or a de-normalized reference to the first imageLonggetImageId()List<UserImage>getImages()Either all images or a collection with the single imageStringgetIndividualProductIds()BasicUsergetInvitedBy()StringgetInviteToken()UsergetMainBroker()RolegetMainRole()UserNaturegetNature()ProductOwnergetNextLevelProductOwner()Returns a possibly null next-level ownerSet<Product>getPhysicalProducts()Returns the persistent and attached products collection that can be modified to cascadeSet<PrivacyControl>getPrivacyControls()SortedSet<Long>getProductIds()Returns the redundant product ids directly assigned to this ownerSet<Product>getProducts()Returns all products directly assigned to this ownerSet<AdQuestion>getQuestions()Set<Reference>getReferencesFrom()Set<Reference>getReferencesTo()List<TempImage>getUploadedImages()UsergetUser()Returns the user associated with this basic userbooleanisAdmin()Returns whether theRole.ADMINis grantedbooleanisBroker()Returns whether theRole.BROKERis grantedbooleanisEnablePrivacyControl()booleanisGlobalAdmin()Returns whether theRole.GLOBAL_ADMINis granted Returns true if the user is the "root" user.booleanisHideEmail()booleanisMember()returns true if user has member role.booleanisNetworkAdmin()Returns whether theRole.NETWORK_ADMINis grantedbooleanisPhysicallyRemoving()voidsetAcceptedAgreements(Set<Agreement> acceptedAgreements)voidsetActivationDate(Date activationDate)voidsetAddresses(Set<UserAddress> addresses)voidsetAds(Set<BasicAd> ads)voidsetAgreementLogs(Set<AgreementLog> agreementLogs)voidsetAlerts(Set<UserAlert> alerts)voidsetBrokeredUsers(Set<User> brokeredUsers)voidsetBrokerIds(Set<Long> brokerIds)voidsetBrokeringLogs(Set<BrokeringLog> brokeringLogs)voidsetBrokers(Set<User> brokers)voidsetChannels(Set<UserChannel> channels)voidsetContactInfos(Set<ContactInfo> contactInfos)voidsetDashboardActions(Set<UserQuickAccess> dashboardActions)voidsetEnablePrivacyControl(boolean enablePrivacyControl)voidsetExternalPayment(ExternalPayment externalPayment)voidsetGroup(Group group)voidsetGroupHistory(Set<UserGroupLog> groupHistory)voidsetHideEmail(boolean hideEmail)voidsetIgnoreFeedback(Set<User> ignoreFeedback)voidsetImage(UserImage image)Either the single image or a de-normalized reference to the first imagevoidsetImages(List<UserImage> images)Assigns either all images or the first image if the owner has a single onevoidsetInvitedBy(BasicUser invitedBy)voidsetInviteToken(String inviteToken)voidsetPhysicallyRemoving(boolean physicallyRemoving)voidsetPrivacyControls(Set<PrivacyControl> privacyControls)voidsetQuestions(Set<AdQuestion> questions)voidsetReferencesFrom(Set<Reference> referencesFrom)voidsetReferencesTo(Set<Reference> referencesTo)voidsetUploadedImages(List<TempImage> uploadedImages)voidupdateProductIds(SortedSet<Long> productIds)Sets the redundant comma-separated list of product ids directly assigned to this owner-
Methods inherited from class org.cyclos.entities.users.BasicUser
addFcmToken, getActivity, getCreationDate, getCustomFieldClass, getCustomFieldValueClass, getCustomValues, getDisplayForManagers, getDisplayForOthers, getEmail, getFavoriteAds, getFcmTokens, getFrontend, getIdentityProviderRequestId, getLandLinePhones, getLocale, getMessagesLastViewDate, getMobilePhones, getName, getNetwork, getNewEmail, getNotificationsLastViewDate, getOtpOwnerPathName, getOtps, getOtpUser, getPasswords, getPasswordStatuses, getPhones, getPreferredLandLinePhone, getPreferredMobilePhone, getPreferredPhone, getRegisteredBy, getRegistrationConfirmationDate, getRegistrationType, getSecurityAnswer, getSecurityQuestion, getStatus, getTotpSecret, getUsername, getValidationKey, getValidationKeyDate, getValidationKeyType, hasMobileEnabledForSMS, hasVerifiedMobilePhone, isActive, isAliasOperator, isBlocked, isEmailVerified, isInactive, isOperator, isPendingNewEmailValidation, isPendingValidation, isPurged, isRemoved, isRestrictedOperator, isSendActivationEmail, isUserManager, removeFcmToken, setActivity, setAsOwnerFor, setCreationDate, setCustomValues, setDisplayForManagers, setDisplayForOthers, setEmail, setEmailVerified, setFavoriteAds, setFcmTokens, setFrontend, setIdentityProviderRequestId, setLocale, setName, setNetwork, setNewEmail, setPasswords, setPasswordStatuses, setPhones, setRegisteredBy, setRegistrationConfirmationDate, setRegistrationType, setSecurityAnswer, setSecurityQuestion, setSendActivationEmail, setStatus, setTotpSecret, setUsername, setValidationKey, setValidationKeyDate, setValidationKeyType, toString
-
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
equals, getId, hashCode, id, ids, isPersistent, isTransient, register, setId, toShortString, uniqueIds, uniqueIds
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cyclos.entities.HasNetwork
getNetwork, isGlobal
-
Methods inherited from interface org.cyclos.entities.access.OtpOwner
resolveOwnerPath
-
Methods inherited from interface org.cyclos.entities.ProcessableForProxying
getProxyClass
-
Methods inherited from interface org.cyclos.entities.users.ProductOwner
addProduct, getAllProductIds, removeProduct
-
Methods inherited from interface org.cyclos.entities.users.RoleContainer
isMemberOnly
-
-
-
-
Constructor Detail
-
User
@Deprecated public User()
Deprecated.This should never be used programmatically because the user always needs the group. It is here to cover the reflection use cases.
-
User
public User(Group group)
-
-
Method Detail
-
addAgreementLog
public void addAgreementLog(AgreementLog log)
This method must be used to leave the data model consistent. It updates the relationship on both sides.
-
getAcceptedAgreementIds
public String getAcceptedAgreementIds()
-
getActivationDate
public Date getActivationDate()
-
getAddresses
public Set<UserAddress> getAddresses()
-
getAgreementLogs
public Set<AgreementLog> getAgreementLogs()
-
getBrokeringLogs
public Set<BrokeringLog> getBrokeringLogs()
-
getChannel
public UserChannel getChannel(Channel channel)
-
getChannels
public Set<UserChannel> getChannels()
-
getContactInfos
public Set<ContactInfo> getContactInfos()
-
getDashboardActions
public Set<UserQuickAccess> getDashboardActions()
-
getDefaultAddress
public UserAddress getDefaultAddress()
-
getExternalPayment
public ExternalPayment getExternalPayment()
-
getGroup
public Group getGroup()
-
getGroupHistory
public Set<UserGroupLog> getGroupHistory()
-
getGroupSet
public GroupSet getGroupSet()
-
getImage
public UserImage getImage()
Description copied from interface:ImageOwnerEither the single image or a de-normalized reference to the first image- Specified by:
getImagein interfaceImageOwner<User,UserImage>
-
getImageId
public Long getImageId()
-
getImages
public List<UserImage> getImages()
Description copied from interface:ImageOwnerEither all images or a collection with the single image- Specified by:
getImagesin interfaceImageOwner<User,UserImage>
-
getIndividualProductIds
public String getIndividualProductIds()
-
getInvitedBy
public BasicUser getInvitedBy()
-
getInviteToken
public String getInviteToken()
-
getMainBroker
public User getMainBroker()
-
getMainRole
public Role getMainRole()
- Specified by:
getMainRolein classBasicUser
-
getNature
public UserNature getNature()
-
getNextLevelProductOwner
public ProductOwner getNextLevelProductOwner()
Description copied from interface:ProductOwnerReturns a possibly null next-level owner- Specified by:
getNextLevelProductOwnerin interfaceProductOwner
-
getPhysicalProducts
public Set<Product> getPhysicalProducts()
Description copied from interface:ProductOwnerReturns the persistent and attached products collection that can be modified to cascade- Specified by:
getPhysicalProductsin interfaceProductOwner
-
getPrivacyControls
public Set<PrivacyControl> getPrivacyControls()
-
getProductIds
public SortedSet<Long> getProductIds()
Description copied from interface:ProductOwnerReturns the redundant product ids directly assigned to this owner- Specified by:
getProductIdsin interfaceProductOwner
-
getProducts
public Set<Product> getProducts()
Description copied from interface:ProductOwnerReturns all products directly assigned to this owner- Specified by:
getProductsin interfaceProductOwner
-
getQuestions
public Set<AdQuestion> getQuestions()
-
getUser
public User getUser()
Description copied from class:BasicUserReturns the user associated with this basic user
-
isAdmin
public boolean isAdmin()
Description copied from interface:RoleContainerReturns whether theRole.ADMINis granted- Specified by:
isAdminin interfaceRoleContainer- Overrides:
isAdminin classBasicUser
-
isBroker
public boolean isBroker()
Description copied from interface:RoleContainerReturns whether theRole.BROKERis granted- Specified by:
isBrokerin interfaceRoleContainer- Overrides:
isBrokerin classBasicUser
-
isEnablePrivacyControl
public boolean isEnablePrivacyControl()
-
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- Overrides:
isGlobalAdminin classBasicUser- See Also:
RoleContainer.isGlobalAdmin()
-
isHideEmail
public boolean isHideEmail()
-
isMember
public boolean isMember()
Description copied from class:BasicUserreturns true if user has member role.- Specified by:
isMemberin interfaceRoleContainer- Overrides:
isMemberin classBasicUser
-
isNetworkAdmin
public boolean isNetworkAdmin()
Description copied from interface:RoleContainerReturns whether theRole.NETWORK_ADMINis granted- Specified by:
isNetworkAdminin interfaceRoleContainer- Overrides:
isNetworkAdminin classBasicUser
-
isPhysicallyRemoving
public boolean isPhysicallyRemoving()
-
setActivationDate
public void setActivationDate(Date activationDate)
-
setAddresses
public void setAddresses(Set<UserAddress> addresses)
-
setAgreementLogs
public void setAgreementLogs(Set<AgreementLog> agreementLogs)
-
setBrokeringLogs
public void setBrokeringLogs(Set<BrokeringLog> brokeringLogs)
-
setChannels
public void setChannels(Set<UserChannel> channels)
-
setContactInfos
public void setContactInfos(Set<ContactInfo> contactInfos)
-
setDashboardActions
public void setDashboardActions(Set<UserQuickAccess> dashboardActions)
-
setEnablePrivacyControl
public void setEnablePrivacyControl(boolean enablePrivacyControl)
-
setExternalPayment
public void setExternalPayment(ExternalPayment externalPayment)
-
setGroup
public void setGroup(Group group)
-
setGroupHistory
public void setGroupHistory(Set<UserGroupLog> groupHistory)
-
setHideEmail
public void setHideEmail(boolean hideEmail)
-
setImage
public void setImage(UserImage image)
Description copied from interface:ImageOwnerEither the single image or a de-normalized reference to the first image- Specified by:
setImagein interfaceImageOwner<User,UserImage>
-
setImages
public void setImages(List<UserImage> images)
Description copied from interface:ImageOwnerAssigns either all images or the first image if the owner has a single one- Specified by:
setImagesin interfaceImageOwner<User,UserImage>
-
setInvitedBy
public void setInvitedBy(BasicUser invitedBy)
-
setInviteToken
public void setInviteToken(String inviteToken)
-
setPhysicallyRemoving
public void setPhysicallyRemoving(boolean physicallyRemoving)
-
setPrivacyControls
public void setPrivacyControls(Set<PrivacyControl> privacyControls)
-
setQuestions
public void setQuestions(Set<AdQuestion> questions)
-
updateProductIds
public void updateProductIds(SortedSet<Long> productIds)
Description copied from interface:ProductOwnerSets the redundant comma-separated list of product ids directly assigned to this owner- Specified by:
updateProductIdsin interfaceProductOwner
-
-