Skip to Content.
Sympa Menu

grouper-dev - [grouper-dev] Additional change log events for group deletion

Subject: Grouper Developers Forum

List archive

[grouper-dev] Additional change log events for group deletion


Chronological Thread 
  • From: Peter DiCamillo <>
  • To:
  • Subject: [grouper-dev] Additional change log events for group deletion
  • Date: Sat, 20 Aug 2011 17:29:53 -0400

At Brown we're using group types to indicate which systems need to be provisioned with a given group. For example, we have a type "GoogleGroup" which is assigned to groups we want to provision into Google Groups. We've started to work on doing that provisioning in near real-time using the change log. When we get a group type assign event, we create the group in the corresponding system. For group membership changes, we can lookup the types for the group and determine which systems are affected. For a group type unassign event we delete the group in the corresponding system. The only problem I've found is that when a group is deleted, we have no way of knowing which systems are affected. Since the group has been deleted, the change log consumer has no way to determine which types it had.

I've experimented with a solution where the group deletion code generates group type unassign events for the types a group has before deleting the group. That works well for my needs, and I attached the svn diff for the code change. Could something along those lines be included in Grouper, or maybe some other solution?

Peter
Index: Group.java
===================================================================
--- Group.java (revision 7442)
+++ Group.java (working copy)
@@ -1198,6 +1198,18 @@
attributeAssign.delete();
}

+ // generate an unassign event for each type the group has
+ Set<GroupType> groupTypes = Group.this.getTypes();
+ for (GroupType groupType : groupTypes) {
+ //change log into temp table
+ new ChangeLogEntry(true,
ChangeLogTypeBuiltin.GROUP_TYPE_UNASSIGN,
+ ChangeLogLabels.GROUP_TYPE_UNASSIGN.id.name(), "",
+ ChangeLogLabels.GROUP_TYPE_UNASSIGN.groupId.name(),
Group.this.getUuid(),
+ ChangeLogLabels.GROUP_TYPE_UNASSIGN.groupName.name(),
Group.this.getName(),
+ ChangeLogLabels.GROUP_TYPE_UNASSIGN.typeId.name(),
groupType.getUuid(),
+ ChangeLogLabels.GROUP_TYPE_UNASSIGN.typeName.name(),
groupType.getName()).save();
+ }
+
//deletes.add(this); // ... And add the group last
for good luck
String name = Group.this.getName(); // Preserve name for
logging
GrouperDAOFactory.getFactory().getGroup().delete(Group.this);



Archive powered by MHonArc 2.6.16.

Top of Page