edu.internet2.middleware.grouper.hooks.examples
Class GroupAttributeNameValidationHook

java.lang.Object
  extended by edu.internet2.middleware.grouper.hooks.GroupHooks
      extended by edu.internet2.middleware.grouper.hooks.examples.GroupAttributeNameValidationHook

public class GroupAttributeNameValidationHook
extends GroupHooks

 built in hook to grouper, which is turned on when it is configured in the grouper.properties.
 
 you can retrict certain attributes of a group to be within a certain regex
 
 


Field Summary
static String TEST_ATTRIBUTE_NAME
          for unit tests
static String TEST_PATTERN
          for unit tests
 
Fields inherited from class edu.internet2.middleware.grouper.hooks.GroupHooks
METHOD_GROUP_POST_COMMIT_DELETE, METHOD_GROUP_POST_COMMIT_INSERT, METHOD_GROUP_POST_COMMIT_UPDATE, METHOD_GROUP_POST_DELETE, METHOD_GROUP_POST_INSERT, METHOD_GROUP_POST_UPDATE, METHOD_GROUP_PRE_DELETE, METHOD_GROUP_PRE_INSERT, METHOD_GROUP_PRE_UPDATE
 
Constructor Summary
GroupAttributeNameValidationHook()
           
 
Method Summary
 void groupPreInsert(HooksContext hooksContext, HooksGroupBean preInsertBean)
          called right before a group insert
 void groupPreUpdate(HooksContext hooksContext, HooksGroupBean preUpdateBean)
          called right before a group update
static void registerHookIfNecessary(boolean addTestValidation)
          see if this is configured in the grouper.properties, if so, register this hook
 
Methods inherited from class edu.internet2.middleware.grouper.hooks.GroupHooks
groupPostCommitDelete, groupPostCommitInsert, groupPostCommitUpdate, groupPostDelete, groupPostInsert, groupPostUpdate, groupPreDelete
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_ATTRIBUTE_NAME

public static final String TEST_ATTRIBUTE_NAME
for unit tests

See Also:
Constant Field Values

TEST_PATTERN

public static final String TEST_PATTERN
for unit tests

See Also:
Constant Field Values
Constructor Detail

GroupAttributeNameValidationHook

public GroupAttributeNameValidationHook()
Method Detail

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

groupPreInsert

public void groupPreInsert(HooksContext hooksContext,
                           HooksGroupBean preInsertBean)
Description copied from class: GroupHooks
called right before a group insert

Overrides:
groupPreInsert in class GroupHooks
See Also:
GroupHooks.groupPreInsert(edu.internet2.middleware.grouper.hooks.beans.HooksContext, edu.internet2.middleware.grouper.hooks.beans.HooksGroupBean)

groupPreUpdate

public void groupPreUpdate(HooksContext hooksContext,
                           HooksGroupBean preUpdateBean)
Description copied from class: GroupHooks
called right before a group update

Overrides:
groupPreUpdate in class GroupHooks
See Also:
GroupHooks.groupPreUpdate(edu.internet2.middleware.grouper.hooks.beans.HooksContext, edu.internet2.middleware.grouper.hooks.beans.HooksGroupBean)