edu.internet2.middleware.grouper.hooks.logic
Class GrouperHooksUtils

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

public class GrouperHooksUtils
extends Object

utils for grouper hooks


Constructor Summary
GrouperHooksUtils()
           
 
Method Summary
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
static void callHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object[] businessObjects, Class[] businessClasses, VetoType vetoType)
           
static void callHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object businessObject, Class businessClass, VetoType vetoType)
           
static void callHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, HooksBean hooksBean, VetoType vetoType)
           
static void callHooksIfRegistered(Object object, GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object[] businessObjects, Class[] businessClasses, VetoType vetoType, boolean resetDbVersion, boolean clearDbVersion)
           
static void callHooksIfRegistered(Object object, GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object businessObject, Class businessClass, VetoType vetoType, boolean resetDbVersion, boolean clearDbVersion)
           
static void fireGrouperStartupHooksIfNotFiredAlready()
          kick off startup hooks if not done already
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
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
static void schedulePostCommitHooksIfRegistered(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, HooksBean hooksBean)
          if there are hooks available, schedule the post commit call
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrouperHooksUtils

public GrouperHooksUtils()
Method Detail

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)