public interface UserGroupManager
Modifier and Type | Field and Description |
---|---|
static int |
MAX_GROUP_KEY_LENGTH
Maximum length of the group key.
|
Modifier and Type | Method and Description |
---|---|
void |
addUserGroupListener(UserGroupListener listener)
Adds the specified listener to the manager's list.
|
SUserGroup |
createUserGroup(java.lang.String key,
java.lang.String name,
java.lang.String description)
Creates a new user group.
|
void |
deleteUserGroup(SUserGroup group)
Deletes a user group.
|
SUserGroup |
findUserGroupByKey(java.lang.String key)
Given a group key method finds the corresponding user group.
|
SUserGroup |
findUserGroupByName(java.lang.String name)
Given a group name method finds the corresponding user group.
|
java.util.Set<SUserGroup> |
findUserGroupsByPropertyValue(PropertyKey propertyKey,
java.lang.String propertyValue,
boolean caseSensitive)
Returns set of the user groups having specified property.
|
java.util.List<UserGroup> |
getAllHostGroupsOf(User user)
Returns topologically ordered list of all groups containing specified user,
directly or through intermediate subgroups.
|
SUserGroup |
getAllUsersGroup()
Returns the all-users group.
|
java.util.List<UserGroup> |
getHostGroupsOf(User user)
Returns the list of groups that host specified user (directly).
|
java.util.Collection<SUserGroup> |
getRootUserGroups()
Returns the collection of root user groups, i.e.
|
java.util.Collection<SUserGroup> |
getUserGroups()
Returns the collection of all user groups.
|
boolean |
isAllUsersGroup(SUserGroup group)
Returns true, if the specified group is the all-users group.
|
void |
removeUserGroupListener(UserGroupListener listener)
Removes the listener from the manager's list.
|
void |
renameUserGroup(java.lang.String key,
java.lang.String name)
Renames a user group.
|
static final int MAX_GROUP_KEY_LENGTH
@NotNull SUserGroup createUserGroup(@NotNull java.lang.String key, @NotNull java.lang.String name, @NotNull java.lang.String description) throws UserGroupException
The key
is specified by user, but must be unique among all user groups.
An attempt to create a user group with existing key results in exception.
The name
must be unique too. Similarly, in case of duplication an exception
is thrown.
key
- user group keyname
- user group namedescription
- user group descriptionUserGroupException
- if specified key already existsvoid deleteUserGroup(@NotNull SUserGroup group)
Note: the group
would be deleted from all parent groups automatically,
and all subgroups will be reattached to the group
's parents.
group
's direct users aren't moved anywhere.
group
- a group to deletevoid renameUserGroup(@NotNull java.lang.String key, @NotNull java.lang.String name) throws UserGroupException
key
- the group keyname
- new group nameUserGroupException
- if the group is not found, or cannot be renamedSUserGroup.setName(String)
@NotNull java.util.Collection<SUserGroup> getUserGroups()
getRootUserGroups()
@NotNull java.util.Collection<SUserGroup> getRootUserGroups()
getUserGroups()
@NotNull java.util.List<UserGroup> getHostGroupsOf(@NotNull User user)
user
- the user@NotNull java.util.List<UserGroup> getAllHostGroupsOf(@NotNull User user)
user
- the user@Nullable SUserGroup findUserGroupByKey(@NotNull java.lang.String key)
key
- the user group key@Nullable SUserGroup findUserGroupByName(@NotNull java.lang.String name)
name
- the user group name@NotNull java.util.Set<SUserGroup> findUserGroupsByPropertyValue(@NotNull PropertyKey propertyKey, @Nullable java.lang.String propertyValue, boolean caseSensitive)
propertyKey
- property keypropertyValue
- property valuecaseSensitive
- whether to perform case sensitive searchvoid addUserGroupListener(@NotNull UserGroupListener listener)
listener
- the listener to addvoid removeUserGroupListener(@NotNull UserGroupListener listener)
listener
- the listener to remove@NotNull SUserGroup getAllUsersGroup()
boolean isAllUsersGroup(@NotNull SUserGroup group)
group
- the group to check