Package com.atlassian.confluence.user
Class DefaultSearchEntitiesManager
- java.lang.Object
-
- com.atlassian.confluence.user.DefaultSearchEntitiesManager
-
- All Implemented Interfaces:
SearchEntitiesManager
public class DefaultSearchEntitiesManager extends Object implements SearchEntitiesManager
-
-
Field Summary
-
Fields inherited from interface com.atlassian.confluence.user.SearchEntitiesManager
MATCH_ALL, MATCH_ANY
-
-
Constructor Summary
Constructors Constructor Description DefaultSearchEntitiesManager(PermissionManager permissionManager, com.atlassian.user.search.query.EntityQueryParser entityQueryParser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends com.atlassian.user.Entity>
com.atlassian.user.search.query.Query<T>createUserQuery(List<? extends com.atlassian.user.search.query.Query<T>> queries, String operator)
List<com.atlassian.user.Group>
findGroupsAsList(com.atlassian.user.search.query.TermQuery<com.atlassian.user.Group> tQuery)
Find all groups matching a particular query.List<com.atlassian.user.Group>
findGroupsAsList(com.atlassian.user.search.query.TermQuery<com.atlassian.user.Group> tQuery, boolean filterGroups)
Find the groups that match a particular query, optionally filtering out groups not visible to the current user.List<com.atlassian.user.User>
findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> userQuery)
Finds users according to the specified query.List<com.atlassian.user.User>
findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> userQuery, boolean showUnlicensedUsers)
Find all users matching a particular query.com.atlassian.user.search.query.TermQuery<com.atlassian.user.Group>
getGroupNameTermQuery(String groupnameTerm)
<T extends com.atlassian.user.Entity>
com.atlassian.user.search.query.TermQuery<T>getTermQuery(String term, Class<? extends com.atlassian.user.search.query.TermQuery<T>> termQueryClass)
Returns an instance of TermQuery based on the passed Class.
-
-
-
Constructor Detail
-
DefaultSearchEntitiesManager
public DefaultSearchEntitiesManager(PermissionManager permissionManager, com.atlassian.user.search.query.EntityQueryParser entityQueryParser)
-
-
Method Detail
-
findGroupsAsList
public List<com.atlassian.user.Group> findGroupsAsList(com.atlassian.user.search.query.TermQuery<com.atlassian.user.Group> tQuery) throws com.atlassian.user.EntityException
Description copied from interface:SearchEntitiesManager
Find all groups matching a particular query.- Specified by:
findGroupsAsList
in interfaceSearchEntitiesManager
- Parameters:
tQuery
- the query to search on- Throws:
com.atlassian.user.EntityException
-
findGroupsAsList
public List<com.atlassian.user.Group> findGroupsAsList(com.atlassian.user.search.query.TermQuery<com.atlassian.user.Group> tQuery, boolean filterGroups) throws com.atlassian.user.EntityException
Description copied from interface:SearchEntitiesManager
Find the groups that match a particular query, optionally filtering out groups not visible to the current user. The filterGroups argument will only make a difference if the Confluence server is running in shared mode.- Specified by:
findGroupsAsList
in interfaceSearchEntitiesManager
- Parameters:
tQuery
- the query to search onfilterGroups
- true will filter out groups the current user is not permitted to see- Throws:
com.atlassian.user.EntityException
-
findUsersAsList
public List<com.atlassian.user.User> findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> userQuery) throws com.atlassian.user.EntityException
Finds users according to the specified query.- Specified by:
findUsersAsList
in interfaceSearchEntitiesManager
- Parameters:
userQuery
- the user query- Returns:
- a list of users. No two users with the same name (that is,
Entity.getName()
will be returned. - Throws:
com.atlassian.user.EntityException
-
findUsersAsList
public List<com.atlassian.user.User> findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> userQuery, boolean showUnlicensedUsers) throws com.atlassian.user.EntityException
Description copied from interface:SearchEntitiesManager
Find all users matching a particular query.- Specified by:
findUsersAsList
in interfaceSearchEntitiesManager
- Parameters:
userQuery
- the user query.showUnlicensedUsers
- whether to only include licensed users in the results.- Returns:
- a list of users. No two users with the same name (that is,
Entity.getName()
will be returned. - Throws:
com.atlassian.user.EntityException
-
getTermQuery
public <T extends com.atlassian.user.Entity> com.atlassian.user.search.query.TermQuery<T> getTermQuery(String term, Class<? extends com.atlassian.user.search.query.TermQuery<T>> termQueryClass) throws com.atlassian.user.search.query.EntityQueryException
Returns an instance of TermQuery based on the passed Class.For example to retrieve a UserNameTermQuery you can call: getTermQuery(usernameTerm, UserNameTermQuery.class)
- Specified by:
getTermQuery
in interfaceSearchEntitiesManager
- Parameters:
term
- The search termtermQueryClass
- The class of the object that should be returned- Returns:
- An object which implements the TermQuery interface
- Throws:
com.atlassian.user.search.query.EntityQueryException
-
getGroupNameTermQuery
public com.atlassian.user.search.query.TermQuery<com.atlassian.user.Group> getGroupNameTermQuery(String groupnameTerm) throws com.atlassian.user.search.query.EntityQueryException
- Specified by:
getGroupNameTermQuery
in interfaceSearchEntitiesManager
- Throws:
com.atlassian.user.search.query.EntityQueryException
-
createUserQuery
public <T extends com.atlassian.user.Entity> com.atlassian.user.search.query.Query<T> createUserQuery(List<? extends com.atlassian.user.search.query.Query<T>> queries, String operator) throws com.atlassian.user.search.query.EntityQueryException
- Specified by:
createUserQuery
in interfaceSearchEntitiesManager
- Throws:
com.atlassian.user.search.query.EntityQueryException
-
-