Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-430

id and membershipType unavailable on MEMERSHIP_ADD and MEMBERSHIP_DELETE changeLog events

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.6.0
    • Component/s: API
    • Labels:
      None
    • Environment:
      Running 6622 from SVN

      Description

      Code from EsbConsumer:

      <snip>
      if (changeLogEntry.equalsCategoryAndAction(ChangeLogTypeBuiltin.MEMBERSHIP_ADD)) {
      if(LOG.isDebugEnabled())

      { LOG.debug("Event is MEMBERSHIP_ADD"); }

      event.setEventType("MEMBERSHIP_ADD");
      // throws error
      event.setId(this.getLabelValue(changeLogEntry, ChangeLogLabels.MEMBERSHIP_ADD.id));
      event.setFieldName(this.getLabelValue(changeLogEntry, ChangeLogLabels.MEMBERSHIP_ADD.fieldName));
      event.setSubjectId(this.getLabelValue(changeLogEntry, ChangeLogLabels.MEMBERSHIP_ADD.subjectId));
      event.setSourceId(this.getLabelValue(changeLogEntry, ChangeLogLabels.MEMBERSHIP_ADD.sourceId));
      // throws error
      event.setMembershipType(this.getLabelValue(changeLogEntry, ChangeLogLabels.MEMBERSHIP_ADD.membershipType));
      event.setGroupId(this.getLabelValue(changeLogEntry, ChangeLogLabels.MEMBERSHIP_ADD.groupId));
      event.setGroupName(this.getLabelValue(changeLogEntry, ChangeLogLabels.MEMBERSHIP_ADD.groupName));

      }
      </snip>

      getLabelValue function:

      <snip>
      private String getLabelValue(ChangeLogEntry changeLogEntry, ChangeLogLabel changeLogLabel) {
      try

      { return changeLogEntry.retrieveValueForLabel(changeLogLabel); }

      catch (Exception e) {
      //cannot get value for label
      if(LOG.isDebugEnabled())

      { LOG.debug("Cannot get value for label: " + changeLogLabel.name()); e.printStackTrace(); }

      return null;
      }
      }
      </snip>

      Errors thrown when event is raised from changeLog:

      java.lang.RuntimeException: Cant find label 'id' for type: ChangeLog type: membership: addMembership
      at edu.internet2.middleware.grouper.changeLog.ChangeLogType.retrieveChangeLogEntryFieldForLabel(ChangeLogType.java:217)
      at edu.internet2.middleware.grouper.changeLog.ChangeLogEntry.retrieveValueForLabel(ChangeLogEntry.java:365)
      at edu.internet2.middleware.grouper.changeLog.ChangeLogEntry.retrieveValueForLabel(ChangeLogEntry.java:352)
      at edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbConsumer.getLabelValue(EsbConsumer.java:363)
      at edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbConsumer.processChangeLogEntries(EsbConsumer.java:159)
      at edu.internet2.middleware.grouper.app.loader.GrouperLoaderType$4.runJob(GrouperLoaderType.java:802)
      at edu.internet2.middleware.grouper.app.loader.GrouperLoaderJob.runJob(GrouperLoaderJob.java:329)
      at edu.internet2.middleware.grouper.app.loader.GrouperLoaderJob.execute(GrouperLoaderJob.java:232)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      java.lang.RuntimeException: Cant find label 'membershipType' for type: ChangeLog type: membership: addMembership
      at edu.internet2.middleware.grouper.changeLog.ChangeLogType.retrieveChangeLogEntryFieldForLabel(ChangeLogType.java:217)
      at edu.internet2.middleware.grouper.changeLog.ChangeLogEntry.retrieveValueForLabel(ChangeLogEntry.java:365)
      at edu.internet2.middleware.grouper.changeLog.ChangeLogEntry.retrieveValueForLabel(ChangeLogEntry.java:352)
      at edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbConsumer.getLabelValue(EsbConsumer.java:363)
      at edu.internet2.middleware.grouper.changeLog.esb.consumer.EsbConsumer.processChangeLogEntries(EsbConsumer.java:164)
      at edu.internet2.middleware.grouper.app.loader.GrouperLoaderType$4.runJob(GrouperLoaderType.java:802)
      at edu.internet2.middleware.grouper.app.loader.GrouperLoaderJob.runJob(GrouperLoaderJob.java:329)
      at edu.internet2.middleware.grouper.app.loader.GrouperLoaderJob.execute(GrouperLoaderJob.java:232)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              tom.barton.2@at.internet2.edu Tom Barton
              Reporter:
              robhebron Rob Hebron (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: