Class UpgradeTask911MigrateOldEvents

java.lang.Object
com.atlassian.crowd.upgrade.tasks.UpgradeTask911MigrateOldEvents
All Implemented Interfaces:
UpgradeTask

public class UpgradeTask911MigrateOldEvents extends Object implements UpgradeTask
Crowd 3.2 introduces a new audit log event syntax where the event that an audit log represents is a combination of an entity type (noun) and an event type (verb). Such an approach turned out to be problematic with events with multiple entities (such as membership events), both for determining what happened in the given event and with querying. This upgrade task migrates existing audit log events to the Crowd 3.2 format wherever possible. The migration affects only events generated by Crowd. The mapping is as follows:
  • events with entity type CONFIGURATION and event type MODIFIED become events with event type CONFIGURATION_MODIFIED
  • events with entity type RESTORE and event type STARTED become events with event type RESTORE_STARTED
  • events with entity type RESTORE and event type COMPLETED become events with event type RESTORE_FINISHED
  • events with entity type APPLICATION and event type CREATED become events with event type APPLICATION_CREATED
  • events with entity type APPLICATION and event type MODIFIED become events with event type APPLICATION_UPDATED
  • events with entity type APPLICATION and event type DELETED become events with event type APPLICATION_DELETED
  • events with entity type DIRECTORY and event type CREATED become events with event type DIRECTORY_CREATED
  • events with entity type DIRECTORY and event type MODIFIED become events with event type DIRECTORY_UPDATED
  • events with entity type DIRECTORY and event type DELETED become events with event type DIRECTORY_DELETED
The placeholder entities of types CONFIGURATION and RESTORE are no longer needed as the event types for configuration and restore events are self sufficient.
  • Field Details

  • Constructor Details

    • UpgradeTask911MigrateOldEvents

      public UpgradeTask911MigrateOldEvents(UpgradeUtilityDAOHibernate upgradeUtilityDAOHibernate, org.hibernate.SessionFactory sessionFactory)
  • Method Details

    • getBuildNumber

      public int getBuildNumber()
      Specified by:
      getBuildNumber in interface UpgradeTask
      Returns:
      The build number that this upgrade is applicable to.
    • getShortDescription

      public String getShortDescription()
      Description copied from interface: UpgradeTask
      A short (less than 50 chars) description of the upgrade action
      Specified by:
      getShortDescription in interface UpgradeTask
      Returns:
      description of upgrade task.
    • doUpgrade

      public void doUpgrade() throws Exception
      Description copied from interface: UpgradeTask
      Perform the upgrade.
      Specified by:
      doUpgrade in interface UpgradeTask
      Throws:
      Exception - is thrown if any errors occur during the upgrade process.