Class UserDetail

    • Constructor Detail

      • UserDetail

        public UserDetail()
        Constructor
      • UserDetail

        public UserDetail​(UserDetail otherUser)
    • Method Detail

      • from

        public static UserDetail from​(User user)
        Gets a UserDetail form of the specified user.
        Parameters:
        user - a user.
        Returns:
        a user detail.
      • getById

        public static UserDetail getById​(String userId)
        Gets the detail about the specified user.
        Parameters:
        userId - the unique identifier of the user to get.
        Returns:
        the detail about the user with the specified identifier or null if no such user exists.
      • getCurrentRequester

        public static UserDetail getCurrentRequester()
        Gets the detail about the current user behind a request of treatment processing.
        Returns:
        the detail about the user above described.
      • getSystemUser

        public static UserDetail getSystemUser()
        Gets the system user of Silverpeas. It is a virtual user (that is to say a user without any account in Silverpeas) used in some processes that are triggered by no real users or executed for one or more users but by the system itself (like batch processes).
        Returns:
        the system user of Silverpeas.
      • getAll

        public static List<UserDetail> getAll()
        Gets the detail about all the users in Silverpeas, whatever their domain.
        Returns:
        a list with all the users in Silverpeas.
      • hasSensitiveData

        public boolean hasSensitiveData()
        Does this user have sensitive data? User data that could be sensitive are defined in the descriptor of the domain to which this user belongs.
        Returns:
        true if some of the user data are sensitive. False otherwise
      • setSensitiveData

        public void setSensitiveData​(boolean sensitive)
        Sets some of the user data as sensitive or not. The potential data that can be sensitive are defined in the descriptor of the domain to which this user belongs.
        Parameters:
        sensitive - a boolean indicating whether the data declared as potentially sensitive in the user domain descriptor have to be marked as such: true and the data are marked as sensitive, false and the data are declared as not being actually sensitive.
      • getLoginQuestion

        public String getLoginQuestion()
        Returns:
        the login question String representation
      • setLoginQuestion

        public void setLoginQuestion​(String loginQuestion)
        Set the question to the user having lost his login.
        Parameters:
        loginQuestion - the new login question
      • getLoginAnswer

        public String getLoginAnswer()
        Returns:
        the login answer
      • setLoginAnswer

        public void setLoginAnswer​(String loginAnswer)
        Set the login answer
        Parameters:
        loginAnswer - the new answer to the login question
      • getTosAcceptanceDate

        public Date getTosAcceptanceDate()
        Returns:
        the date of terms of service acceptance
      • setTosAcceptanceDate

        public void setTosAcceptanceDate​(Date tosAcceptanceDate)
        Parameters:
        tosAcceptanceDate - the date of terms of service acceptance
      • getLastLoginDate

        public Date getLastLoginDate()
        Returns:
        the date of the last user login
      • setLastLoginDate

        public void setLastLoginDate​(Date lastLoginDate)
        Parameters:
        lastLoginDate - the date of the last user login
      • getNbSuccessfulLoginAttempts

        public int getNbSuccessfulLoginAttempts()
        Returns:
        number of successful login attempts
      • setNbSuccessfulLoginAttempts

        public void setNbSuccessfulLoginAttempts​(int nbSuccessfulLoginAttempts)
        Parameters:
        nbSuccessfulLoginAttempts - number of successful login attempts
      • getLastLoginCredentialUpdateDate

        public Date getLastLoginCredentialUpdateDate()
        Returns:
        the date of the last update of login credentials
      • setLastLoginCredentialUpdateDate

        public void setLastLoginCredentialUpdateDate​(Date lastLoginCredentialUpdateDate)
        Parameters:
        lastLoginCredentialUpdateDate - the date of the last update of login credentials
      • getExpirationDate

        public Date getExpirationDate()
        Returns:
        the date of user expiration (account)
      • setExpirationDate

        public void setExpirationDate​(Date expirationDate)
        Parameters:
        expirationDate - the date of user expiration (account)
      • setState

        public void setState​(UserState state)
        The state of the user (account) is updated and the corresponding save date too.
        Parameters:
        state - the state of the user (account)
      • getCreationDate

        public Date getCreationDate()
        Description copied from interface: User
        Gets the date of the user creation.
        Specified by:
        getCreationDate in interface User
        Returns:
        creation date of the user as Date.
      • setCreationDate

        public void setCreationDate​(Date creationDate)
        Parameters:
        creationDate - the date of the user creation
      • getSaveDate

        public Date getSaveDate()
        Description copied from interface: User
        Gets the date of the last user save.
        Specified by:
        getSaveDate in interface User
        Returns:
        the date of the last user save as Date.
      • setSaveDate

        public void setSaveDate​(Date saveDate)
        Parameters:
        saveDate - the date of the last user save
      • getVersion

        public int getVersion()
        Description copied from interface: User
        Gets the version of the user data. The number of time the entity has been saved in other words.
        Specified by:
        getVersion in interface User
        Returns:
        the version of the last save as integer.
      • setVersion

        public void setVersion​(int version)
        Parameters:
        version - the version of the last save
      • getStateSaveDate

        public Date getStateSaveDate()
        Description copied from interface: User
        Gets the last date of the last user save.
        Specified by:
        getStateSaveDate in interface User
        Returns:
        the date of last user state save (when it changes) as Date.
      • setStateSaveDate

        public void setStateSaveDate​(Date stateSaveDate)
        Parameters:
        stateSaveDate - the date of last user state save (when it changes)
      • getId

        public String getId()
        Description copied from interface: User
        The unique identifier of the user into Silverpeas.
        Specified by:
        getId in interface User
        Returns:
        identifier as string.
      • setId

        public void setId​(String id)
        Set user identifier
        Parameters:
        id - the user identifier to set
      • getSpecificId

        public String getSpecificId()
        Get specific user id
        Returns:
        the user identifier specific to the identity service into which his account is registered.
      • setSpecificId

        public void setSpecificId​(String specificId)
        Set specific user id
        Parameters:
        specificId - set the identifier of the user specific to the identity server into which his account is registered.
      • getDomainId

        public String getDomainId()
        Description copied from interface: User
        Gets the user domain id.
        Specified by:
        getDomainId in interface User
        Returns:
        user domain id as string.
      • setDomainId

        public void setDomainId​(String domainId)
        Set user domain id
        Parameters:
        domainId - the unique identifier of the user domain he belongs to.
      • getLogin

        public String getLogin()
        Description copied from interface: User
        Gets the user login.
        Specified by:
        getLogin in interface User
        Returns:
        user login as string.
      • setLogin

        public void setLogin​(String login)
        Set user login
        Parameters:
        login - the login to set
      • getFirstName

        public String getFirstName()
        Description copied from interface: User
        Gets the first name of the user.
        Specified by:
        getFirstName in interface User
        Returns:
        first name as string.
      • setFirstName

        public void setFirstName​(String firstName)
        Set user first name
        Parameters:
        firstName - user first name
      • getLastName

        public String getLastName()
        Description copied from interface: User
        Gets the last name of the user.
        Specified by:
        getLastName in interface User
        Returns:
        last name as string.
      • setLastName

        public void setLastName​(String sLastName)
        Set user last name
        Parameters:
        sLastName - user last name
      • setEmailAddress

        public void setEmailAddress​(String emailAddress)
        Set user's email
        Parameters:
        emailAddress - the email address of the user.
      • getEmailAddress

        public String getEmailAddress()
        Description copied from interface: User
        Gets the user email.
        Specified by:
        getEmailAddress in interface User
        Returns:
        user email as string.
      • setAccessLevel

        public void setAccessLevel​(UserAccessLevel accessLevel)
        Set user access level
        Parameters:
        accessLevel - the access level of the user
      • getDomain

        public Domain getDomain()
        Gets the domain to which this user belongs.
        Returns:
        a user domain.
      • isDomainRestricted

        public boolean isDomainRestricted()
        Description copied from interface: User
        Indicates if the user is restricted to access the resource in its own domain only.
        Specified by:
        isDomainRestricted in interface User
        Returns:
        true if it's restricted, false otherwise.
      • isDomainAdminRestricted

        public boolean isDomainAdminRestricted()
        Description copied from interface: User
        Indicates if the user has admin account and is restricted to access the resource in its own domain only.
        Specified by:
        isDomainAdminRestricted in interface User
        Returns:
        true if it's restricted, false otherwise.
      • isBackOfficeVisible

        public boolean isBackOfficeVisible()
      • isAccessAdmin

        public boolean isAccessAdmin()
        Description copied from interface: User
        Indicates if the user has admin access on the platform.
        Specified by:
        isAccessAdmin in interface User
        Returns:
        true if admin access, false otherwise.
      • isAccessDomainManager

        public boolean isAccessDomainManager()
        Description copied from interface: User
        Indicates if the user has domain manager access on the platform.
        Specified by:
        isAccessDomainManager in interface User
        Returns:
        true if domain manager access, false otherwise.
      • isAccessPdcManager

        public boolean isAccessPdcManager()
        Description copied from interface: User
        Indicates if the user has PDC manager access on the platform.
        Specified by:
        isAccessPdcManager in interface User
        Returns:
        true if PDC manager access, false otherwise.
      • isAccessUser

        public boolean isAccessUser()
        Description copied from interface: User
        Indicates if the user has user access on the platform.
        Specified by:
        isAccessUser in interface User
        Returns:
        true if user access, false otherwise.
      • isAccessGuest

        public boolean isAccessGuest()
        Description copied from interface: User
        Indicates if the user has guest access on the platform.
        Specified by:
        isAccessGuest in interface User
        Returns:
        true if guest access, false otherwise.
      • isAccessUnknown

        public boolean isAccessUnknown()
        Description copied from interface: User
        Indicates if the user has unknown access on the platform.
        Specified by:
        isAccessUnknown in interface User
        Returns:
        true if unknown access, false otherwise.
      • isPlayingAdminRole

        public boolean isPlayingAdminRole​(String instanceId)
        Description copied from interface: User
        Indicates if either the user is an administrator or he plays the administrator role in the specified component instance. The roles the user can play are different from the privileges he has in the given component instance. The privileges for a component instance are controlled by the ComponentAccessControl service, based upon the roles the user has specifically in the given component instance.
        Specified by:
        isPlayingAdminRole in interface User
        Parameters:
        instanceId - the unique identifier of a component instance in Silverpeas.
        Returns:
        true if the user has an admin access on the platform or if he plays the administrator role in the given component instance. False otherwise.
      • isValidState

        public boolean isValidState()
        Description copied from interface: User
        This method is the only one able to indicate the user validity state. Please do not use User.getState() to retrieve user validity information.
        Specified by:
        isValidState in interface User
        Returns:
        true if valid state, false otherwise.
      • isDeletedState

        public boolean isDeletedState()
        Description copied from interface: User
        This method is the only one able to indicate the user deletion state. Please do not use User.getState() to retrieve user deletion information.
        Specified by:
        isDeletedState in interface User
        Returns:
        true if deleted state, false otherwise.
      • isRemovedState

        public boolean isRemovedState()
        Description copied from interface: User
        This method is the only one able to indicate the user removed state. Please do not use User.getState() to retrieve user removed information.
        Specified by:
        isRemovedState in interface User
        Returns:
        true if deleted state, false otherwise.
      • isBlockedState

        public boolean isBlockedState()
        Description copied from interface: User
        This method is the only one able to indicate the user blocked state. Please do not use User.getState() to retrieve user blocked information.
        Specified by:
        isBlockedState in interface User
        Returns:
        true if blocked state, false otherwise.
      • isDeactivatedState

        public boolean isDeactivatedState()
        Description copied from interface: User
        This method is the only one able to indicate the user deactivated state. Please do not use User.getState() to retrieve user deactivated information.
        Specified by:
        isDeactivatedState in interface User
        Returns:
        true if deactivated state, false otherwise.
      • isExpiredState

        public boolean isExpiredState()
        Description copied from interface: User
        This method is the only one able to indicate the user expiration state. Please do not use User.getState() to retrieve user expiration information.
        Specified by:
        isExpiredState in interface User
        Returns:
        true if user is expired.
      • isSystem

        public boolean isSystem()
        Description copied from interface: User
        Is this user the system one? A system user is a virtual one played by the Silverpeas platform to perform tasks that aren't invoked explicitly by a user in Silverpeas but triggered either by a scheduler or a batch process like a workflow.
        Specified by:
        isSystem in interface User
        Returns:
        true if this user is the virtual system one. False otherwise.
      • isAnonymous

        public boolean isAnonymous()
        Description copied from interface: User
        Indicates if the user is an anonymous one.
        Specified by:
        isAnonymous in interface User
        Returns:
        true if anonymous, false otherwise.
      • isBlanked

        public boolean isBlanked()
        Description copied from interface: User
        Indicates if the user was blanked after its deletion. Blank a user means its data has been blanked and therefore any of his contributions in Silverpeas can be figured out; his contributions were anonymized.
        Specified by:
        isBlanked in interface User
        Returns:
        true if the user was blanked.
      • getAnonymousUser

        public static UserDetail getAnonymousUser()
        Gets the anonymous user or null if no such user exists.
        Returns:
        the detail about the anonymous user or null if no such user exists.
      • getToken

        public String getToken()
        Gets the API token of the user. Each user in Silverpeas has a token with which he can access some services or web resources available out of Silverpeas; the token serves to authenticate and to identify him among those services or web resources in order to use them.
        Returns:
        the API token of the user.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • traceUser

        public void traceUser()
        Dump user values to the trace system
      • getAvatar

        public String getAvatar()
        Description copied from interface: User
        Gets the avatar URL of the user.
        Specified by:
        getAvatar in interface User
        Returns:
        the avatar URL as string.
      • getSmallAvatar

        public String getSmallAvatar()
        Description copied from interface: User
        Gets the URL of a smaller version of avatar than the one provided by User.getAvatar() method.
        Specified by:
        getSmallAvatar in interface User
        Returns:
        the small avatar URL as string.
      • isAvatarDefined

        public boolean isAvatarDefined()
      • getAvatarFileName

        public String getAvatarFileName()
      • getStatus

        public String getStatus()
        Description copied from interface: User
        Gets the current status filled by the user itself.
        Specified by:
        getStatus in interface User
        Returns:
        current status as string.
      • getUserPreferences

        public UserPreferences getUserPreferences()
        Description copied from interface: User
        Gets the preferences of this user.
        Specified by:
        getUserPreferences in interface User
        Returns:
        the user preferences.
      • isInRelationWith

        public boolean isInRelationWith​(String userId)
        Indicates if the current user is in relation with a user represented by the given identifier.
        Parameters:
        userId - the identifier of user which the current user is potentially in relation with.
        Returns:
        true if the current user is in relation with the user represented by the given identifier, false otherwise.
      • getInvitationSentTo

        public Invitation getInvitationSentTo​(String userId)
      • getInvitationReceivedFrom

        public Invitation getInvitationReceivedFrom​(String userId)
      • isConnected

        public boolean isConnected()
        Description copied from interface: User
        Indicates if the user is currently connected to Silverpeas.
        Specified by:
        isConnected in interface User
        Returns:
        true if the user is currently connected to Silverpeas, false otherwise.
      • isAnonymousUserExist

        public static boolean isAnonymousUserExist()
        Is the anonymous user exist in this running Silverpeas application?
        Returns:
        true if the anonymous user exist, false otherwise.
      • isAnonymousUser

        public static boolean isAnonymousUser​(String userId)
        Is the specified user is the anonymous one?
        Parameters:
        userId - the identifier of the user.
        Returns:
        true if the specified user is the anonymous one, false otherwise.
      • isFullyDefined

        public boolean isFullyDefined()
        Description copied from interface: User
        Indicates if the mandatory user data are defined.
        Specified by:
        isFullyDefined in interface User
        Returns:
        true if all mandatory are defined, false otherwise.
      • getDisplayedName

        public String getDisplayedName()
        Description copied from interface: User
        Default first name and last name concatenation.
        Specified by:
        getDisplayedName in interface User
        Returns:
        concatenation of first name and last name as string (without outer space).
      • getDurationOfCurrentSession

        public String getDurationOfCurrentSession()
        Description copied from interface: User
        Gets the duration of the current user session since its last registered login date.
        Specified by:
        getDurationOfCurrentSession in interface User
        Returns:
        the formatted duration of the current user session, or empty string if the user is not connected.
      • isUserManualNotificationUserReceiverLimit

        public boolean isUserManualNotificationUserReceiverLimit()
        Description copied from interface: User
        Indicates if a limitation exists about the number of receivers the user can notify manually.
        Specified by:
        isUserManualNotificationUserReceiverLimit in interface User
        Returns:
        true if the limitation exists, false otherwise.
      • getUserManualNotificationUserReceiverLimitValue

        public int getUserManualNotificationUserReceiverLimitValue()
        Description copied from interface: User
        Gets the maximum user receivers the user can notify manually.
        Specified by:
        getUserManualNotificationUserReceiverLimitValue in interface User
        Returns:
        the maximum user receivers the user can notify manually. If the value is not greater than 0, the user is not limited.
      • setUserManualNotificationUserReceiverLimit

        public void setUserManualNotificationUserReceiverLimit​(Integer limit)
        Sets the maximum user receivers the user can notify manually. If the given value is:
        • null or less than/equal to -1 or equal to the default server limitation value, then it is considered that the default server value will be taken into account
        • greater than or equal to 0, then the user has a specific limitation set
        The value is persisted only if the user has USER or GUEST access right and if the limitation is enabled at server level.
        Parameters:
        limit - the maximum user receivers the user can notify manually.
      • setNotifManualReceiverLimit

        public void setNotifManualReceiverLimit​(Integer notifManualReceiverLimit)
        Sets the maximum user receivers the user can notify manually from the persistence context.
        This method must only be used be the administration persistence services.
        Parameters:
        notifManualReceiverLimit - the maximum user receivers the user can notify manually from the persistence context.
      • getNotifManualReceiverLimit

        public Integer getNotifManualReceiverLimit()
      • getAnonymousUserId

        protected static String getAnonymousUserId()
        Gets the unique identifier of the anonymous user as set in the general look properties.
        Returns:
        the anonymous user identifier.