grouper-users - RE: [grouper-users] size of group
Subject: Grouper Users - Open Discussion List
List archive
- From: "Hyzer, Chris" <>
- To: Jeff McCullough <>, Gouper Users List <>
- Subject: RE: [grouper-users] size of group
- Date: Sat, 2 Apr 2016 00:53:49 +0000
- Accept-language: en-US
- Authentication-results: berkeley.edu; dkim=none (message not signed) header.d=none;berkeley.edu; dmarc=none action=none header.from=isc.upenn.edu;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
You definitely don't want to get the list and check the size :)
This works for me:
GrouperSession grouperSession = GrouperSession.startRootSession();
Group group1 = new
GroupSave(grouperSession).assignCreateParentStemsIfNotExist(true).assignName("test:testGroup1").save();
Group group2 = new
GroupSave(grouperSession).assignCreateParentStemsIfNotExist(true).assignName("test:testGroup2").save();
group1.addMember(SubjectTestHelper.SUBJ0);
group2.addMember(SubjectTestHelper.SUBJ1);
group1.addMember(group2.toSubject());
QueryOptions queryOptions = new
QueryOptions().retrieveResults(false).retrieveCount(true);
Set<Member> members = group1.getMembers(Group.getDefaultList(),
queryOptions);
assertEquals(0, GrouperUtil.length(members));
assertEquals(3, queryOptions.getCount().intValue());
-----Original Message-----
From:
[mailto:]
On Behalf Of Jeff McCullough
Sent: Friday, April 01, 2016 5:02 PM
To: Gouper Users List
<>
Subject: [grouper-users] size of group
Within a changeLog consumer, I want to determine whether a group is beyond a
certain size to know whether to provision it to an external source. It looks
like the only way to do that is to get a membership list and check the size.
Is there an alternative to that? If the group is large it takes awhile to get
the list. If no alternative method, caching is likely the answer. Thanks in
advance for an insights.
Thanks,
Jeff
- [grouper-users] size of group, Jeff McCullough, 04/01/2016
- RE: [grouper-users] size of group, Hyzer, Chris, 04/02/2016
Archive powered by MHonArc 2.6.16.