public interface InternalMembershipDao extends MembershipDao
InternalMembership
.Modifier and Type | Method and Description |
---|---|
BatchResult<InternalMembership> |
addAll(Set<InternalMembership> memberships)
Bulk add of memberships.
|
default BatchResult<String> |
addUserToGroups(long directoryId,
String username,
Set<String> groupNames)
Add many groups to a user
|
List<InternalMembership> |
getMembershipsCreatedAfter(long directoryId,
Date timestamp,
int maxResults)
Retrieves memberships with the creation timestamp greater than the specified date
|
void |
removeAllRelationships(long directoryId)
Removes all relationships the the given directory identified by directory id.
|
void |
removeAllUserRelationships(long directoryId)
Removes all user relationships the the given directory identified by directory id.
|
void |
removeGroupMembers(long directoryId,
String groupName)
Removes all members of the given group name.
|
void |
removeGroupMemberships(long directoryId,
String groupName)
Removes all relationships from parent groups to the given group name.
|
void |
removeUserMemberships(long directoryId,
String username)
Removes all
MembershipType.GROUP_USER relationships
from parent groups to the given username. |
void |
renameGroupRelationships(long directoryId,
String oldName,
String newName)
Renames group name in all relationships.
|
void |
renameUserRelationships(long directoryId,
String oldName,
String newName)
Renames username in all relationships.
|
addAllUsersToGroup, addGroupToGroup, addUserToGroup, countDirectMembersOfGroup, isGroupDirectMember, isUserDirectMember, removeGroupFromGroup, removeUserFromGroup, search, searchGroupedByName
void removeGroupMembers(long directoryId, String groupName)
directoryId
- Directory id.groupName
- Group name.void removeGroupMemberships(long directoryId, String groupName)
directoryId
- Directory id.groupName
- Group name.void removeUserMemberships(long directoryId, String username)
MembershipType.GROUP_USER
relationships
from parent groups to the given username.directoryId
- Directory id.username
- Username.void removeAllRelationships(long directoryId)
directoryId
- Directory id.void removeAllUserRelationships(long directoryId)
directoryId
- Directory id.void renameUserRelationships(long directoryId, String oldName, String newName)
directoryId
- Directory id.oldName
- Old username.newName
- New username.void renameGroupRelationships(long directoryId, String oldName, String newName)
directoryId
- Directory id.oldName
- Old group name.newName
- New group name.BatchResult<InternalMembership> addAll(Set<InternalMembership> memberships)
memberships
- Set of memberships.@ExperimentalSpi List<InternalMembership> getMembershipsCreatedAfter(long directoryId, Date timestamp, int maxResults)
directoryId
- the id of the directory to searchtimestamp
- the date to limit the search bymaxResults
- the maximum number of results to returndefault BatchResult<String> addUserToGroups(long directoryId, String username, Set<String> groupNames) throws UserNotFoundException
This method assumes that groups and user already exist.
Default implementation is not-optimal in respect of number of DB queries. Reference optimal implementation for Hibernate5 is located in crowd-persistance-hibernate5.
directoryId
- the id of the directory to which user and groups belongusername
- username of the user to whom we add groupsgroupNames
- names of the group to add to a user. The groups need to exist in the directoryUserNotFoundException
- when user with a given username
does not exist in the directory with
directoryId
idCopyright © 2021 Atlassian. All rights reserved.