Class GrouperHooksUtils
java.lang.Object
edu.internet2.middleware.grouper.hooks.logic.GrouperHooksUtils
utils for grouper hooks
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 againstatic void
callHooksIfRegistered
(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, HooksBean hooksBean, VetoType vetoType) 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
(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
kick off startup hooks if not done alreadystatic void
clear out hooks and reloader (e.g.static void
schedulePostCommitHooksIfRegistered
(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, HooksBean hooksBean) if there are hooks available, schedule the post commit callstatic void
schedulePostCommitHooksIfRegistered
(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object[] businessObjects, Class[] businessClasses) if there are hooks available, schedule the post commit callstatic void
schedulePostCommitHooksIfRegistered
(GrouperHookTypeInterface grouperHookTypeInterface, String hookMethodName, Class<? extends HooksBean> hooksBeanClass, Object businessObject, Class businessClass) if there are hooks available, schedule the post commit call
-
Constructor Details
-
GrouperHooksUtils
public GrouperHooksUtils()
-
-
Method Details
-
fireGrouperStartupHooksIfNotFiredAlready
public static void fireGrouperStartupHooksIfNotFiredAlready()kick off startup hooks if not done already -
addHookManual
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 aboutgrouperHookTypeInterface
- e.g. GrouperHookType.GROUPhookMethodName
- is method name in hook to call e.g. groupPreInserthooksBeanClass
- e.g. HooksGroupPreInsertBean.classbusinessObject
- are the intances to pass to bean constructor. e.g. groupbusinessClass
- are the types passed to bean constructor. e.g. Group.classvetoType
- is default vetoType, e.g. VetoTypeGrouper.GROUP_PRE_INSERTresetDbVersion
- 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.GROUPhookMethodName
- is method name in hook to call e.g. groupPreInserthooksBeanClass
- e.g. HooksGroupPreInsertBean.classbusinessObjects
- are the intances to pass to bean constructor. e.g. groupbusinessClasses
- are the types passed to bean constructor. e.g. Group.classvetoType
- 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.GROUPhookMethodName
- is method name in hook to call e.g. groupPreInserthooksBeanClass
- e.g. HooksGroupPreInsertBean.classbusinessObject
- are the intances to pass to bean constructor. e.g. groupbusinessClass
- are the types passed to bean constructor. e.g. Group.classvetoType
- 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.GROUPhookMethodName
- is method name in hook to call e.g. groupPreInserthooksBean
- hooks beanvetoType
- 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 aboutgrouperHookTypeInterface
- e.g. GrouperHookType.GROUPhookMethodName
- is method name in hook to call e.g. groupPreInserthooksBeanClass
- e.g. HooksGroupPreInsertBean.classbusinessObjects
- are the intances to pass to bean constructor. e.g. groupbusinessClasses
- are the types passed to bean constructor. e.g. Group.classvetoType
- is default vetoType, e.g. VetoTypeGrouper.GROUP_PRE_INSERTresetDbVersion
- 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.GROUPhookMethodName
- is method name in hook to call e.g. groupPreInserthooksBeanClass
- e.g. HooksGroupPreInsertBean.classbusinessObject
- are the intances to pass to bean constructor. e.g. groupbusinessClass
- 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.GROUPhookMethodName
- is method name in hook to call e.g. groupPreInserthooksBean
- 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.GROUPhookMethodName
- is method name in hook to call e.g. groupPreInserthooksBeanClass
- e.g. HooksGroupPreInsertBean.classbusinessObjects
- are the intances to pass to bean constructor. e.g. groupbusinessClasses
- 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)
-