Skip to Content.
Sympa Menu

grouper-dev - RE: [grouper-dev] MembershipHooks high vs not high level hooks

Subject: Grouper Developers Forum

List archive

RE: [grouper-dev] MembershipHooks high vs not high level hooks


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Colin Hudler <>
  • Cc: "" <>
  • Subject: RE: [grouper-dev] MembershipHooks high vs not high level hooks
  • Date: Thu, 25 Jun 2009 16:00:47 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US

Im not sure I understand why you would use this hook and not
membershipPostCommitInsert and membershipPostCommitDelete?

Also, if notifications / change log existed in 2.4, you would use that right?


Thanks!
Chris

> This hook notifies a udp listener of membership changes. The listener
> then takes action, in this case, updating an LDAP database.
>
> I registered two hooks.
>
> membershipPostCommitRemoveMember
> membershipPostCommitAddMember
>
> I could not easily predict when the hooks would fire, so it is their
> job
> to filter the event before notifying. Please forgive this crude code
> fragment, but I think it illustrates what I am doing:
>
> Set memberships = postCommitBeanThread.getMembershipEffectiveSaves();
> memberships.addAll(postCommitBeanThread.getMembershipImmediateSaves());
> Iterator memberator = memberships.iterator();
> while (memberator.hasNext()) {
> Membership membership = (Membership) memberator.next();
> String listName = membership.getListName();
> if (!listName.equals("members")) { memberator.next(); continue; }
> // Proceed to process this event...
>
>
> This works well so far.



Archive powered by MHonArc 2.6.16.

Top of Page