public interface MembershipDao
Modifier and Type | Method and Description |
---|---|
BatchResult<String> |
addAllUsersToGroup(long directoryId,
Collection<String> userNames,
String groupName)
Bulk adds all the given users into the given group.
|
void |
addGroupToGroup(long directoryId,
String childGroup,
String parentGroup)
Adds group as a child of the (supposedly) parent group.
|
void |
addUserToGroup(long directoryId,
String userName,
String groupName)
Adds user as a member of group.
|
BoundedCount |
countDirectMembersOfGroup(long directoryId,
String groupName,
int potentialMaxCount)
Count the direct members of a group with a recommended upper bound on the count.
|
boolean |
isGroupDirectMember(long directoryId,
String childGroup,
String parentGroup)
Determines whether the group is a direct member of the (supposedly) parent group.
|
boolean |
isUserDirectMember(long directoryId,
String userName,
String groupName)
Determines whether the user is a direct member of the group.
|
void |
removeGroupFromGroup(long directoryId,
String childGroup,
String parentGroup)
Removes group from the parent group.
|
void |
removeUserFromGroup(long directoryId,
String userName,
String groupName)
Removes user as a member of the given group.
|
<T> List<T> |
search(long directoryId,
MembershipQuery<T> query)
Search for memberships by the given criteria.
|
<T> com.google.common.collect.ListMultimap<String,T> |
searchGroupedByName(long directoryId,
MembershipQuery<T> query)
Search for memberships by the given criteria.
|
boolean isUserDirectMember(long directoryId, String userName, String groupName)
directoryId
- the directory to perform the operationuserName
- usergroupName
- groupboolean isGroupDirectMember(long directoryId, String childGroup, String parentGroup)
directoryId
- the directory to perform the operationchildGroup
- child groupparentGroup
- parent groupvoid addUserToGroup(long directoryId, String userName, String groupName) throws UserNotFoundException, GroupNotFoundException, MembershipAlreadyExistsException
directoryId
- the directory to perform the operationuserName
- usergroupName
- groupUserNotFoundException
- if the user does not existGroupNotFoundException
- if the group does not existMembershipAlreadyExistsException
- if the user is already a direct member of the groupBatchResult<String> addAllUsersToGroup(long directoryId, Collection<String> userNames, String groupName) throws GroupNotFoundException
directoryId
- the directory to perform the operationuserNames
- the collection of usersgroupName
- name of the groupGroupNotFoundException
- if the group does not existvoid addGroupToGroup(long directoryId, String childGroup, String parentGroup) throws GroupNotFoundException, MembershipAlreadyExistsException
directoryId
- the directory to perform the operationchildGroup
- the (supposedly) child groupparentGroup
- parent groupGroupNotFoundException
- if either child or parent group is not foundMembershipAlreadyExistsException
- if the child group is already a child of the parent groupvoid removeUserFromGroup(long directoryId, String userName, String groupName) throws UserNotFoundException, GroupNotFoundException, MembershipNotFoundException
directoryId
- the directory to perform the operationuserName
- usergroupName
- groupUserNotFoundException
- if the user does not existGroupNotFoundException
- if the group does not existMembershipNotFoundException
- if the user is not a member of the said groupvoid removeGroupFromGroup(long directoryId, String childGroup, String parentGroup) throws GroupNotFoundException, MembershipNotFoundException
directoryId
- the directory to perform the operationchildGroup
- child groupparentGroup
- parent groupGroupNotFoundException
- if either child or parent group does not existMembershipNotFoundException
- if the membership relationship between the child and parent group does not exist<T> List<T> search(long directoryId, MembershipQuery<T> query)
directoryId
- the directory to perform the operationquery
- criteria<T> com.google.common.collect.ListMultimap<String,T> searchGroupedByName(long directoryId, MembershipQuery<T> query)
MembershipQuery.getEntityNamesToMatch()
.directoryId
- the directory to perform the operationquery
- criteriaBoundedCount countDirectMembersOfGroup(long directoryId, String groupName, int potentialMaxCount)
Count the direct members of a group with a recommended upper bound on the count.
The upper bound is there so that, in directories that do not support efficient counting of memberships, less work may be performed.
Important: Please note that any directory wishing to implement this method should make it as efficient as possible. Such that an administrator could land on a page that showed ~20 groups, run this method once per group, and it would still return results as efficiently as possible.
directoryId
- the directory to perform the operationgroupName
- the name of the group to search forpotentialMaxCount
- a suggested minimum number of elements for the implementation to count. The implementation
will only use this number if it can get efficiency benefits; otherwise this number may be ignored.BoundedCount.exactly(long)
0 will be returned.Copyright © 2021 Atlassian. All rights reserved.