grouper-users - RE: [grouper-users] RE: How do I get the ESB to fire events
Subject: Grouper Users - Open Discussion List
List archive
- From: Chris Hyzer <>
- To: Jeff McCullough <>
- Cc: "Bryan E. Wooten" <>, "" <>
- Subject: RE: [grouper-users] RE: How do I get the ESB to fire events
- Date: Mon, 1 Jul 2013 20:34:35 +0000
- Accept-language: en-US
- Authentication-results: sfpop-ironport04.merit.edu; dkim=neutral (message not signed) header.i=none
Hmmm, yeah, if a group is deleted without unassigning the types, they arent in the change log. Shilen, is that the case in 2.2 with the new attributes? Here
is a patch to make it happen in 2.1.4 if you want to try it, though obviously it is experimental… insert these lines FROM:
public
void delete(final
Group _g)
throws GrouperDAOException {
HibernateSession.callbackHibernateSession( GrouperTransactionType.READ_WRITE_OR_USE_EXISTING,
AuditControl.WILL_NOT_AUDIT,
new HibernateHandler() {
public Object callback(HibernateHandlerBean hibernateHandlerBean) throws
GrouperDAOException {
hibernateHandlerBean.getHibernateSession().setCachingEnabled(false); HibernateSession hibernateSession = hibernateHandlerBean.getHibernateSession(); ByObject byObject = hibernateSession.byObject();
// delete attributes ByHql byHql = hibernateSession.byHql(); TO:
public
void delete(final
Group _g)
throws GrouperDAOException {
HibernateSession.callbackHibernateSession( GrouperTransactionType.READ_WRITE_OR_USE_EXISTING,
AuditControl.WILL_NOT_AUDIT,
new HibernateHandler() {
public Object callback(HibernateHandlerBean hibernateHandlerBean)
throws GrouperDAOException {
hibernateHandlerBean.getHibernateSession().setCachingEnabled(false); HibernateSession hibernateSession = hibernateHandlerBean.getHibernateSession(); ByObject byObject = hibernateSession.byObject();
for (String attributeName
: _g.getAttributesMap(false).keySet())
{
_g.deleteAttribute(attributeName,
false);
}
for (GroupType groupType
: _g.getTypes()) {
GrouperDAOFactory.getFactory().getGroup().deleteType( _g, groupType );
}
// delete attributes ByHql byHql = hibernateSession.byHql(); Here is a test: gsh 0% grouperSession = GrouperSession.startRootSession(); edu.internet2.middleware.grouper.GrouperSession: fc106d9d7a2d47a1843d5d0e64da7dbf,'GrouperSystem','application' gsh 1% stem = new StemSave(grouperSession).assignName("stem1").assignCreateParentStemsIfNotExist(true).save(); gsh 2% stem.grantPriv(subject, NamingPrivilege.CREATE, false); gsh 3% subject = SubjectFinder.findById("test.subject.0", true); gsh 4% GrouperSession.stopQuietly(grouperSession); gsh 5% grouperSession = GrouperSession.start(subject); gsh 6% group = new GroupSave(grouperSession).assignName("stem1:a").assignCreateParentStemsIfNotExist(true).save(); group: name='stem1:a' displayName='stem1:a' uuid='162ee8da9f3440dda48988a02e1754c6'
gsh 7% typeAdd("test") type: 'test'
gsh 8% groupAddType("stem1:a", "test") true gsh 9% group.delete(); gsh 10% loaderRunOneJob("CHANGE_LOG_changeLogTempToChangeLog");
From: Jeff McCullough [mailto:]
I'm not seeing group_type_unassigns associated with a group_delete just the membership_deletes. Do those show-up in the grouper 2.1.4 version of the api? Thanks, Jeff On Jul 1, 2013, at 12:20 PM, Chris Hyzer <> wrote:
If it is the new attribute framework you could get that through point in time auditing. If it is old or new style attributes, group type unassigns should work… Thanks Chris From: Jeff
McCullough [mailto:jeffmc@berkeley.edu] When a group is deleted, the grouper change log will show membership deletes then the group delete. Is there a way to know which group types the group had before it was deleted? Probably it would be group type unassigns, but maybe there
is something there already. Thanks, Jeff On Jun 30, 2013, at 7:46 PM, Chris Hyzer <> wrote:
I got this to work with the api binary: Configure in grouper-loader.properties changeLog.consumer.esb.class = edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbConsumer #run every minute changeLog.consumer.esb.quartzCron = 0 * * * * ? changeLog.consumer.esb.elfilter = event.eventType eq 'GROUP_DELETE' || event.eventType eq 'GROUP_ADD' || event.eventType eq 'MEMBERSHIP_DELETE' || event.eventType
eq 'MEMBERSHIP_ADD' changeLog.consumer.esb.publisher.class = edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbHttpPublisher changeLog.consumer.esb.publisher.url =" http://localhost:8100/whatever/something Copy the grouper/lib/jetty/jetty.jar and jetty-lib.jar to grouper/lib/grouper Run the loader: gsh -loader See this event at the HTTP endpoint POST /whatever/something HTTP/1.1 Content-Type: application/json; charset=utf-8 User-Agent: Jakarta Commons-HttpClient/3.0 Host: localhost:8100 Content-Length: 218 {"esbEvent":[ {"displayName":"etc:rulesActAsGroup","eventType":"GROUP_ADD","id":"c0660833739147d996edf35ec0418398","name":"etc:rulesActAsGroup","parentStemId":"453bc7000061473aa9a0f00d0f67c62e","sequenceNumber":"319"} ]} Thanks, Chris From: Bryan
E. Wooten [mailto:bryan.wooten@utah.edu] Ok, I discovered that when I build grouper by hand I get a lib/jetty directory in the api. So created this dir with the 3 jars in my quick start installation. I then edited gsh.sh and added: #UofU - Add jars to support ESB GROUPER_CP=${GROUPER_CP}:${GROUPER_HOME}/lib/jetty/* But I am still getting the same class not found error. ? -Bryan From: [] On
Behalf Of Bryan E. Wooten Thanks for the tip. That is the right name, but now I am getting this error: loader ran successfully: Error: Error processing record 134909, sequenceNumber: 134909, java.lang.RuntimeException: Problem loading class: edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbHttpPublisher at edu.internet2.middleware.grouper.util.GrouperUtil.forName(GrouperUtil.java:1592) at edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbConsumer.processChangeLogEntries(EsbConsumer.java:513) at edu.internet2.middleware.grouper.changeLog.ChangeLogHelper.processRecords(ChangeLogHelper.java:242) . . . at edu.internet2.middleware.grouper.app.gsh.GrouperShellWrapper.main(GrouperShellWrapper.java:31) Caused by: java.lang.NoClassDefFoundError: org/mortbay/jetty/HttpException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at edu.internet2.middleware.grouper.util.GrouperUtil.forName(GrouperUtil.java:1590) ... 26 more Caused by: java.lang.ClassNotFoundException: org.mortbay.jetty.HttpException I assume I am missing some jar file in the api/lib/grouper directory? I didn’t see anything about this in the wiki. Thanks, Bryan From: Chris
Hyzer [] Look in the database in the loader log table, and see the job name for it, and use that. In this case it should be: CHANGE_LOG_consumer_httpTestGroup Thanks, Chris From: [] On
Behalf Of Bryan E. Wooten I have simple server listening on port 80 and added the following to my grouper-loader.properties: changeLog.consumer.httpTestGroup.class = edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbConsumer changeLog.consumer.httpTestGroup.elfilter = event.eventType eq 'MEMBERSHIP_DELETE' || event.eventType eq 'MEMBERSHIP_ADD || event.eventType eq 'GROUP_DELETE' || event.eventType
eq 'GROUP_ADD' changeLog.consumer.httpTestGroup.publisher.class = edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbHttpPublisher changeLog.consumer.httpTestGroup.publisher.url =" http://localhost:80 I think I need to run loaderRunOneJob("CHANGE_LOG_changeLogTempToChangeLog") And then run: loaderRunOneJob("CHANGE_LOG_something”) I just don’t know what “something” should be. Any help appreciated. -Bryan |
- Re: [grouper-users] RE: How do I get the ESB to fire events, Jeff McCullough, 07/01/2013
- RE: [grouper-users] RE: How do I get the ESB to fire events, Chris Hyzer, 07/01/2013
- Re: [grouper-users] RE: How do I get the ESB to fire events, Jeff McCullough, 07/01/2013
- RE: [grouper-users] RE: How do I get the ESB to fire events, Chris Hyzer, 07/01/2013
- Re: [grouper-users] RE: How do I get the ESB to fire events, Shilen Patel, 07/01/2013
- RE: [grouper-users] RE: How do I get the ESB to fire events, Chris Hyzer, 07/01/2013
- Re: [grouper-users] RE: How do I get the ESB to fire events, Jeff McCullough, 07/01/2013
- <Possible follow-up(s)>
- [grouper-users] Re: How do I get the ESB to fire events, Bryan E. Wooten, 07/01/2013
- RE: [grouper-users] RE: How do I get the ESB to fire events, Chris Hyzer, 07/01/2013
Archive powered by MHonArc 2.6.16.