Package jetbrains.buildServer.users
Class SimpleUserData
- java.lang.Object
-
- jetbrains.buildServer.users.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 Summary
Constructors Constructor Description SimpleUserData(long id, java.lang.String username, java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SimpleUserData
createSimpleUserDataOn(User user)
java.lang.String
describe(boolean verbose)
boolean
equals(java.lang.Object that)
java.util.List<java.lang.String>
getAllProjects()
Returns all projects sorted according to the order specified by user.User
getAssociatedUser()
Returns the user object associated with the principal.boolean
getBooleanProperty(PropertyKey propertyKey)
Returns value of the boolean propertyjava.lang.String
getDescriptiveName()
Returns full name of the user if it is not empty, otherwise returns username.java.lang.String
getEmail()
Returns e-mail of this userjava.lang.String
getExtendedName()
Permissions
getGlobalPermissions()
Returns all granted non-project related permissions and all project-related permissions granted globallylong
getId()
Returns user idjava.util.Date
getLastLoginTimestamp()
Returns this user last login timestampjava.lang.String
getName()
Returns full name of this userPermissions
getPermissionsGrantedForAllProjects(java.util.Collection<java.lang.String> projectIds)
Returns all permissions granted for all projects from the collection.Permissions
getPermissionsGrantedForAnyOfProjects(java.util.Collection<java.lang.String> projectIds)
Returns union of permissions granted for projects from the collection.Permissions
getPermissionsGrantedForProject(java.lang.String projectId)
Returns all permissions granted for particular project.java.util.Map<java.lang.String,Permissions>
getProjectsPermissions()
Returns map of project-related permissions that were granted for a particular project.java.util.Map<PropertyKey,java.lang.String>
getProperties()
Returns map of the propertiesjava.lang.String
getPropertyValue(PropertyKey propertyKey)
Returns value of the property with specified keyjava.lang.String
getRealm()
Returns realm of the user.java.lang.String
getUsername()
Returns username of this userjava.util.List<java.lang.String>
getVisibleProjects()
Computes list of visible projects sorted according to the order specified by user.boolean
hasAllPermissionsOf(AuthorityHolder authorityHolder)
Returns true if this authority holder has all permissions of another authority holder.int
hashCode()
boolean
isPermissionGrantedForAllProjects(java.util.Collection<java.lang.String> projectIds, Permission permission)
Returns true if permission is granted for all projects from the given list.boolean
isPermissionGrantedForAnyOfProjects(java.util.Collection<java.lang.String> projectIds, Permission permission)
Returns true if specified permission is granted for at least one project from the given collectionboolean
isPermissionGrantedForAnyProject(Permission permission)
Returns true if specified permission is granted for at least one projectboolean
isPermissionGrantedForProject(java.lang.String projectId, Permission permission)
Returns true if permission is granted for a project, i.e.boolean
isPermissionGrantedGlobally(Permission permission)
Returns true if specified permission granted globally (i.e.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.auth.AuthorityHolder
getAllPermissions
-
-
-
-
Method Detail
-
getId
public long getId()
Description copied from interface:User
Returns user id
-
getRealm
public java.lang.String getRealm()
Description copied from 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 interfaceUser
- Returns:
- username
-
getName
public java.lang.String getName()
Description copied from interface:User
Returns full name of this user
-
getEmail
public java.lang.String getEmail()
Description copied from interface:User
Returns e-mail of this user
-
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 interfaceUser
- Returns:
- full name or username if full name is empty
-
getExtendedName
public java.lang.String getExtendedName()
- Specified by:
getExtendedName
in interfaceUser
- 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 interfaceUser
- 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 interfacePropertyHolder
- 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 interfacePropertyHolder
- 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 interfacePropertyHolder
- 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 interfaceUser
- 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 interfaceUser
- 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 interfaceAuthorityHolder
- 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 interfaceAuthorityHolder
- 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 interfaceAuthorityHolder
- 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 interfaceAuthorityHolder
- Parameters:
projectId
- project internal idpermission
- permission to check- Returns:
- see above
-
isPermissionGrantedForAllProjects
public boolean isPermissionGrantedForAllProjects(@NotNull java.util.Collection<java.lang.String> projectIds, @NotNull Permission permission)
Description copied from interface:AuthorityHolder
Returns true if permission is granted for all projects from the given list. Returns false if projectIds is empty.- Specified by:
isPermissionGrantedForAllProjects
in interfaceAuthorityHolder
- Parameters:
projectIds
- collection of project idspermission
- permission to check @return see above- See Also:
AuthorityHolder.isPermissionGrantedForProject(java.lang.String, jetbrains.buildServer.serverSide.auth.Permission)
-
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 interfaceAuthorityHolder
- 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 interfaceAuthorityHolder
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 associationPermission.isProjectAssociationSupported()
).- Specified by:
getPermissionsGrantedForProject
in interfaceAuthorityHolder
- 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 associationPermission.isProjectAssociationSupported()
).- Specified by:
getPermissionsGrantedForAllProjects
in interfaceAuthorityHolder
- 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 associationPermission.isProjectAssociationSupported()
).- Specified by:
getPermissionsGrantedForAnyOfProjects
in interfaceAuthorityHolder
- 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 interfaceAuthorityHolder
- 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 interfaceAuthorityHolder
- Returns:
- see above
-
createSimpleUserDataOn
@NotNull public static SimpleUserData createSimpleUserDataOn(@NotNull User user)
-
equals
public boolean equals(java.lang.Object that)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
describe
@NotNull public java.lang.String describe(boolean verbose)
- Specified by:
describe
in interfacejetbrains.buildServer.log.Loggable
-
-