Skip to Content.
Sympa Menu

grouper-dev - memberships service

Subject: Grouper Developers Forum

List archive

memberships service


Chronological Thread 
  • From: Chris Hyzer <>
  • To: "" <>
  • Subject: memberships service
  • Date: Sat, 19 Dec 2009 17:11:29 -0500
  • Accept-language: en-US
  • Acceptlanguage: en-US

Hey,

 

The last two methods I implemented for the KIM adapter involved returning membership objects.  Then I remembered the memberships service was never implemented.  So I implemented it for 1.6.  If you are interested in this service, please review it carefully and give me feedback soon so we can work it in before the service is released (at which point it is much harder to change).

 

https://bugs.internet2.edu/jira/browse/GRP-369

 

the API uses this method:

 

  /**

   * @see edu.internet2.middleware.grouper.internal.dao.MembershipDAO#findAllByGroupOwnerOptions(java.util.Collection, java.util.Collection, java.util.Collection, edu.internet2.middleware.grouper.membership.MembershipType, edu.internet2.middleware.grouper.Field, Set, java.lang.String, edu.internet2.middleware.grouper.Stem, edu.internet2.middleware.grouper.Stem.Scope, java.lang.Boolean)

   * @param groupIds to limit memberships to (cant have more than 100 bind variables)

   * @param memberIds to limit memberships to (cant have more than 100 bind variables)

   * @param membershipIds to limit memberships to (cant have more than 100 bind variables)

   * @param membershipType Immediate, NonImmediate, etc

   * @param field if finding one field, list here, otherwise all list fields will be returned

   * @param sources if limiting memberships of members in certain sources, list here

   * @param scope sql like string which will have a % appended to it

   * @param stem if looking in a certain stem

   * @param stemScope if looking only in this stem, or all substems

   * @param enabled null for all, true for enabled only, false for disabled only

   * @return the set of arrays of Membership, Group, and Member

   */

  public static Set<Object[]> findMemberships(Collection<String> groupIds, Collection<String> memberIds,

      Collection<String> membershipIds, MembershipType membershipType,

      Field field, 

      Set<Source> sources, String scope, Stem stem, Scope stemScope, Boolean enabled) {

 

 

The WS uses these operations:

 

https://spaces.internet2.edu/display/GrouperWG/v1.6.0+Get+Memberships

 

    *  Can base membership list based on memberfilter (e.g. All, Immediate, Effective)

    * Lookup subjects by subject lookup (by id, source, identifier, etc)

    * Lookup groups by group lookup (by name or uuid)

    * Returns group / subject information, can be detailed or not

    * Can actAs another user

    * Can filter by a list name (currently only can return group members memberships, not privilege memberships)

    * Can filter by "scope" which is a sql "like" string in the namespace for group name.

    * Can filter for all memberships directly in a stem, or in any substem of a stem

    * Can filter by subject source so only people memberships are returned, or groups, or etc.

 

Here is an example of batched:

 

http://anoncvs.internet2.edu/cgi-bin/viewvc.cgi/I2MI/grouper-ws/grouper-ws/doc/samples/getMemberships/WsSampleGetMembershipsRest_xml.txt?revision=1.2&view=co&pathrev=HEAD

 

Here is an example of lite:

 

http://anoncvs.internet2.edu/cgi-bin/viewvc.cgi/I2MI/grouper-ws/grouper-ws/doc/samples/getMemberships/WsSampleGetMembershipsRestLite_xml.txt?revision=1.2&view=co&pathrev=HEAD

 

Here is the grouper client documentation:

 

getMembershipsWs web service usage:

  java -jar grouperClient.jar --operation=getMembershipsWs [--groupNames=a:b:c,a:b:d] [--groupUuids=1234,abcd] [--subjectIds=subjId0,subjId1] [--subjectIdentifiers=subjIdent0,subjIdent1] [--subjectSources=source0,source1] [--fieldName=fieldNameToAdd] [--memberFilter=All|Immediate|NonImmediate|Effective|Composite] [--sourceIds=sourceId1,sourceId2] [--membershipIds=abc,bcd] [--scope=school:folder:somewhere] [--stemName=a:b:c] [--stemUuid=abc] [--stemScope=ONE_LEVEL|ALL_IN_SUBTREE] [--enabled=A|T|F] [--includeGroupDetail=true|false] [--includeSubjectDetail=true|false] [--subjectAttributeNames=name0,name1] [--actAsSubjectId=subjId] [--actAsSubjectIdentifier=subjIdent] [--actAsSubjectSource=source] [--saveResultsToFile=fileName] [--outputTemplate=somePattern] [--paramName0=name0] [--paramValue0=value1] [--paramNameX=xthParamName] [--paramValueX=xthParamValue] [--debug=true] [--clientVersion=someVersion]

  e.g.: java -jar grouperClient.jar --operation=getMembershipsWs --groupNames=aStem:aGroup,aStem:aGroup2

  output line: Index 0: group: aStem:aGroup, subject: 12345, list: members, type: Immediate, enabled: T

  Note: subjectSources are the sources for the subjects specified.  sourceIds are if you arent specifying subjectIds, and you just want all person memberships for example.

 

Regards,

Chris



  • memberships service, Chris Hyzer, 12/19/2009

Archive powered by MHonArc 2.6.16.

Top of Page