Class AttributeDefAttributeNameValidationHook

java.lang.Object
edu.internet2.middleware.grouper.hooks.AttributeDefHooks
edu.internet2.middleware.grouper.hooks.examples.AttributeDefAttributeNameValidationHook

public class AttributeDefAttributeNameValidationHook extends AttributeDefHooks
 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 Details

  • 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

      public void attributeDefPreInsert(HooksContext hooksContext, HooksAttributeDefBean preInsertBean)
      Description copied from class: AttributeDefHooks
      called right before a attribute insert
      Overrides:
      attributeDefPreInsert in class AttributeDefHooks
      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 record
      regex - pattern string
      vetoMessage - veto message
      originalProperty - description of where the validation came from (property, etc)
    • removeAttributeNameData

      public static void removeAttributeNameData(String attributeName)
      Parameters:
      attributeName - attribute key for record
    • attributeDefPreUpdate

      public void attributeDefPreUpdate(HooksContext hooksContext, HooksAttributeDefBean preUpdateBean)
      Description copied from class: AttributeDefHooks
      called right before a attribute update
      Overrides:
      attributeDefPreUpdate in class AttributeDefHooks
      See Also:
    • clearHook

      public static void clearHook()