public class GrouperQuery extends Object
| Modifier and Type | Method and Description |
|---|---|
static GrouperQuery |
createQuery(GrouperSession s,
QueryFilter filter)
Create a query for searching the Groups Registry.
|
Set<Group> |
getGroups()
Get groups matching query filter.
|
Set |
getMembers()
Get members matching query filter.
|
Set |
getMemberships()
Get memberships matching query filter.
|
Set<Stem> |
getStems()
Get stems matching query filter.
|
public static GrouperQuery createQuery(GrouperSession s, QueryFilter filter) throws QueryException
GrouperQuery gq = GrouperQuery.createQuery(
s,
new AndFilter(
new GroupCreatedAfterFilter(date, stem),
new GroupAttributeFilter(attr, value, stem)
)
);
This method defines a query but does not execute the query. Evaulation
takes place in the getGroups(), getMembers(),
getMemberships() and getStems() methods. Those methods
all operate in the same manner. They first execute the query filter. This
returns a set of candidate results. Each method then iterates through the
candidate set, extracting objects of the the appropriate time to return.
Several of the methods also convert between object types in order to return
results. See each method for more details.
All query filters implement the QueryFilter interface. See that
class for information on the query filters supplied by Grouper as well as
information on creating custom query filters.
s - Query within this session context.filter - A QueryFilter specification.GrouperQuery object.QueryExceptionpublic Set<Group> getGroups() throws QueryException
Set groups = gq.getGroups();
This method (currently) performs no candidate object conversion. Only
Group objects in the candidate set will be returned.
Group objects.QueryExceptionpublic Set getMembers() throws QueryException
Set members = gq.getMembers();
This method calls getMemberships() internally. Each Membership's
Member is then extracted and returned.
Member objects.QueryExceptionpublic Set getMemberships() throws QueryException
Set memberships = gq.getMemberships();
If this method finds a Group in the candidate set it will add all
Memberships returned by calling Group.getMemberships() to
the result set.
Membership objects.QueryExceptionpublic Set<Stem> getStems() throws QueryException
Set stems = gq.getStems();
This method (currently) performs no candidate object conversion. Only
Stem objects in the candidate set will be returned.
Stem objects.QueryExceptionCopyright © 2016 Internet2. All rights reserved.