Class GrouperHooksUtils

java.lang.Object
edu.internet2.middleware.grouper.hooks.logic.GrouperHooksUtils

public class GrouperHooksUtils extends Object
utils for grouper hooks
  • Constructor Details

    • GrouperHooksUtils

      public GrouperHooksUtils()
  • Method Details

    • fireGrouperStartupHooksIfNotFiredAlready

      public static void fireGrouperStartupHooksIfNotFiredAlready()
      kick off startup hooks if not done already
    • addHookManual

      public static void addHookManual(String propertyFileKey, Class<?> hooksClass)
      add a hook to the list of configured hooks for this type note if the class already exists it will not be added again
      Parameters:
      propertyFileKey -
      hooksClass -
    • callHooksIfRegistered

      public static void callHooksIfRegistered(Object object, GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object businessObject, Class businessClass, VetoType vetoType, boolean resetDbVersion, boolean clearDbVersion) throws HookVeto
      Parameters:
      object - that the hook is about
      grouperHookTypeInterface - e.g. GrouperHookType.GROUP
      hookMethodName - is method name in hook to call e.g. groupPreInsert
      hooksBeanClass - e.g. HooksGroupPreInsertBean.class
      businessObject - are the intances to pass to bean constructor. e.g. group
      businessClass - are the types passed to bean constructor. e.g. Group.class
      vetoType - is default vetoType, e.g. VetoTypeGrouper.GROUP_PRE_INSERT
      resetDbVersion - if the db version should be saved, assigned, reset, etc (for low level hooks)
      clearDbVersion - if the db version should be cleared (e.g. on delete) (for low level hooks)
      Throws:
      HookVeto - if there is a veto (if applicable)
    • callHooksIfRegistered

      public static void callHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object[] businessObjects, Class[] businessClasses, VetoType vetoType) throws HookVeto
      Parameters:
      grouperHookTypeInterface - e.g. GrouperHookType.GROUP
      hookMethodName - is method name in hook to call e.g. groupPreInsert
      hooksBeanClass - e.g. HooksGroupPreInsertBean.class
      businessObjects - are the intances to pass to bean constructor. e.g. group
      businessClasses - are the types passed to bean constructor. e.g. Group.class
      vetoType - is default vetoType, e.g. VetoTypeGrouper.GROUP_PRE_INSERT
      Throws:
      HookVeto - if there is a veto (if applicable)
    • callHooksIfRegistered

      public static void callHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object businessObject, Class businessClass, VetoType vetoType) throws HookVeto
      Parameters:
      grouperHookTypeInterface - e.g. GrouperHookType.GROUP
      hookMethodName - is method name in hook to call e.g. groupPreInsert
      hooksBeanClass - e.g. HooksGroupPreInsertBean.class
      businessObject - are the intances to pass to bean constructor. e.g. group
      businessClass - are the types passed to bean constructor. e.g. Group.class
      vetoType - is default vetoType, e.g. VetoTypeGrouper.GROUP_PRE_INSERT
      Throws:
      HookVeto - if there is a veto (if applicable)
    • callHooksIfRegistered

      public static void callHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, HooksBean hooksBean, VetoType vetoType) throws HookVeto
      Parameters:
      grouperHookTypeInterface - e.g. GrouperHookType.GROUP
      hookMethodName - is method name in hook to call e.g. groupPreInsert
      hooksBean - hooks bean
      vetoType - is default vetoType, e.g. VetoTypeGrouper.GROUP_PRE_INSERT
      Throws:
      HookVeto - if there is a veto (if applicable)
    • callHooksIfRegistered

      public static void callHooksIfRegistered(Object object, GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object[] businessObjects, Class[] businessClasses, VetoType vetoType, boolean resetDbVersion, boolean clearDbVersion) throws HookVeto
      Parameters:
      object - that the hook is about
      grouperHookTypeInterface - e.g. GrouperHookType.GROUP
      hookMethodName - is method name in hook to call e.g. groupPreInsert
      hooksBeanClass - e.g. HooksGroupPreInsertBean.class
      businessObjects - are the intances to pass to bean constructor. e.g. group
      businessClasses - are the types passed to bean constructor. e.g. Group.class
      vetoType - is default vetoType, e.g. VetoTypeGrouper.GROUP_PRE_INSERT
      resetDbVersion - if the db version should be saved, assigned, reset, etc (for low level hooks)
      clearDbVersion - if the db version should be cleared (e.g. on delete) (for low level hooks)
      Throws:
      HookVeto - if there is a veto (if applicable)
    • schedulePostCommitHooksIfRegistered

      public static void schedulePostCommitHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object businessObject, Class businessClass)
      if there are hooks available, schedule the post commit call
      Parameters:
      grouperHookTypeInterface - e.g. GrouperHookType.GROUP
      hookMethodName - is method name in hook to call e.g. groupPreInsert
      hooksBeanClass - e.g. HooksGroupPreInsertBean.class
      businessObject - are the intances to pass to bean constructor. e.g. group
      businessClass - are the types passed to bean constructor. e.g. Group.class
      Throws:
      HookVeto - if there is a veto (if applicable)
    • schedulePostCommitHooksIfRegistered

      public static void schedulePostCommitHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, HooksBean hooksBean)
      if there are hooks available, schedule the post commit call
      Parameters:
      grouperHookTypeInterface - e.g. GrouperHookType.GROUP
      hookMethodName - is method name in hook to call e.g. groupPreInsert
      hooksBean - as argument to hook
      Throws:
      HookVeto - if there is a veto (if applicable)
    • schedulePostCommitHooksIfRegistered

      public static void schedulePostCommitHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object[] businessObjects, Class[] businessClasses)
      if there are hooks available, schedule the post commit call
      Parameters:
      grouperHookTypeInterface - e.g. GrouperHookType.GROUP
      hookMethodName - is method name in hook to call e.g. groupPreInsert
      hooksBeanClass - e.g. HooksGroupPreInsertBean.class
      businessObjects - are the intances to pass to bean constructor. e.g. group
      businessClasses - are the types passed to bean constructor. e.g. Group.class
      Throws:
      HookVeto - if there is a veto (if applicable)
    • reloadHooks

      public static void reloadHooks()
      clear out hooks and reloader (e.g. for testing)