public abstract class AbstractInMemoryMembershipSearchStrategy extends Object implements MembershipSearchStrategy
MembershipSearchStrategy
which searches across multiple directories in memory for users and groups
This is considered the worse case MembershipSearchStrategy
to use as aggregation across multiple directories
will be done in-memory, potentially consuming a lot of memory. This is the same (in spirit) as what Crowd 2.8
and earlier would do by default.
Modifier and Type | Field and Description |
---|---|
protected AccessFilter |
accessFilter |
protected List<Directory> |
directories |
protected List<Long> |
directoryIds |
protected DirectoryManagerSearchWrapper |
directoryManagerSearchWrapper |
Constructor and Description |
---|
AbstractInMemoryMembershipSearchStrategy(DirectoryManager directoryManager,
List<Directory> directories,
AccessFilter accessFilter) |
Modifier and Type | Method and Description |
---|---|
protected abstract CanonicalityChecker |
getCanonicalityCheckerIfNeeded(MembershipQuery<?> query) |
protected abstract <T> BiFunction<Directory,MembershipQuery<T>,MembershipQuery<T>> |
getQueryTransformer(MembershipQuery<T> original) |
<T> List<T> |
searchDirectGroupRelationships(MembershipQuery<T> query)
Searches for direct group relationships in any of the application's active assigned directories.
|
<T> com.google.common.collect.ListMultimap<String,T> |
searchDirectGroupRelationshipsGroupedByName(MembershipQuery<T> query)
Searches for direct group relationships in any of the application's active assigned directories.
|
protected <T> List<T> |
searchGroupRelationships(MembershipQuery<T> query,
boolean nested) |
<T> List<T> |
searchNestedGroupRelationships(MembershipQuery<T> query)
Searches for direct and indirect (nested) group relationships in any of the application's active assigned directories.
|
protected final DirectoryManagerSearchWrapper directoryManagerSearchWrapper
protected final AccessFilter accessFilter
public AbstractInMemoryMembershipSearchStrategy(DirectoryManager directoryManager, List<Directory> directories, AccessFilter accessFilter)
public <T> List<T> searchDirectGroupRelationships(MembershipQuery<T> query)
MembershipSearchStrategy
When searching for the groups an entity is a member of,
the membership aggregation semantic
will determine whether only the owning directory (when false
) or all directories (when true
) will be searched.
searchDirectGroupRelationships
in interface MembershipSearchStrategy
query
- membership query.User
entities,
Group
entities,
String
usernames or String
group names matching the query criteria.public <T> List<T> searchNestedGroupRelationships(MembershipQuery<T> query)
MembershipSearchStrategy
If the directory does not support nested groups, this call will be equivalent to DirectoryManager.searchDirectGroupRelationships(long, com.atlassian.crowd.search.query.membership.MembershipQuery)
.
WARNING: this method could be very slow if the underlying RemoteDirectory does not employ caching.
When searching for the groups a user is a member of only the directory of the user (as determined by findUserByName) is searched. When searching for memberships of a group or groups a group is a member of all directories are searched and the results amalgamated.
searchNestedGroupRelationships
in interface MembershipSearchStrategy
query
- membership query.User
entities,
Group
entities,
String
usernames or String
group names matching the query criteria.protected <T> List<T> searchGroupRelationships(MembershipQuery<T> query, boolean nested)
public <T> com.google.common.collect.ListMultimap<String,T> searchDirectGroupRelationshipsGroupedByName(MembershipQuery<T> query)
MembershipSearchStrategy
When searching for the groups an entity is a member of,
the membership aggregation semantic
will determine whether only the owning directory (when false
) or all directories (when true
) will be searched.
searchDirectGroupRelationshipsGroupedByName
in interface MembershipSearchStrategy
query
- membership query.ListMultimap
where keys are elements of MembershipQuery.getEntityNamesToMatch()
and values are List of User
entities,
Group
entities,
String
usernames or String
group names matching the query criteria for the given key.protected abstract CanonicalityChecker getCanonicalityCheckerIfNeeded(MembershipQuery<?> query)
protected abstract <T> BiFunction<Directory,MembershipQuery<T>,MembershipQuery<T>> getQueryTransformer(MembershipQuery<T> original)
Copyright © 2020 Atlassian. All rights reserved.