Class AttributeDefAttributeNameValidationHook
java.lang.Object
edu.internet2.middleware.grouper.hooks.AttributeDefHooks
edu.internet2.middleware.grouper.hooks.examples.AttributeDefAttributeNameValidationHook
built in hook to grouper, which is turned on when it is configured in the grouper.properties. you can retrict certain attributes of a attribute def to be within a certain regex
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
for unit testsstatic final String
for unit testsFields inherited from class edu.internet2.middleware.grouper.hooks.AttributeDefHooks
METHOD_ATTRIBUTE_DEF_POST_COMMIT_DELETE, METHOD_ATTRIBUTE_DEF_POST_COMMIT_INSERT, METHOD_ATTRIBUTE_DEF_POST_COMMIT_UPDATE, METHOD_ATTRIBUTE_DEF_POST_DELETE, METHOD_ATTRIBUTE_DEF_POST_INSERT, METHOD_ATTRIBUTE_DEF_POST_UPDATE, METHOD_ATTRIBUTE_DEF_PRE_DELETE, METHOD_ATTRIBUTE_DEF_PRE_INSERT, METHOD_ATTRIBUTE_DEF_PRE_UPDATE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAttributeNameData
(String attributeName, String regex, String vetoMessage, String originalProperty) Add a custom validator after Grouper startup (mainly used for test classes)void
attributeDefPreInsert
(HooksContext hooksContext, HooksAttributeDefBean preInsertBean) called right before a attribute insertvoid
attributeDefPreUpdate
(HooksContext hooksContext, HooksAttributeDefBean preUpdateBean) called right before a attribute updatestatic void
static void
registerHookIfNecessary
(boolean addTestValidation) see if this is configured in the grouper.properties, if so, register this hookstatic void
removeAttributeNameData
(String attributeName) Methods inherited from class edu.internet2.middleware.grouper.hooks.AttributeDefHooks
attributeDefPostCommitDelete, attributeDefPostCommitInsert, attributeDefPostCommitUpdate, attributeDefPostDelete, attributeDefPostInsert, attributeDefPostUpdate, attributeDefPreDelete
-
Field Details
-
TEST_ATTRIBUTE_NAME
for unit tests- See Also:
-
TEST_PATTERN
for unit tests- See Also:
-
-
Constructor Details
-
AttributeDefAttributeNameValidationHook
public AttributeDefAttributeNameValidationHook()
-
-
Method Details
-
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
-
attributeDefPreInsert
Description copied from class:AttributeDefHooks
called right before a attribute insert- Overrides:
attributeDefPreInsert
in classAttributeDefHooks
- See Also:
-
edu.internet2.middleware.grouper.hooks.AttributeDefHooks#attributeDefPreInsert(edu.internet2.middleware.grouper.hooks.beans.HooksContext, edu.internet2.middleware.grouper.hooks.beans.HooksGroupBean)
-
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
-
attributeDefPreUpdate
Description copied from class:AttributeDefHooks
called right before a attribute update -
clearHook
public static void clearHook()
-