Class UserImpl

    • Method Detail

      • getId

        public long getId()
        Description copied from interface: User
        Returns user id
        Specified by:
        getId in interface User
        Returns:
        user id
      • getRealm

        public String getRealm()
        Description copied from interface: User
        Returns realm of the user.
        Specified by:
        getRealm in interface User
        Returns:
        realm of the user
      • getUsername

        public String getUsername()
        Description copied from interface: User
        Returns username of this user
        Specified by:
        getUsername in interface User
        Returns:
        username
      • getName

        public String getName()
        Description copied from interface: User
        Returns full name of this user
        Specified by:
        getName in interface User
        Returns:
        user full name
      • getEmail

        public String getEmail()
        Description copied from interface: User
        Returns e-mail of this user
        Specified by:
        getEmail in interface User
        Returns:
        email address
      • setEmailIsVerified

        public boolean setEmailIsVerified​(@NotNull
                                          String email)
        Description copied from interface: UserEx
        Mark user`s email as verified if it's equal to email passed in parameter.
        Specified by:
        setEmailIsVerified in interface UserEx
        Returns:
        true if verified email was set, false otherwise
      • getVerifiedEmail

        @Nullable
        public String getVerifiedEmail()
        Description copied from interface: UserEx
        Returns null if user doesn't have email specified or his email is not verified.
        Specified by:
        getVerifiedEmail in interface UserEx
      • getDescriptiveName

        public String getDescriptiveName()
        Description copied from interface: User
        Returns full name of the user if it is not empty, otherwise returns username.
        Specified by:
        getDescriptiveName in interface User
        Returns:
        full name or username if full name is empty
      • getExtendedName

        public String getExtendedName()
        Specified by:
        getExtendedName in interface User
        Returns:
        user full name and username in the form: <full name> (<username>)
      • getLastLoginTimestamp

        public Date getLastLoginTimestamp()
        Description copied from interface: User
        Returns this user last login timestamp
        Specified by:
        getLastLoginTimestamp in interface User
        Returns:
        last login timestamp
      • getVcsModifications

        @NotNull
        public List<SVcsModification> getVcsModifications​(int numberOfActiveDays)
        Description copied from interface: SUser
        Returns the list of changes made by this user filtered according to the caller's permissions.
        Specified by:
        getVcsModifications in interface SUser
        Parameters:
        numberOfActiveDays - number of last active days of changing
        Returns:
        unmodifiable list of user changes
      • getAllModifications

        @NotNull
        public List<SVcsModification> getAllModifications()
        Description copied from interface: SUser
        Returns the list of all (personal and non-personal) user modifications sorted by VCS date. Returns only modifications which have at least one related configuration.
        Specified by:
        getAllModifications in interface SUser
        Returns:
        see above
      • getPropertyValue

        public String getPropertyValue​(PropertyKey propertyKey)
        Description copied from interface: PropertyHolder
        Returns value of the property with specified key
        Specified by:
        getPropertyValue in interface PropertyHolder
        Parameters:
        propertyKey - value of the property with specified key
        Returns:
        value of the property with specified key
      • getBooleanProperty

        public boolean getBooleanProperty​(PropertyKey propertyKey)
        Description copied from interface: PropertyHolder
        Returns value of the boolean property
        Specified by:
        getBooleanProperty in interface PropertyHolder
        Parameters:
        propertyKey - property key
        Returns:
        value
      • hashCode

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

        public void init​(@NotNull
                         String username,
                         String name,
                         String email,
                         @Nullable
                         Long lastLogin,
                         boolean hasPassword)
        Specified by:
        init in interface UserEx
      • resetCachedProperties

        public void resetCachedProperties()
        Description copied from interface: UserEx
        Reset cached blocks
        Specified by:
        resetCachedProperties in interface UserEx
      • resetCachedVcsUsernames

        public void resetCachedVcsUsernames()
        Description copied from interface: UserEx
        Reset cached blocks
        Specified by:
        resetCachedVcsUsernames in interface UserEx
      • setProperties

        public boolean setProperties​(@NotNull
                                     Map<? extends PropertyKey,​String> properties)
        Description copied from interface: SPropertyHolder
        Updates the specified properties. Only those properties will be updated which keys are specified in the properties map. All other properties will be left intact.
        Specified by:
        setProperties in interface SPropertyHolder
        Parameters:
        properties - properties
        Returns:
        true if at least one property was changed, false otherwise
      • setProperty

        public boolean setProperty​(@NotNull
                                   PropertyKey propertyKey,
                                   String value)
        Description copied from interface: SPropertyHolder
        Sets a property with specified key and value.
        Specified by:
        setProperty in interface SPropertyHolder
        Parameters:
        propertyKey - property key
        value - value of the property
        Returns:
        true if the property value was actually changed, false otherwise
      • deleteProperty

        public boolean deleteProperty​(@NotNull
                                      PropertyKey propertyKey)
        Description copied from interface: SPropertyHolder
        Deletes a property with specified key.
        Specified by:
        deleteProperty in interface SPropertyHolder
        Parameters:
        propertyKey - property key
        Returns:
        true if the property was actually deleted, false otherwise
      • setUserProperties

        public void setUserProperties​(@NotNull
                                      Map<? extends PropertyKey,​String> properties)
                               throws UserNotFoundException
        Description copied from interface: SUser
        Updates properties of the user specified by user id. Only those properties will be updated which keys are specified in the properties map. All other properties will be left intact.
        Specified by:
        setUserProperties in interface SUser
        Parameters:
        properties - properties
        Throws:
        UserNotFoundException - if specified user no longer exists
      • setAttribute

        public void setAttribute​(@NotNull
                                 String attributeKey,
                                 @NotNull
                                 String attributeValue)
        Description copied from interface: UserEx
        Set user attribute
        Specified by:
        setAttribute in interface UserEx
      • getAttribute

        @Nullable
        public String getAttribute​(@NotNull
                                   String attributeKey)
        Description copied from interface: UserEx
        Get user attribute
        Specified by:
        getAttribute in interface UserEx
        Returns:
        user attribute or null if there is no attribute with such key
      • getAttributes

        @NotNull
        public Map<String,​String> getAttributes()
        Description copied from interface: UserEx
        Get all user attributes
        Specified by:
        getAttributes in interface UserEx
        Returns:
        user attributes or an empty map
      • deleteAttribute

        public void deleteAttribute​(@NotNull
                                    String attributeKey)
        Description copied from interface: UserEx
        Delete user attribute
        Specified by:
        deleteAttribute in interface UserEx
      • resetCachedAttributes

        public void resetCachedAttributes()
        Description copied from interface: UserEx
        Reset cached user attributes
        Specified by:
        resetCachedAttributes in interface UserEx
      • hasPassword

        public boolean hasPassword()
        Description copied from interface: UserEx
        Returns true if user has password, false otherwise (e.g. if it was created by NT domain or LDAP login module)
        Specified by:
        hasPassword in interface UserEx
        Returns:
      • removeRole

        public void removeRole​(@NotNull
                               Role role)
        Description copied from interface: RolesHolder
        Removes specified role. If the role is associated with several scopes all of these roles will be removed.
        Specified by:
        removeRole in interface RolesHolder
        Overrides:
        removeRole in class BaseUser
        Parameters:
        role - role to remove
      • isHighlightRelatedDataInUI

        public boolean isHighlightRelatedDataInUI()
        Description copied from interface: SUser
        Returns true if highlighting of user changes, investigations, and other related data in web UI is enabled. The value is controlled by the StandardProperties.HIGHLIGHT_MY_CHANGES property.
        Specified by:
        isHighlightRelatedDataInUI in interface SUser
        Returns:
        true if highlighting of user changes, investigations, and other related data in web UI is enabled.
      • isGuest

        public boolean isGuest()
        Description copied from interface: SUser
        Returns true if the user is guest
        Specified by:
        isGuest in interface SUser
      • setBlockState

        public void setBlockState​(String blockType,
                                  String blockState)
        Description copied from interface: SUser
        Stores collapsable block state for this user
        Specified by:
        setBlockState in interface SUser
        Overrides:
        setBlockState in class BaseUser
        Parameters:
        blockType - type of block
        blockState - state
      • setCreationInProgress

        public void setCreationInProgress​(boolean inProgress)
        Specified by:
        setCreationInProgress in interface UserEx
      • getVisibleProjects

        @NotNull
        public List<String> getVisibleProjects()
        Description copied from interface: User
        Computes list of visible projects sorted according to the order specified by user.
        Specified by:
        getVisibleProjects in interface User
        Returns:
        list of visible projects ids
      • getAllProjects

        @NotNull
        public List<String> getAllProjects()
        Description copied from interface: User
        Returns all projects sorted according to the order specified by user.
        Specified by:
        getAllProjects in interface User
        Returns:
        list of all of the projects ids
      • getProjectsOrder

        @NotNull
        public List<String> getProjectsOrder()
        Specified by:
        getProjectsOrder in interface SUser
        Returns:
        List of project internal IDs in configured order. Empty list will be returned in case user didn't configure any order.
      • setProjectsOrder

        public void setProjectsOrder​(@NotNull
                                     List<String> projectsOrder)
        Description copied from interface: SUser
        Sets order of the projects.
        Specified by:
        setProjectsOrder in interface SUser
        Parameters:
        projectsOrder - identificators of all projects in the order specified by user
      • setVisibleProjects

        public void setVisibleProjects​(@NotNull
                                       Collection<String> visibleProjects)
        Description copied from interface: SUser
        Sets projects visible for specified user
        Specified by:
        setVisibleProjects in interface SUser
        Parameters:
        visibleProjects - collection of identifiers of visible projects
      • hideProject

        public void hideProject​(@NotNull
                                String projectId)
        Description copied from interface: SUser
        Marks a project with specified id as invisible
        Specified by:
        hideProject in interface SUser
        Parameters:
        projectId - id of the project
      • isHasHiddenProjects

        public boolean isHasHiddenProjects()
        Description copied from interface: UserEx
        Returns whether the user has any hidden (i.e. configured to be not-visible) projects.
        Specified by:
        isHasHiddenProjects in interface UserEx
        Returns:
        true if the user has any hidden projects
      • isConfiguredVisibleProjects

        public boolean isConfiguredVisibleProjects()
        Description copied from interface: UserEx
        Returns whether the user has configured visible projects.
        Specified by:
        isConfiguredVisibleProjects in interface UserEx
        Returns:
        true if the user has configured visible projects
      • getFilteredVisibleBuildTypes

        @NotNull
        public SortedMap<SProject,​List<SBuildType>> getFilteredVisibleBuildTypes​(@Nullable
                                                                                       BuildTypeFilter filter)
        Description copied from interface: UserEx
        Returns sorted map of build configurations per project. The build configurations are sorted according to user settings.
        Specified by:
        getFilteredVisibleBuildTypes in interface UserEx
        Parameters:
        filter - filter of build configurations, can be null
        Returns:
        sorted map of build types per project
      • getOrderedBuildTypes

        @NotNull
        public List<SBuildType> getOrderedBuildTypes​(@Nullable
                                                     SProject project)
        Description copied from interface: SUser
        Returns the list of build configurations (in a project, or globally) sorted according to user settings. The configurations invisible for the user are omitted.
        Specified by:
        getOrderedBuildTypes in interface SUser
        Parameters:
        project - the project (can be null)
        Returns:
        the list of build configurations
      • setBuildTypesOrder

        public void setBuildTypesOrder​(@NotNull
                                       SProject project,
                                       @NotNull
                                       List<SBuildType> visible,
                                       @NotNull
                                       List<SBuildType> invisible)
        Description copied from interface: SUser
        Sets visible and invisible build types for the given project in the specified order.
        Specified by:
        setBuildTypesOrder in interface SUser
        Parameters:
        project - the project
        visible - the list of visible build types
        invisible - the list of invisible build types
      • getBuildTypesOrder

        @NotNull
        public Collection<SBuildType> getBuildTypesOrder​(@NotNull
                                                         SProject project)
        Specified by:
        getBuildTypesOrder in interface SUser
        Parameters:
        project - the project
        Returns:
        List of build configurations in configured order. Empty list will be returned in case user didn't configure any order.
      • resetBuildTypesOrder

        public void resetBuildTypesOrder​(@NotNull
                                         SProject project)
        Description copied from interface: UserEx
        Resets the build types order settings to defaults.
        Specified by:
        resetBuildTypesOrder in interface UserEx
        Parameters:
        project - the project