Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] Detecting membership changes

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] Detecting membership changes


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Julio Polo <>
  • Cc: "" <>
  • Subject: RE: [grouper-users] Detecting membership changes
  • Date: Sat, 8 Oct 2011 04:17:02 +0000
  • Accept-language: en-US

Looks good to me, though there is an issue with the change log in 2.0, which
maybe Shilen can reply and say if he thinks this is that issue. If there is
not a workaround, I think we might need to release a 2.0.1... Shilen, let us
know

Thanks,
Chris

-----Original Message-----
From: Julio Polo
[mailto:]

Sent: Friday, October 07, 2011 11:42 PM
To: Chris Hyzer
Cc:

Subject: Re: [grouper-users] Detecting membership changes

Thanks Chris. I am giving rules a try, but i get this error when I
try to mimic the GSH test case for emailOnFlattenedMembershipRemove.
Here's the gsh session:

gsh 0% grouperSession = GrouperSession.startRootSession();

gsh 1% new
GrouperEmail().setTo("").setBody("email
body").setSubject("email subject").send();
// received above test email

gsh 3% group = GroupFinder.findByName (
grouperSession, "test:julio:personnel-officers" )

gsh 4%
RuleApi.emailOnFlattenedMembershipRemove(SubjectFinder.findRootSubject(),
group,
"",
"Will remove ${safeSubject.emailAddress}
from group ${groupDisplayExtension}", "template:
testEmailGroupBodyFlattenedRemove");
edu.internet2.middleware.grouper.attr.assign.AttributeAssign:
AttributeAssign[id=c3c1b5b3ec7c4540a687f7956f99ec2d,action=assign,attributeDefName=etc:attribute:rules:rule,

group=Group[name=test:julio:personnel-officers,uuid=60e26667f2ce44d5841d9be97e3d04a5]]

gsh 5%
edu.internet2.middleware.grouper.app.loader.GrouperLoader.runOnceByJobName(grouperSession,
"CHANGE_LOG_changeLogTempToChangeLog");
// Error: unable to evaluate command: Sourced file: inline
evaluation of:
``edu.internet2.middleware.grouper.app.loader.GrouperLoader.runOnceByJobName(group
. . . '' : Method Invocation
edu.internet2.middleware.grouper.app.loader.GrouperLoader.runOnceByJobName
// See error log for full stacktrace
// caused by: java.lang.RuntimeException:
// edu.internet2.middleware.grouper.internal.dao.GrouperDAOException:
Problem in HibernateSession: HibernateSession: isNew: false,
isReadonly: false, grouperTransactionType: READ_WRITE_NEW,
Exception in saveOrUpdate:
edu.internet2.middleware.grouper.pit.PITMembership, ByObjectStatic,
query: ', cacheable: null, cacheRegion: null, entityName: null, tx
type: null,
Problem in HibernateSession: HibernateSession: isNew: true,
isReadonly: false, grouperTransactionType: READ_WRITE_NEW
// caused by:
edu.internet2.middleware.grouper.internal.dao.GrouperDAOException:
// Problem in HibernateSession: HibernateSession: isNew: false,
isReadonly: false, grouperTransactionType: READ_WRITE_NEW,
Exception in saveOrUpdate:
edu.internet2.middleware.grouper.pit.PITMembership, ByObjectStatic,
query: ', cacheable: null, cacheRegion: null, entityName: null, tx
type: null,
Problem in HibernateSession: HibernateSession: isNew: true,
isReadonly: false, grouperTransactionType: READ_WRITE_NEW
// caused by: org.hibernate.exception.ConstraintViolationException:
// Could not execute JDBC batch update,
Exception in save:
edu.internet2.middleware.grouper.pit.PITMembership,
edu.internet2.middleware.grouper.hibernate.ByObject@715d1298
// caused by: java.sql.BatchUpdateException:
// Duplicate entry '' for key 'PRIMARY'


We recently installed this instance of Grouper 2.0. the
grouper-loader.properties shows this:

#rules consumer, needed for some of the Grouper rule types to run
(e.g. flattenedMembershipRemove, flattenedMembershipAdd)
changeLog.consumer.grouperRules.class =
edu.internet2.middleware.grouper.changeLog.esb.consumer.RuleConsumer
changeLog.consumer.grouperRules.quartzCron =

and changeLog is enabled in grouper.properties.

What did we miss?

Julio Polo
Identity and Access Management
University of Hawaii



On Fri, Oct 7, 2011 at 10:32 AM, Chris Hyzer
<>
wrote:
> We have the last membership changed in the DB, but we don't expose over WS,
> I supposed we could in a later version.
>
> If you have 2.0, there is a rule for email notifications:
>
> https://spaces.internet2.edu/display/Grouper/Grouper+rules+use+case+-+Email+notification+on+flattened+membership+remove
>
> You could need a rule for add, and a rule for remove.  Note you can have
> this work for all groups in a folder with one rule.
>
> Also, (applies to pre-2.0), you could use the change log to send an event
> somewhere (e.g. xmpp or ws), or send them email directly from the change
> log consumer.  This would be very easy to setup and I could send you a code
> example if you need it.   Just send me the exact requirements.
>
> Generally the architecture of the change log allows us to avoid polling via
> ws (has the membership changed?  Has the membership changed?  Has the
> memberships changed? Etc) which is why it might not be ideal to add to the
> WS api :)
>
> Thanks,
> Chris
>
> -----Original Message-----
> From:
>
>
> [mailto:]
> On Behalf Of Julio Polo
> Sent: Friday, October 07, 2011 4:05 PM
> To:
>
> Subject: [grouper-users] Detecting membership changes
>
> Is there a web service for detecting whether members have been added
> or removed from a group?  I'm contemplating an application that sends
> us email whenever someone is added or removed from a group.  Is the
> audit functionality the best way to achieve this?  I didn't see a web
> service for it, though.  Or shall we just do a periodic dump of the
> entire membership and diff for changes?
>
> Julio Polo
> Identity and Access Management
> University of Hawaii
>



Archive powered by MHonArc 2.6.16.

Top of Page