Package jetbrains.buildServer.users
Class SimpleUserData
- java.lang.Object
-
- jetbrains.buildServer.users.SimpleUserData
-
- All Implemented Interfaces:
Loggable,AuthorityHolder,PropertyHolder,User
- Direct Known Subclasses:
UserData
public class SimpleUserData extends 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, String username, String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SimpleUserDatacreateSimpleUserDataOn(User user)Stringdescribe(boolean verbose)booleanequals(Object that)List<String>getAllProjects()Returns all projects sorted according to the order specified by user.UsergetAssociatedUser()Returns the user object associated with the principal.booleangetBooleanProperty(PropertyKey propertyKey)Returns value of the boolean propertyStringgetDescriptiveName()Returns full name of the user if it is not empty, otherwise returns username.StringgetEmail()Returns e-mail of this userStringgetExtendedName()PermissionsgetGlobalPermissions()Returns all granted non-project related permissions and all project-related permissions granted globallylonggetId()Returns user idDategetLastLoginTimestamp()Returns this user last login timestampStringgetName()Returns full name of this userPermissionsgetPermissionsGrantedForAllProjects(Collection<String> projectIds)Returns all permissions granted for all projects from the collection.PermissionsgetPermissionsGrantedForAnyOfProjects(Collection<String> projectIds)Returns union of permissions granted for projects from the collection.PermissionsgetPermissionsGrantedForProject(String projectId)Returns all permissions granted for particular project.Map<String,Permissions>getProjectsPermissions()Returns map of project-related permissions that were granted for a particular project.Map<PropertyKey,String>getProperties()Returns map of the propertiesStringgetPropertyValue(PropertyKey propertyKey)Returns value of the property with specified keyStringgetRealm()Returns realm of the user.StringgetUsername()Returns username of this userList<String>getVisibleProjects()Computes list of visible projects sorted according to the order specified by user.booleanhasAllPermissionsOf(AuthorityHolder authorityHolder)Returns true if this authority holder has all permissions of another authority holder.inthashCode()booleanisPermissionGrantedForAllProjects(Collection<String> projectIds, Permission permission)Returns true if permission is granted for all projects from the given list.booleanisPermissionGrantedForAnyOfProjects(Collection<String> projectIds, Permission permission)Returns true if specified permission is granted for at least one project from the given collectionbooleanisPermissionGrantedForAnyProject(Permission permission)Returns true if specified permission is granted for at least one projectbooleanisPermissionGrantedForProject(String projectId, Permission permission)Returns true if permission is granted for a project, i.e.booleanisPermissionGrantedGlobally(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:UserReturns user id
-
getRealm
public String getRealm()
Description copied from interface:UserReturns realm of the user.
-
getUsername
public String getUsername()
Description copied from interface:UserReturns username of this user- Specified by:
getUsernamein interfaceUser- Returns:
- username
-
getName
public String getName()
Description copied from interface:UserReturns full name of this user
-
getEmail
public String getEmail()
Description copied from interface:UserReturns e-mail of this user
-
getDescriptiveName
public String getDescriptiveName()
Description copied from interface:UserReturns full name of the user if it is not empty, otherwise returns username.- Specified by:
getDescriptiveNamein interfaceUser- Returns:
- full name or username if full name is empty
-
getExtendedName
public String getExtendedName()
- Specified by:
getExtendedNamein interfaceUser- Returns:
- user full name and username in the form: <full name> (<username>)
-
getLastLoginTimestamp
public Date getLastLoginTimestamp()
Description copied from interface:UserReturns this user last login timestamp- Specified by:
getLastLoginTimestampin interfaceUser- Returns:
- last login timestamp
-
getPropertyValue
public String getPropertyValue(PropertyKey propertyKey)
Description copied from interface:PropertyHolderReturns value of the property with specified key- Specified by:
getPropertyValuein 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:PropertyHolderReturns value of the boolean property- Specified by:
getBooleanPropertyin interfacePropertyHolder- Parameters:
propertyKey- property key- Returns:
- value
-
getProperties
@NotNull public Map<PropertyKey,String> getProperties()
Description copied from interface:PropertyHolderReturns map of the properties- Specified by:
getPropertiesin interfacePropertyHolder- Returns:
- map of the properties
-
getVisibleProjects
public List<String> getVisibleProjects()
Description copied from interface:UserComputes list of visible projects sorted according to the order specified by user.- Specified by:
getVisibleProjectsin interfaceUser- Returns:
- list of visible projects ids
-
getAllProjects
public List<String> getAllProjects()
Description copied from interface:UserReturns all projects sorted according to the order specified by user.- Specified by:
getAllProjectsin interfaceUser- Returns:
- list of all of the projects ids
-
isPermissionGrantedGlobally
public boolean isPermissionGrantedGlobally(@NotNull Permission permission)Description copied from interface:AuthorityHolderReturns true if specified permission granted globally (i.e. not associated with any particular object)- Specified by:
isPermissionGrantedGloballyin interfaceAuthorityHolder- Parameters:
permission- permission to check- Returns:
- true or false
-
getGlobalPermissions
@NotNull public Permissions getGlobalPermissions()
Description copied from interface:AuthorityHolderReturns all granted non-project related permissions and all project-related permissions granted globally- Specified by:
getGlobalPermissionsin interfaceAuthorityHolder- Returns:
- see above
-
getProjectsPermissions
@NotNull public Map<String,Permissions> getProjectsPermissions()
Description copied from interface:AuthorityHolderReturns map of project-related permissions that were granted for a particular project. Project internal id is used as the key.- Specified by:
getProjectsPermissionsin interfaceAuthorityHolder- Returns:
- map of project permissions
-
isPermissionGrantedForProject
public boolean isPermissionGrantedForProject(@NotNull String projectId, @NotNull Permission permission)Description copied from interface:AuthorityHolderReturns 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:
isPermissionGrantedForProjectin interfaceAuthorityHolder- Parameters:
projectId- project internal idpermission- permission to check- Returns:
- see above
-
isPermissionGrantedForAllProjects
public boolean isPermissionGrantedForAllProjects(@NotNull Collection<String> projectIds, @NotNull Permission permission)Description copied from interface:AuthorityHolderReturns true if permission is granted for all projects from the given list. Returns false if projectIds is empty.- Specified by:
isPermissionGrantedForAllProjectsin 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:AuthorityHolderReturns true if specified permission is granted for at least one project- Specified by:
isPermissionGrantedForAnyProjectin interfaceAuthorityHolder- Parameters:
permission- permission to check- Returns:
- see above
-
isPermissionGrantedForAnyOfProjects
public boolean isPermissionGrantedForAnyOfProjects(@NotNull Collection<String> projectIds, @NotNull Permission permission)Description copied from interface:AuthorityHolderReturns true if specified permission is granted for at least one project from the given collection- Specified by:
isPermissionGrantedForAnyOfProjectsin interfaceAuthorityHolderpermission- permission to check- Returns:
- see above
-
getPermissionsGrantedForProject
@NotNull public Permissions getPermissionsGrantedForProject(@NotNull String projectId)
Description copied from interface:AuthorityHolderReturns 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:
getPermissionsGrantedForProjectin interfaceAuthorityHolder- Parameters:
projectId- project internal id- Returns:
- all granted permissions for particular project
-
getPermissionsGrantedForAllProjects
@NotNull public Permissions getPermissionsGrantedForAllProjects(@NotNull Collection<String> projectIds)
Description copied from interface:AuthorityHolderReturns 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:
getPermissionsGrantedForAllProjectsin interfaceAuthorityHolder- Parameters:
projectIds- collection of project internal ids- Returns:
- all granted permissions for all projects
-
getPermissionsGrantedForAnyOfProjects
@NotNull public Permissions getPermissionsGrantedForAnyOfProjects(@NotNull Collection<String> projectIds)
Description copied from interface:AuthorityHolderReturns 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:
getPermissionsGrantedForAnyOfProjectsin interfaceAuthorityHolder- Parameters:
projectIds- collection of project internal ids- Returns:
- all granted permissions for all projects
-
getAssociatedUser
@Nullable public User getAssociatedUser()
Description copied from interface:AuthorityHolderReturns the user object associated with the principal.- Specified by:
getAssociatedUserin interfaceAuthorityHolder- Returns:
- may be null if the authority holder is not a user.
-
hasAllPermissionsOf
public boolean hasAllPermissionsOf(@NotNull AuthorityHolder authorityHolder)Description copied from interface:AuthorityHolderReturns true if this authority holder has all permissions of another authority holder.- Specified by:
hasAllPermissionsOfin interfaceAuthorityHolder- Returns:
- see above
-
createSimpleUserDataOn
@NotNull public static SimpleUserData createSimpleUserDataOn(@NotNull User user)
-
-