Class StemAttributeNameValidationHook
java.lang.Object
edu.internet2.middleware.grouper.hooks.StemHooks
edu.internet2.middleware.grouper.hooks.examples.StemAttributeNameValidationHook
built in hook to grouper, which is turned on when it is configured in the grouper.properties. you can retrict certain attributes of a stem to be within a certain regex
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringfor unit testsstatic final Stringfor unit testsFields inherited from class edu.internet2.middleware.grouper.hooks.StemHooks
METHOD_STEM_POST_COMMIT_DELETE, METHOD_STEM_POST_COMMIT_INSERT, METHOD_STEM_POST_COMMIT_UPDATE, METHOD_STEM_POST_DELETE, METHOD_STEM_POST_INSERT, METHOD_STEM_POST_UPDATE, METHOD_STEM_PRE_DELETE, METHOD_STEM_PRE_INSERT, METHOD_STEM_PRE_UPDATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAttributeNameData(String attributeName, String regex, String vetoMessage, String originalProperty) Add a custom validator after Grouper startup (mainly used for test classes)static voidstatic voidregisterHookIfNecessary(boolean addTestValidation) see if this is configured in the grouper.properties, if so, register this hookstatic voidremoveAttributeNameData(String attributeName) voidstemPreInsert(HooksContext hooksContext, HooksStemBean preInsertBean) called right before a stem insertvoidstemPreUpdate(HooksContext hooksContext, HooksStemBean preUpdateBean) called right before a stem updateMethods inherited from class edu.internet2.middleware.grouper.hooks.StemHooks
stemPostCommitDelete, stemPostCommitInsert, stemPostCommitUpdate, stemPostDelete, stemPostInsert, stemPostUpdate, stemPreDelete
-
Field Details
-
TEST_ATTRIBUTE_NAME
for unit tests- See Also:
-
TEST_PATTERN
for unit tests- See Also:
-
-
Constructor Details
-
StemAttributeNameValidationHook
public StemAttributeNameValidationHook()
-
-
Method Details
-
clearHook
public static void clearHook() -
registerHookIfNecessary
public static void registerHookIfNecessary(boolean addTestValidation) see if this is configured in the grouper.properties, if so, register this hook- Parameters:
addTestValidation- if a test validation should be added
-
stemPreInsert
Description copied from class:StemHookscalled right before a stem insert -
addAttributeNameData
public static void addAttributeNameData(String attributeName, String regex, String vetoMessage, String originalProperty) Add a custom validator after Grouper startup (mainly used for test classes)- Parameters:
attributeName- attribute key for recordregex- pattern stringvetoMessage- veto messageoriginalProperty- description of where the validation came from (property, etc)
-
removeAttributeNameData
- Parameters:
attributeName- attribute key for record
-
stemPreUpdate
Description copied from class:StemHookscalled right before a stem update
-