Class AllUsersGroup
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.Proxyfied<UserGroupEx>
-
- jetbrains.buildServer.groups.impl.UserGroupImpl
-
- jetbrains.buildServer.groups.impl.AllUsersGroup
-
- All Implemented Interfaces:
Comparable<UserGroup>
,SUserGroup
,UserGroup
,UserGroupEx
,Loggable
,NotificationRulesHolder
,AuthorityHolder
,RolesHolder
,RolesHolderEx
,PropertyHolder
,SPropertyHolder
public class AllUsersGroup extends UserGroupImpl
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUser(User user)
Users.void
cleanupGroup()
Removes from the group users, which were removed on the serverboolean
containsUserDirectly(User user)
List<User>
getAllUsers()
Returns the set of all users included into this group, directly or through subgroups.List<User>
getDirectUsers()
Returns the collection of users included into this group.int
getUsersNumber()
Returns the number of (direct) users in this group.boolean
isAllUsersGroup()
Returns true, if the specified group is the all-users group.void
removeUser(User user)
Removes a user from this group.void
setDescription(String description)
Sets the group description.void
setName(String name)
Sets the group name.void
updateInfo()
Reload main group info (name and description) from the databasevoid
updateUsers()
Reload group users from the database-
Methods inherited from class jetbrains.buildServer.groups.impl.UserGroupImpl
addNewRule, addParent, addRole, addSubgroup, addSubgroups, applyOrder, calculatePermissions, compareTo, deleteGroupProperty, deleteProperty, describe, dispose, equals, findConflictingRules, findRuleById, getAllParentHolders, getAllParentRulesHolders, getAllPermissions, getAllSubgroups, getAssociatedUser, getBooleanProperty, getDescription, getDirectSubgroups, getGlobalPermissions, getKey, getName, getNotificationRules, getParentGroups, getParentHolders, getParentRulesHolders, getPermissionsGrantedForAllProjects, getPermissionsGrantedForAnyOfProjects, getPermissionsGrantedForProject, getProjectsPermissions, getProperties, getPropertyValue, getRoles, getRolesWithScope, getScopes, getUnfilteredRoles, getUnfilteredScopes, hasAllPermissionsOf, hashCode, hasParents, isPermissionGrantedForAllProjects, isPermissionGrantedForAnyOfProjects, isPermissionGrantedForAnyProject, isPermissionGrantedForProject, isPermissionGrantedGlobally, isSystemAdministratorRoleGranted, isSystemAdministratorRoleGrantedDirectly, isSystemAdministratorRoleInherited, removeParent, removeRole, removeRole, removeRoles, removeRule, removeRule, removeSubgroup, resetRoles, setGroupProperties, setGroupProperty, setNotificationRules, setProperties, setProperty, toString, updateProperties, updateRoles, updateSubgroups
-
-
-
-
Method Detail
-
setName
public void setName(@NotNull String name) throws UserGroupException
Description copied from interface:SUserGroup
Sets the group name.Note: group name must be unique among all user groups. If
name
already exists, an exception is thrown.The name cannot be empty and cannot exceed 255 characters.
- Specified by:
setName
in interfaceSUserGroup
- Overrides:
setName
in classUserGroupImpl
- Parameters:
name
- the new group name- Throws:
UserGroupException
- if name already exists, or is empty, or is too long- See Also:
UserGroup.getName()
-
setDescription
public void setDescription(@NotNull String description) throws UserGroupException
Description copied from interface:SUserGroup
Sets the group description.The description cannot exceed 2000 characters.
- Specified by:
setDescription
in interfaceSUserGroup
- Overrides:
setDescription
in classUserGroupImpl
- Parameters:
description
- the new description- Throws:
UserGroupException
- if description is too long- See Also:
UserGroup.getDescription()
-
getDirectUsers
@NotNull public List<User> getDirectUsers()
Description copied from interface:UserGroup
Returns the collection of users included into this group. This method ignores the subgroups.- Specified by:
getDirectUsers
in interfaceUserGroup
- Overrides:
getDirectUsers
in classUserGroupImpl
- Returns:
- list of users
- See Also:
UserGroup.getAllUsers()
-
getAllUsers
@NotNull public List<User> getAllUsers()
Description copied from interface:UserGroup
Returns the set of all users included into this group, directly or through subgroups.- Specified by:
getAllUsers
in interfaceUserGroup
- Overrides:
getAllUsers
in classUserGroupImpl
- Returns:
- list of all users
- See Also:
UserGroup.getDirectUsers()
-
containsUserDirectly
public boolean containsUserDirectly(@NotNull User user)
- Specified by:
containsUserDirectly
in interfaceUserGroup
- Overrides:
containsUserDirectly
in classUserGroupImpl
- Parameters:
user
- user to check- Returns:
- true if this group contains user directly (user is returned by getDirectUsers)
-
getUsersNumber
public int getUsersNumber()
Description copied from interface:UserGroupEx
Returns the number of (direct) users in this group. Much more effective thangetDirectUsers().size()
.- Specified by:
getUsersNumber
in interfaceUserGroupEx
- Overrides:
getUsersNumber
in classUserGroupImpl
- Returns:
- the number of users in the group
-
addUser
public void addUser(@NotNull User user)
Description copied from class:UserGroupImpl
Users.- Specified by:
addUser
in interfaceSUserGroup
- Overrides:
addUser
in classUserGroupImpl
- Parameters:
user
- the user to add
-
removeUser
public void removeUser(@NotNull User user) throws UserGroupException
Description copied from interface:SUserGroup
Removes a user from this group. Does nothing if the user is not included into this group directly.The user isn't allowed to remove himself from any group.
- Specified by:
removeUser
in interfaceSUserGroup
- Overrides:
removeUser
in classUserGroupImpl
- Parameters:
user
- a user to remove- Throws:
UserGroupException
- if user is the authority holder, trying to remove himself
-
isAllUsersGroup
public boolean isAllUsersGroup()
Description copied from interface:UserGroupEx
Returns true, if the specified group is the all-users group.- Specified by:
isAllUsersGroup
in interfaceUserGroupEx
- Overrides:
isAllUsersGroup
in classUserGroupImpl
- Returns:
- true if the specified group is the all-users group, false otherwise
-
updateInfo
public void updateInfo()
Description copied from interface:UserGroupEx
Reload main group info (name and description) from the database- Specified by:
updateInfo
in interfaceUserGroupEx
- Overrides:
updateInfo
in classUserGroupImpl
-
updateUsers
public void updateUsers()
Description copied from interface:UserGroupEx
Reload group users from the database- Specified by:
updateUsers
in interfaceUserGroupEx
- Overrides:
updateUsers
in classUserGroupImpl
-
cleanupGroup
public void cleanupGroup()
Description copied from interface:UserGroupEx
Removes from the group users, which were removed on the server- Specified by:
cleanupGroup
in interfaceUserGroupEx
- Overrides:
cleanupGroup
in classUserGroupImpl
-
-