com.atlassian.confluence.user.crowd
Class CachedCrowdMembershipDao
java.lang.Object
com.atlassian.confluence.user.crowd.CachedCrowdMembershipDao
- All Implemented Interfaces:
- com.atlassian.crowd.embedded.spi.MembershipDao
public final class CachedCrowdMembershipDao
- extends Object
- implements com.atlassian.crowd.embedded.spi.MembershipDao
Caches membership information. Invalidation is done whenever any membership in the parent group changes.
- Since:
- 3.5
- See Also:
DefaultMembershipCache
Method Summary |
com.atlassian.crowd.util.BatchResult<String> |
addAllUsersToGroup(long directoryId,
Collection<String> userNames,
String groupName)
|
void |
addGroupToGroup(long directoryId,
String childGroupName,
String parentGroupName)
|
void |
addUserToGroup(long directoryId,
String userName,
String groupName)
|
static
|
constrainResults(List<T> results,
int startIndex,
int maxResults)
|
boolean |
isGroupDirectMember(long directoryId,
String childGroup,
String parentGroupName)
|
boolean |
isUserDirectMember(long directoryId,
String userName,
String groupName)
|
void |
removeGroupFromGroup(long directoryId,
String childGroupName,
String parentGroupName)
|
void |
removeUserFromGroup(long directoryId,
String userName,
String groupName)
|
|
search(long directoryId,
com.atlassian.crowd.search.query.membership.MembershipQuery<T> query)
This implementation uses the existing cached data for searches returning strings, and for searches returning
Group objects when searching for Groups as well. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachedCrowdMembershipDao
public CachedCrowdMembershipDao(com.atlassian.crowd.embedded.spi.MembershipDao delegate,
MembershipCache stringCache,
GroupMembershipCache parentGroupCache,
GroupMembershipCache childGroupCache)
isUserDirectMember
public boolean isUserDirectMember(long directoryId,
String userName,
String groupName)
- Specified by:
isUserDirectMember
in interface com.atlassian.crowd.embedded.spi.MembershipDao
isGroupDirectMember
public boolean isGroupDirectMember(long directoryId,
String childGroup,
String parentGroupName)
- Specified by:
isGroupDirectMember
in interface com.atlassian.crowd.embedded.spi.MembershipDao
addUserToGroup
public void addUserToGroup(long directoryId,
String userName,
String groupName)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.GroupNotFoundException
- Specified by:
addUserToGroup
in interface com.atlassian.crowd.embedded.spi.MembershipDao
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.GroupNotFoundException
addAllUsersToGroup
public com.atlassian.crowd.util.BatchResult<String> addAllUsersToGroup(long directoryId,
Collection<String> userNames,
String groupName)
throws com.atlassian.crowd.exception.GroupNotFoundException
- Specified by:
addAllUsersToGroup
in interface com.atlassian.crowd.embedded.spi.MembershipDao
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
addGroupToGroup
public void addGroupToGroup(long directoryId,
String childGroupName,
String parentGroupName)
throws com.atlassian.crowd.exception.GroupNotFoundException
- Specified by:
addGroupToGroup
in interface com.atlassian.crowd.embedded.spi.MembershipDao
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
removeUserFromGroup
public void removeUserFromGroup(long directoryId,
String userName,
String groupName)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.MembershipNotFoundException
- Specified by:
removeUserFromGroup
in interface com.atlassian.crowd.embedded.spi.MembershipDao
- Throws:
com.atlassian.crowd.exception.UserNotFoundException
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.MembershipNotFoundException
removeGroupFromGroup
public void removeGroupFromGroup(long directoryId,
String childGroupName,
String parentGroupName)
throws com.atlassian.crowd.exception.GroupNotFoundException,
com.atlassian.crowd.exception.MembershipNotFoundException
- Specified by:
removeGroupFromGroup
in interface com.atlassian.crowd.embedded.spi.MembershipDao
- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.MembershipNotFoundException
search
public <T> List<T> search(long directoryId,
com.atlassian.crowd.search.query.membership.MembershipQuery<T> query)
- This implementation uses the existing cached data for searches returning strings, and for searches returning
Group objects when searching for Groups as well. Missing results for these kinds of searches will also be cached.
Any other searches will simply delegate to the underlying implementation.
- Specified by:
search
in interface com.atlassian.crowd.embedded.spi.MembershipDao
constrainResults
public static <T> List<T> constrainResults(List<T> results,
int startIndex,
int maxResults)