Class GroupServiceInitializer

java.lang.Object
org.dspace.storage.rdbms.GroupServiceInitializer
All Implemented Interfaces:
org.flywaydb.core.api.callback.Callback

public class GroupServiceInitializer extends Object implements org.flywaydb.core.api.callback.Callback
Callback method to ensure that the default groups are created in the database AFTER the database migration completes.
Author:
kevinvandevelde at atmire.com
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected GroupService
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canHandleInTransaction(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)
    Whether event can be handled in a transaction or whether it must be handle outside of transaction.
    The callback name, Flyway will use this to sort the callbacks alphabetically before executing them
    void
    handle(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)
    What to run when the callback is triggered.
    void
     
    boolean
    supports(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)
    Events supported by this callback.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • GroupServiceInitializer

      public GroupServiceInitializer()
  • Method Details

    • initGroups

      public void initGroups()
    • getCallbackName

      public String getCallbackName()
      The callback name, Flyway will use this to sort the callbacks alphabetically before executing them
      Specified by:
      getCallbackName in interface org.flywaydb.core.api.callback.Callback
      Returns:
      The callback name
    • supports

      public boolean supports(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)
      Events supported by this callback.
      Specified by:
      supports in interface org.flywaydb.core.api.callback.Callback
      Parameters:
      event - Flyway event
      context - Flyway context
      Returns:
      true if AFTER_MIGRATE event
    • canHandleInTransaction

      public boolean canHandleInTransaction(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)
      Whether event can be handled in a transaction or whether it must be handle outside of transaction.
      Specified by:
      canHandleInTransaction in interface org.flywaydb.core.api.callback.Callback
      Parameters:
      event - Flyway event
      context - Flyway context
      Returns:
      true
    • handle

      public void handle(org.flywaydb.core.api.callback.Event event, org.flywaydb.core.api.callback.Context context)
      What to run when the callback is triggered.
      Specified by:
      handle in interface org.flywaydb.core.api.callback.Callback
      Parameters:
      event - Flyway event
      context - Flyway context