Class SimpleUserData

  • All Implemented Interfaces:
    jetbrains.buildServer.log.Loggable, AuthorityHolder, PropertyHolder, User
    Direct Known Subclasses:
    UserData

    public class SimpleUserData
    extends java.lang.Object
    implements User
    This class contains main information to be sent via XmlRpc to remote client about TeamCity user
    • Constructor Detail

      • SimpleUserData

        public SimpleUserData​(long id,
                              java.lang.String username,
                              java.lang.String name)
    • 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 java.lang.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 java.lang.String getUsername()
        Description copied from interface: User
        Returns username of this user
        Specified by:
        getUsername in interface User
        Returns:
        username
      • getName

        public java.lang.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 java.lang.String getEmail()
        Description copied from interface: User
        Returns e-mail of this user
        Specified by:
        getEmail in interface User
        Returns:
        email address
      • getDescriptiveName

        public java.lang.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 java.lang.String getExtendedName()
        Specified by:
        getExtendedName in interface User
        Returns:
        user full name and username in the form: <full name> (<username>)
      • getLastLoginTimestamp

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

        public java.lang.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
      • getProperties

        @NotNull
        public java.util.Map<PropertyKey,​java.lang.String> getProperties()
        Description copied from interface: PropertyHolder
        Returns map of the properties
        Specified by:
        getProperties in interface PropertyHolder
        Returns:
        map of the properties
      • getVisibleProjects

        public java.util.List<java.lang.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

        public java.util.List<java.lang.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
      • isPermissionGrantedGlobally

        public boolean isPermissionGrantedGlobally​(@NotNull
                                                   Permission permission)
        Description copied from interface: AuthorityHolder
        Returns true if specified permission granted globally (i.e. not associated with any particular object)
        Specified by:
        isPermissionGrantedGlobally in interface AuthorityHolder
        Parameters:
        permission - permission to check
        Returns:
        true or false
      • getGlobalPermissions

        @NotNull
        public Permissions getGlobalPermissions()
        Description copied from interface: AuthorityHolder
        Returns all granted non-project related permissions and all project-related permissions granted globally
        Specified by:
        getGlobalPermissions in interface AuthorityHolder
        Returns:
        see above
      • getProjectsPermissions

        @NotNull
        public java.util.Map<java.lang.String,​Permissions> getProjectsPermissions()
        Description copied from interface: AuthorityHolder
        Returns map of project-related permissions that were granted for a particular project. Project internal id is used as the key.
        Specified by:
        getProjectsPermissions in interface AuthorityHolder
        Returns:
        map of project permissions
      • isPermissionGrantedForProject

        public boolean isPermissionGrantedForProject​(@NotNull
                                                     java.lang.String projectId,
                                                     @NotNull
                                                     Permission permission)
        Description copied from interface: AuthorityHolder
        Returns true if permission is granted for a project, i.e. the result is true if there is a project related permission granted globally or for specified project
        Specified by:
        isPermissionGrantedForProject in interface AuthorityHolder
        Parameters:
        projectId - project internal id
        permission - permission to check
        Returns:
        see above
      • isPermissionGrantedForAnyProject

        public boolean isPermissionGrantedForAnyProject​(@NotNull
                                                        Permission permission)
        Description copied from interface: AuthorityHolder
        Returns true if specified permission is granted for at least one project
        Specified by:
        isPermissionGrantedForAnyProject in interface AuthorityHolder
        Parameters:
        permission - permission to check
        Returns:
        see above
      • isPermissionGrantedForAnyOfProjects

        public boolean isPermissionGrantedForAnyOfProjects​(@NotNull
                                                           java.util.Collection<java.lang.String> projectIds,
                                                           @NotNull
                                                           Permission permission)
        Description copied from interface: AuthorityHolder
        Returns true if specified permission is granted for at least one project from the given collection
        Specified by:
        isPermissionGrantedForAnyOfProjects in interface AuthorityHolder
        permission - permission to check
        Returns:
        see above
      • getPermissionsGrantedForProject

        @NotNull
        public Permissions getPermissionsGrantedForProject​(@NotNull
                                                           java.lang.String projectId)
        Description copied from interface: AuthorityHolder
        Returns all permissions granted for particular project. These include permissions granted specifically for the specified project and granted global project-related permissions (i.e. permissions supporting project association Permission.isProjectAssociationSupported()).
        Specified by:
        getPermissionsGrantedForProject in interface AuthorityHolder
        Parameters:
        projectId - project internal id
        Returns:
        all granted permissions for particular project
      • getPermissionsGrantedForAllProjects

        @NotNull
        public Permissions getPermissionsGrantedForAllProjects​(@NotNull
                                                               java.util.Collection<java.lang.String> projectIds)
        Description copied from interface: AuthorityHolder
        Returns all permissions granted for all projects from the collection. These include permissions granted specifically for the specified projects and granted global project-related permissions (i.e. permissions supporting project association Permission.isProjectAssociationSupported()).
        Specified by:
        getPermissionsGrantedForAllProjects in interface AuthorityHolder
        Parameters:
        projectIds - collection of project internal ids
        Returns:
        all granted permissions for all projects
      • getPermissionsGrantedForAnyOfProjects

        @NotNull
        public Permissions getPermissionsGrantedForAnyOfProjects​(@NotNull
                                                                 java.util.Collection<java.lang.String> projectIds)
        Description copied from interface: AuthorityHolder
        Returns union of permissions granted for projects from the collection. These include permissions granted specifically for the specified projects and granted global project-related permissions (i.e. permissions supporting project association Permission.isProjectAssociationSupported()).
        Specified by:
        getPermissionsGrantedForAnyOfProjects in interface AuthorityHolder
        Parameters:
        projectIds - collection of project internal ids
        Returns:
        all granted permissions for all projects
      • getAssociatedUser

        @Nullable
        public User getAssociatedUser()
        Description copied from interface: AuthorityHolder
        Returns the user object associated with the principal.
        Specified by:
        getAssociatedUser in interface AuthorityHolder
        Returns:
        may be null if the authority holder is not a user.
      • hasAllPermissionsOf

        public boolean hasAllPermissionsOf​(@NotNull
                                           AuthorityHolder authorityHolder)
        Description copied from interface: AuthorityHolder
        Returns true if this authority holder has all permissions of another authority holder.
        Specified by:
        hasAllPermissionsOf in interface AuthorityHolder
        Returns:
        see above
      • createSimpleUserDataOn

        @NotNull
        public static SimpleUserData createSimpleUserDataOn​(@NotNull
                                                            User user)
      • equals

        public boolean equals​(java.lang.Object that)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • describe

        @NotNull
        public java.lang.String describe​(boolean verbose)
        Specified by:
        describe in interface jetbrains.buildServer.log.Loggable