Class GroupTypeTupleIncludeExcludeHook
java.lang.Object
edu.internet2.middleware.grouper.hooks.GroupTypeTupleHooks
edu.internet2.middleware.grouper.hooks.examples.GroupTypeTupleIncludeExcludeHook
built in hook to grouper, which is turned on when it is configured in the grouper.properties. you can auto create groups to facilitate include and exclude lists to debug this add these two entries to log4j.properties log4j.logger.edu.internet2.middleware.grouper.hooks.examples.GroupTypeTupleIncludeExcludeHook = DEBUG log4j.logger.edu.internet2.middleware.grouper.Group = DEBUG
-
Field Summary
Fields inherited from class edu.internet2.middleware.grouper.hooks.GroupTypeTupleHooks
METHOD_GROUP_TYPE_TUPLE_POST_COMMIT_DELETE, METHOD_GROUP_TYPE_TUPLE_POST_COMMIT_INSERT, METHOD_GROUP_TYPE_TUPLE_POST_COMMIT_UPDATE, METHOD_GROUP_TYPE_TUPLE_POST_DELETE, METHOD_GROUP_TYPE_TUPLE_POST_INSERT, METHOD_GROUP_TYPE_TUPLE_POST_UPDATE, METHOD_GROUP_TYPE_TUPLE_PRE_DELETE, METHOD_GROUP_TYPE_TUPLE_PRE_INSERT, METHOD_GROUP_TYPE_TUPLE_PRE_UPDATE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static String
convertToOverall
(String extension) convert a system of record extension to an overall extensionstatic int
deleteGroupsIfNotUsed
(GrouperSession grouperSession, String groupName, StringBuilder reason, boolean saveIncludesExcludesIfMembers) static String
excludeDescription
(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes exclude descriptionstatic String
substitute and return exclude name suffixstatic String
substitute and return exclude id suffixstatic String
groupNameFromAndGroupAttributeName
(String attributeName) void
groupTypeTuplePostDelete
(HooksContext hooksContext, HooksGroupTypeTupleBean postDeleteBean) called right after a groupTypeTuple deletevoid
groupTypeTuplePostInsert
(HooksContext hooksContext, HooksGroupTypeTupleBean postInsertBean) called right after a groupTypeTuple insertstatic String
includeDescription
(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes include descriptionstatic String
substitute and return include name suffixstatic String
substitute and return include id suffixstatic String
includesMinusExcludesDescription
(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return includesMinusExcludes descriptionstatic String
substitute and return includesMinusExcludes name suffixstatic String
substitute and return includesMinusExcludes id suffixstatic void
static void
manageIncludesExcludesAndGroups
(GrouperSession grouperSession, Group typedGroup, String summaryForLog) static void
manageIncludesExcludesAndGroups
(Group typedGroup, boolean isIncludeExclude, Set<Group> andGroups, String calledFromForLog) change a typed group into include and exclude group lists and andGroups alsostatic boolean
nameIsIncludeExcludeRequireGroup
(String groupName) see if a group name has an include/exclude or requireGroup suffixstatic String
overallDescription
(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes overall descriptionstatic void
registerHookIfNecessary
(boolean tryAgainIfNotBefore) see if this is configured in the grouper.properties, if so, register this hookrelatedGroups
(Group group) return a set of groups including the one passed in, related to this group.static String
requireGroupsDescription
(int index, String overallGroupExtension, String overallGroupDisplayExtension) description of group for includeExcludeMinusAndGroup, index is 1 basedstatic String
requireGroupsDisplayExtensionSuffix
(int index) display extension of group for includeExcludeMinusAndGroup, index is 1 basedstatic String
requireGroupsExtensionSuffix
(int index) extension of group for includeExcludeMinusAndGroup, index is 1 basedstatic String
systemOfRecordAndIncludesDescription
(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes systemOfRecordAndIncludes descriptionstatic String
substitute and return systemOfRecordAndIncludes name suffixstatic String
substitute and return systemOfRecordAndIncludes id suffixstatic String
systemOfRecordDescription
(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes systemOfRecord descriptionstatic String
substitute and return overall systemOfRecord suffixstatic String
substitute and return system of record id suffixMethods inherited from class edu.internet2.middleware.grouper.hooks.GroupTypeTupleHooks
groupTypeTuplePostCommitDelete, groupTypeTuplePostCommitInsert, groupTypeTuplePostCommitUpdate, groupTypeTuplePostUpdate, groupTypeTuplePreDelete, groupTypeTuplePreInsert, groupTypeTuplePreUpdate
-
Constructor Details
-
GroupTypeTupleIncludeExcludeHook
public GroupTypeTupleIncludeExcludeHook()
-
-
Method Details
-
clearHook
public static void clearHook() -
registerHookIfNecessary
public static void registerHookIfNecessary(boolean tryAgainIfNotBefore) see if this is configured in the grouper.properties, if so, register this hook- Parameters:
tryAgainIfNotBefore
-
-
groupNameFromAndGroupAttributeName
- Parameters:
attributeName
-- Returns:
- the group name from the config file
-
groupTypeTuplePostDelete
public void groupTypeTuplePostDelete(HooksContext hooksContext, HooksGroupTypeTupleBean postDeleteBean) Description copied from class:GroupTypeTupleHooks
called right after a groupTypeTuple delete -
groupTypeTuplePostInsert
public void groupTypeTuplePostInsert(HooksContext hooksContext, HooksGroupTypeTupleBean postInsertBean) Description copied from class:GroupTypeTupleHooks
called right after a groupTypeTuple insert -
convertToOverall
convert a system of record extension to an overall extension- Parameters:
extension
- is overall extension or system of record extension- Returns:
- the overall extension
-
main
- Parameters:
args
-
-
manageIncludesExcludesAndGroups
public static void manageIncludesExcludesAndGroups(GrouperSession grouperSession, Group typedGroup, String summaryForLog) - Parameters:
grouperSession
-typedGroup
-summaryForLog
- some string that will be logged to debug...
-
excludeDescription
public static String excludeDescription(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes exclude description- Parameters:
overallGroupExtension
-overallGroupDisplayExtension
-- Returns:
- description
-
excludeDisplayExtensionSuffix
substitute and return exclude name suffix- Returns:
- suffix
-
excludeExtensionSuffix
substitute and return exclude id suffix- Returns:
- suffix
-
manageIncludesExcludesAndGroups
public static void manageIncludesExcludesAndGroups(Group typedGroup, boolean isIncludeExclude, Set<Group> andGroups, String calledFromForLog) change a typed group into include and exclude group lists and andGroups also- Parameters:
typedGroup
-isIncludeExclude
-andGroups
-calledFromForLog
- summary of where this is coming from for debug log
-
systemOfRecordExtensionSuffix
substitute and return system of record id suffix- Returns:
- suffix
-
nameIsIncludeExcludeRequireGroup
see if a group name has an include/exclude or requireGroup suffix- Parameters:
groupName
-- Returns:
- true if include/exclude
-
includeExtensionSuffix
substitute and return include id suffix- Returns:
- suffix
-
includesMinusExcludesExtensionSuffix
substitute and return includesMinusExcludes id suffix- Returns:
- suffix
-
systemOfRecordAndIncludesExtensionSuffix
substitute and return systemOfRecordAndIncludes id suffix- Returns:
- suffix
-
systemOfRecordDisplayExtensionSuffix
substitute and return overall systemOfRecord suffix- Returns:
- suffix
-
includeDisplayExtensionSuffix
substitute and return include name suffix- Returns:
- suffix
-
includesMinusExcludesDisplayExtensionSuffix
substitute and return includesMinusExcludes name suffix- Returns:
- suffix
-
requireGroupsExtensionSuffix
extension of group for includeExcludeMinusAndGroup, index is 1 based- Parameters:
index
-- Returns:
- the extension
-
deleteGroupsIfNotUsed
public static int deleteGroupsIfNotUsed(GrouperSession grouperSession, String groupName, StringBuilder reason, boolean saveIncludesExcludesIfMembers) - Parameters:
grouperSession
-groupName
- if the overall or system of record groupreason
- if you want a reason passed backsaveIncludesExcludesIfMembers
- true if not delete only the includes group and excludes group if they have members. false, delete anyway- Returns:
- the number of groups removed
-
requireGroupsDescription
public static String requireGroupsDescription(int index, String overallGroupExtension, String overallGroupDisplayExtension) description of group for includeExcludeMinusAndGroup, index is 1 based- Parameters:
index
-overallGroupExtension
-overallGroupDisplayExtension
-- Returns:
- the extension
-
requireGroupsDisplayExtensionSuffix
display extension of group for includeExcludeMinusAndGroup, index is 1 based- Parameters:
index
-- Returns:
- the extension
-
systemOfRecordAndIncludesDisplayExtensionSuffix
substitute and return systemOfRecordAndIncludes name suffix- Returns:
- suffix
-
overallDescription
public static String overallDescription(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes overall description- Parameters:
overallGroupExtension
-overallGroupDisplayExtension
-- Returns:
- description
-
systemOfRecordAndIncludesDescription
public static String systemOfRecordAndIncludesDescription(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes systemOfRecordAndIncludes description- Parameters:
overallGroupExtension
-overallGroupDisplayExtension
-- Returns:
- description
-
systemOfRecordDescription
public static String systemOfRecordDescription(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes systemOfRecord description- Parameters:
overallGroupExtension
-overallGroupDisplayExtension
-- Returns:
- description
-
includeDescription
public static String includeDescription(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return systemOfRecordAndIncludes include description- Parameters:
overallGroupExtension
-overallGroupDisplayExtension
-- Returns:
- description
-
includesMinusExcludesDescription
public static String includesMinusExcludesDescription(String overallGroupExtension, String overallGroupDisplayExtension) substitute and return includesMinusExcludes description- Parameters:
overallGroupExtension
-overallGroupDisplayExtension
-- Returns:
- description
-