Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Getting group members of groups

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Getting group members of groups


Chronological Thread 
  • From: Peter DiCamillo <>
  • To: Gagné Sébastien <>
  • Cc: Chris Hyzer <>,
  • Subject: Re: [grouper-users] Getting group members of groups
  • Date: Wed, 20 Feb 2013 16:12:17 -0500
  • Authentication-results: sfpop-ironport05.merit.edu; dkim=neutral (message not signed) header.i=none

Thanks, that solved the problem.

Peter

On 2/20/13 3:28 PM, Gagné Sébastien wrote:
The field is null, I don't know why this method doesn't uses the default
field, it usually does

Try :
groupMembers =
group.getImmediateMembers(Group.getDefaultList(),GrouperUtil.toSet(SourceManager.getInstance().getSource("g:gsa")),
null)


-----Message d'origine-----
De :


[mailto:]
De la part de Peter DiCamillo
Envoyé : 20 février 2013 14:19
À : Chris Hyzer
Cc :

Objet : Re: [grouper-users] Getting group members of groups

I'm having a problem with this. The relevant part of my code is:

GrouperSession session = GrouperSession.startRootSession();
Group group = GroupFinder.findByName(session, groupName); Set<Member> groupMembers = group.getImmediateMembers(null,

GrouperUtil.toSet(SourceManager.getInstance().getSource("g:gsa")),
null);

The call to GroupFinder definitely works. I'm getting this error for the
getImmediateMembers call:

Exception in thread "main" java.lang.NullPointerException
at
edu.internet2.middleware.grouper.privs.PrivilegeHelper.canViewMembers(PrivilegeHelper.java:522)
at
edu.internet2.middleware.grouper.MemberFinder.internal_findMembersByType(MemberFinder.java:148)
at
edu.internet2.middleware.grouper.Group.getImmediateMembers(Group.java:2952)
at GroupDef.showDef(GroupDef.java:101)
at GroupDef.main(GroupDef.java:61)

Any ideas?

Peter

On 2/20/13 10:19 AM, Chris Hyzer wrote:
This should work:

Set<Member> members = group.getImmediateMembers(null, GrouperUtil.toSet(SourceManager.getInstance().getSource("g:gsa")), null);

Thanks,
Chris

-----Original Message-----
From: Peter DiCamillo
[mailto:]
Sent: Wednesday, February 20, 2013 10:19 AM
To: Chris Hyzer
Cc:

Subject: Re: [grouper-users] Getting group members of groups

Immediate members, and Grouper 2.1.3. Thanks.

Peter

On 2/20/13 10:17 AM, Chris Hyzer wrote:
There are a few ways to do this. Do you want immediate and effective
members? Which version of Grouper?

Set<Member> members = group.getMembers(null, GrouperUtil.toSet(SourceManager.getInstance().getSource("g:gsa")), null);

Thanks,
Chris

-----Original Message-----
From: [mailto:] On Behalf Of Peter DiCamillo
Sent: Wednesday, February 20, 2013 10:13 AM
To:

Subject: [grouper-users] Getting group members of groups

Using the Grouper Java API, is there an efficient way to get all the groups that are members of a given group? I'm wondering if there is a faster way than getting all the memberships, and testing which are groups, since in some cases the groups have thousands of person members.

Peter





Archive powered by MHonArc 2.6.16.

Top of Page