public class GroupFinder extends Object
Use this class to find groups within the Groups registry
Sample call
Group group = GroupFinder.findByName(grouperSession, "test", true);
Sample call to find groups a subject has specific privileges on
Setgroups = new GroupFinder().assignPrivileges(AccessPrivilege.VIEW_PRIVILEGES) .assignField(Group.getDefaultList()).assignSubject(subject) .assignQueryOptions(new QueryOptions().paging(1000, 1, false)).findGroups();
Constructor and Description |
---|
GroupFinder()
default constructor
|
Modifier and Type | Method and Description |
---|---|
GroupFinder |
addAttributeValuesOnAssignment(Object value)
if looking for an attribute value on an assignment, could be multiple values
|
GroupFinder |
addAttributeValuesOnAssignment2(Object value)
if looking for an attribute value on an assignment2, could be multiple values
|
GroupFinder |
addGroupId(String groupId)
add a group id to search for
|
GroupFinder |
addGroupName(String groupName)
add a group name to search for
|
GroupFinder |
addPrivilege(Privilege privilege)
add a privilege to filter by that the subject has on the group
|
GroupFinder |
addTypeOfGroup(TypeOfGroup typeOfGroup) |
GroupFinder |
assignAttributeCheckReadOnAttributeDef(boolean theAttributeDefNameUseSecurity)
use security around attribute def? default is true
|
GroupFinder |
assignAttributeNotAssigned(boolean attributeNotAssigned)
find groups that don't have a certain type assigned
|
GroupFinder |
assignAttributeValue(Object theValue)
find objects with this value
|
GroupFinder |
assignAttributeValue2(Object theValue)
find objects with this value2
|
GroupFinder |
assignAttributeValuesOnAssignment(Set<Object> theValues)
if looking for an attribute value on an assignment, could be multiple values
|
GroupFinder |
assignAttributeValuesOnAssignment2(Set<Object> theValues)
if looking for an attribute value on an assignment2, could be multiple values
|
GroupFinder |
assignCompositeOwner(Boolean theCompositeOwner)
if we are filtering for groups which are composite owners or not
|
GroupFinder |
assignField(Field theField)
field to look for if searching for memberships in groups
|
GroupFinder |
assignFieldName(String theFieldName)
field name to look for if searching for memberships in groups
|
GroupFinder |
assignFindByUuidOrName(boolean theFindByUuidOrName)
if we are looking up a group, only look by uuid or name
|
GroupFinder |
assignGroupIds(Collection<String> theGroupIds)
assign group ids to search for
|
GroupFinder |
assignGroupNames(Collection<String> theGroupNames)
assign group names to search for
|
GroupFinder |
assignIdOfAttributeDefName(String theAttributeDefNameId)
find groups that have this attribute def name id, note could be an assignment on an assignment
|
GroupFinder |
assignIdOfAttributeDefName2(String theAttributeDefNameId)
find groups that have this attribute def name id, note could be an assignment on an assignment
|
GroupFinder |
assignMembershipsForSubject(boolean membershipsForSubject1)
if this is true, or there is a field assigned, then get memberships for a subject
|
GroupFinder |
assignNameOfAttributeDefName(String theNameOfAttributeDefName)
find groups that have this attribute assigned
|
GroupFinder |
assignNameOfAttributeDefName2(String theNameOfAttributeDefName)
find groups that have this attribute assigned
|
GroupFinder |
assignParentStemId(String theParentStemId)
parent or ancestor stem of the group
|
GroupFinder |
assignPrivileges(Set<Privilege> theGroups)
assign privileges to filter by that the subject has on the group
|
GroupFinder |
assignQueryOptions(QueryOptions theQueryOptions)
if sorting, paging, caching, etc
|
GroupFinder |
assignScope(String theScope)
scope to look for groups Wildcards will be appended or percent is the wildcard
|
GroupFinder |
assignSplitScope(boolean theSplitScope)
if the scope has spaces in it, then split by whitespace, and find results that contain all of the scope strings
|
GroupFinder |
assignStemScope(Stem.Scope theStemScope)
if passing in a stem, this is the stem scope...
|
GroupFinder |
assignSubject(Subject theSubject)
this is the subject that has certain memberships in the query
|
GroupFinder |
assignSubjectNotInGroup(Subject theSubjectNotInGroup)
assign a subject which does not have a membership in the group
|
GroupFinder |
assignTypeOfGroups(Set<TypeOfGroup> theTypeOfGroups) |
static Set<Group> |
findAllByAttribute(GrouperSession s,
String attr,
String val)
Find Groups by attribute value.
|
static Set<Group> |
findAllByType(GrouperSession s,
GroupType type)
Find all groups within the registry by their
GroupType . |
static Group |
findByAlternateName(GrouperSession s,
String name,
boolean exceptionIfNotFound)
Find a group within the registry by its alternate name.
|
static Set<Group> |
findByApproximateDescriptionSecure(String description,
QueryOptions queryOptions,
Set<TypeOfGroup> typeOfGroups) |
static Set<Group> |
findByApproximateDisplayExtensionSecure(String extension,
QueryOptions queryOptions,
Set<TypeOfGroup> typeOfGroups) |
static Set<Group> |
findByApproximateDisplayNameSecure(String displayName,
QueryOptions queryOptions,
Set<TypeOfGroup> typeOfGroups) |
static Set<Group> |
findByApproximateExtensionSecure(String extension,
QueryOptions queryOptions,
Set<TypeOfGroup> typeOfGroups) |
static Group |
findByAttribute(GrouperSession s,
String attr,
String val)
Deprecated.
use the overload
|
static Group |
findByAttribute(GrouperSession s,
String attr,
String val,
boolean exceptionOnNull)
Find Group by attribute value.
|
static Group |
findByCurrentName(GrouperSession s,
String name,
boolean exceptionIfNotFound)
Find a group within the registry by its current name.
|
static Set<Group> |
findByDescriptionSecure(String description,
QueryOptions queryOptions,
Set<TypeOfGroup> typeOfGroups) |
static Set<Group> |
findByDisplayExtensionSecure(String displayExtension,
QueryOptions queryOptions,
Set<TypeOfGroup> typeOfGroups) |
static Set<Group> |
findByDisplayNameSecure(String displayName,
QueryOptions queryOptions,
Set<TypeOfGroup> typeOfGroups) |
static Set<Group> |
findByExtensionSecure(String extension,
QueryOptions queryOptions,
Set<TypeOfGroup> typeOfGroups) |
static Group |
findByIdIndexSecure(Long idIndex,
boolean exceptionIfNotFound,
QueryOptions queryOptions)
Find a group within the registry by ID index.
|
static Group |
findByName(GrouperSession s,
String name)
Deprecated.
|
static Group |
findByName(GrouperSession s,
String name,
boolean exceptionIfNotFound)
Find a group within the registry by name.
|
static Group |
findByName(GrouperSession s,
String name,
boolean exceptionIfNotFound,
QueryOptions queryOptions)
Find a group within the registry by name.
|
static Group |
findByName(String name,
boolean exceptionIfNotFound)
Find a group within the registry by name.
|
static Group |
findByUuid(GrouperSession s,
String uuid)
Deprecated.
|
static Group |
findByUuid(GrouperSession s,
String uuid,
boolean exceptionIfNotFound)
Find a group within the registry by UUID.
|
static Group |
findByUuid(GrouperSession s,
String uuid,
boolean exceptionIfNotFound,
QueryOptions queryOptions)
Find a group within the registry by UUID.
|
static Group |
findByUuid(String uuid,
boolean exceptionIfNotFound)
Find a group within the registry by UUID.
|
Group |
findGroup()
find the group
|
Set<Group> |
findGroups()
find all the group
|
static void |
groupCacheAsRootAddSystemGroup(Group group)
Grouper internal method only
|
static void |
groupCacheClear()
Grouper internal method only
|
static void |
groupCacheRemove(Group group)
Grouper internal method only
|
public static void groupCacheAsRootAddSystemGroup(Group group)
Grouper internal method only
group
- public static void groupCacheClear()
Grouper internal method only
remove all cachespublic static void groupCacheRemove(Group group)
Grouper internal method only
remove this from all cachesgroup
- public GroupFinder assignCompositeOwner(Boolean theCompositeOwner)
theCompositeOwner
- @Deprecated public static Group findByAttribute(GrouperSession s, String attr, String val) throws GroupNotFoundException, IllegalArgumentException
try { Group g = GroupFinder.findByAttribute(s, "description", "some value"); } catch (GroupNotFoundException eGNF) { }
s
- Search within this session context.attr
- Search on this attribute.val
- Search for this value.Group
.GroupNotFoundException
IllegalArgumentException
public static Group findByAttribute(GrouperSession s, String attr, String val, boolean exceptionOnNull) throws GroupNotFoundException, IllegalArgumentException
Group g = GroupFinder.findByAttribute(s, "description", "some value", true);
s
- Search within this session context.attr
- Search on this attribute.val
- Search for this value.exceptionOnNull
- true if there should be an exception on nullGroup
.GroupNotFoundException
IllegalArgumentException
public static Set<Group> findAllByAttribute(GrouperSession s, String attr, String val) throws IllegalArgumentException
Setgroups = GroupFinder.findAllByAttribute(s, "description", "some value");
s
- Search within this session context.attr
- Search on this attribute.val
- Search for this value.Group
.IllegalArgumentException
@Deprecated public static Group findByName(GrouperSession s, String name) throws GroupNotFoundException
try { Group g = GroupFinder.findByName(name); } catch (GroupNotFoundException e) { // Group not found }
s
- Find group within this session context.name
- Name of group to find.Group
GroupNotFoundException
public static Group findByName(GrouperSession s, String name, boolean exceptionIfNotFound) throws GroupNotFoundException
try { Group g = GroupFinder.findByName(name); } catch (GroupNotFoundException e) { // Group not found }
s
- Find group within this session context.name
- Name of group to find.exceptionIfNotFound
- Group
GroupNotFoundException
public static Group findByName(String name, boolean exceptionIfNotFound)
try { Group g = GroupFinder.findByName(name, true); } catch (GroupNotFoundException e) { // Group not found }
name
- Name of group to find.exceptionIfNotFound
- queryOptions
- paging, sorting, caching optionsGroup
GroupNotFoundException
public static Group findByName(GrouperSession s, String name, boolean exceptionIfNotFound, QueryOptions queryOptions) throws GroupNotFoundException
try { Group g = GroupFinder.findByName(name); } catch (GroupNotFoundException e) { // Group not found }
s
- Find group within this session context.name
- Name of group to find.exceptionIfNotFound
- queryOptions
- paging, sorting, caching optionsGroup
GroupNotFoundException
public static Set<Group> findByApproximateDescriptionSecure(String description, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups)
public static Set<Group> findByDescriptionSecure(String description, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups)
public static Set<Group> findByDisplayNameSecure(String displayName, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups)
public static Set<Group> findByApproximateDisplayNameSecure(String displayName, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups)
public static Set<Group> findByExtensionSecure(String extension, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups)
public static Set<Group> findByApproximateExtensionSecure(String extension, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups)
public static Set<Group> findByDisplayExtensionSecure(String displayExtension, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups)
public static Set<Group> findByApproximateDisplayExtensionSecure(String extension, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups)
public static Group findByCurrentName(GrouperSession s, String name, boolean exceptionIfNotFound) throws GroupNotFoundException
try { Group g = GroupFinder.findByCurrentName(name, true); } catch (GroupNotFoundException e) { // Group not found }
s
- Find group within this session context.name
- Name of group to find.exceptionIfNotFound
- Group
GroupNotFoundException
public static Group findByAlternateName(GrouperSession s, String name, boolean exceptionIfNotFound) throws GroupNotFoundException
try { Group g = GroupFinder.findByAlternateName(name, true); } catch (GroupNotFoundException e) { // Group not found }
s
- Find group within this session context.name
- Name of group to find.exceptionIfNotFound
- Group
GroupNotFoundException
public static Set<Group> findAllByType(GrouperSession s, GroupType type) throws IllegalArgumentException
GroupType
. Or empty set if none (never null).
Setgroups = GroupFinder.findAllByType( s, GroupTypeFinder.find("your type") );
s
- Find group within this session context.type
- Find group with this GroupType
.Group
sIllegalArgumentException
@Deprecated public static Group findByUuid(GrouperSession s, String uuid) throws GroupNotFoundException
Group g = GroupFinder.findByUuid(s, uuid);
s
- Find group within this session context.uuid
- UUID of group to find.Group
GroupNotFoundException
public static Group findByUuid(String uuid, boolean exceptionIfNotFound)
Group g = GroupFinder.findByUuid(s, uuid);
s
- Find group within this session context.uuid
- UUID of group to find.exceptionIfNotFound
- true if exception if not foundGroup
GroupNotFoundException
- if not found an exceptionIfNotFound is truepublic static Group findByUuid(GrouperSession s, String uuid, boolean exceptionIfNotFound) throws GroupNotFoundException
Group g = GroupFinder.findByUuid(s, uuid);
s
- Find group within this session context.uuid
- UUID of group to find.exceptionIfNotFound
- true if exception if not foundGroup
GroupNotFoundException
- if not found an exceptionIfNotFound is truepublic static Group findByUuid(GrouperSession s, String uuid, boolean exceptionIfNotFound, QueryOptions queryOptions) throws GroupNotFoundException
Group g = GroupFinder.findByUuid(s, uuid);
s
- Find group within this session context.uuid
- UUID of group to find.exceptionIfNotFound
- true if exception if not foundqueryOptions
- Group
GroupNotFoundException
- if not found an exceptionIfNotFound is truepublic static Group findByIdIndexSecure(Long idIndex, boolean exceptionIfNotFound, QueryOptions queryOptions) throws GroupNotFoundException
idIndex
- id index of group to find.exceptionIfNotFound
- true if exception if not foundqueryOptions
- Group
GroupNotFoundException
- if not found an exceptionIfNotFound is truepublic GroupFinder assignSubjectNotInGroup(Subject theSubjectNotInGroup)
theSubjectNotInGroup
- public GroupFinder addPrivilege(Privilege privilege)
privilege
- should be AccessPrivilegepublic GroupFinder assignPrivileges(Set<Privilege> theGroups)
theGroups
- public GroupFinder assignQueryOptions(QueryOptions theQueryOptions)
theQueryOptions
- public GroupFinder assignAttributeCheckReadOnAttributeDef(boolean theAttributeDefNameUseSecurity)
theAttributeDefNameUseSecurity
- public GroupFinder assignAttributeNotAssigned(boolean attributeNotAssigned)
attributeNotAssigned
- public GroupFinder assignAttributeValuesOnAssignment(Set<Object> theValues)
theValues
- public GroupFinder addAttributeValuesOnAssignment(Object value)
theValues
- public GroupFinder assignAttributeValue(Object theValue)
theValue
- public GroupFinder assignIdOfAttributeDefName(String theAttributeDefNameId)
theAttributeDefNameId
- public GroupFinder assignNameOfAttributeDefName(String theNameOfAttributeDefName)
theNameOfAttributeDefName
- public GroupFinder addGroupId(String groupId)
groupId
- public GroupFinder assignGroupNames(Collection<String> theGroupNames)
theGroupNames
- public GroupFinder addGroupName(String groupName)
groupName
- public GroupFinder assignGroupIds(Collection<String> theGroupIds)
theGroupIds
- public GroupFinder assignField(Field theField)
theField
- public GroupFinder assignFieldName(String theFieldName)
theFieldName
- public GroupFinder assignMembershipsForSubject(boolean membershipsForSubject1)
membershipsForSubject1
- public Set<Group> findGroups()
public GroupFinder assignTypeOfGroups(Set<TypeOfGroup> theTypeOfGroups)
theTypeOfGroups
- public GroupFinder addTypeOfGroup(TypeOfGroup typeOfGroup)
typeOfGroup
- public GroupFinder assignScope(String theScope)
theScope
- public GroupFinder assignSplitScope(boolean theSplitScope)
theSplitScope
- public GroupFinder assignSubject(Subject theSubject)
theSubject
- public GroupFinder assignParentStemId(String theParentStemId)
theParentStemId
- public GroupFinder assignStemScope(Stem.Scope theStemScope)
theStemScope
- public GroupFinder assignFindByUuidOrName(boolean theFindByUuidOrName)
theFindByUuidOrName
- public Group findGroup()
public GroupFinder assignAttributeValue2(Object theValue)
theValue
- public GroupFinder assignIdOfAttributeDefName2(String theAttributeDefNameId)
theAttributeDefNameId
- public GroupFinder assignNameOfAttributeDefName2(String theNameOfAttributeDefName)
theNameOfAttributeDefName
- public GroupFinder addAttributeValuesOnAssignment2(Object value)
value
- public GroupFinder assignAttributeValuesOnAssignment2(Set<Object> theValues)
theValues
- Copyright © 2016 Internet2. All rights reserved.