Class GrouperFailsafeBean
java.lang.Object
edu.internet2.middleware.grouper.misc.GrouperFailsafeBean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assignEmailAddressesOverride
(String emailAddressesOverride, String emailGroupNameOverride) if the override is not null then override the config default T or F if using failsafe.void
assignMaxGroupPercentRemoveOverride
(Integer theMaxPercentRemoveOverride) integer from 0 to 100 which specifies the maximum percent of a group which can be removed in a loader run.void
assignMaxOverallPercentGroupsRemoveOverride
(Integer theMaxOverallPercentGroupsRemoveOverride) integer from 0 to 100 which specifies the maximum percent of all loaded groups in the job which can be removed in a loader run.void
assignMaxOverallPercentMembershipsRemoveOverride
(Integer theMaxOverallPercentMembershipsRemoveOverride) integer from 0 to 100 which specifies the maximum percent of all loaded groups in the job which can be removed in a loader run.void
assignMinGroupNumberOfMembersOverride
(Integer theMinGroupNumberOfMembers) The minimum group number of members for this group, a failsafe alert will trigger if the group is smaller than this amountvoid
assignMinGroupSizeOverride
(Integer theMinGroupSizeOverride) minimum number of members for the group to be tracked by failsafe defaults to grouper-loader.base.properties: loader.failsafe.minGroupSizevoid
assignMinManagedGroupsOverride
(Integer theMinManagedGroupsOverride) The minimum number of managed groups for this loader job for the list of groups job to be applicablevoid
assignMinOverallNumberOfMembersOverride
(Integer theMinOverallNumberOfMembers) The minimum overall number of members for this job across all managed groups, a failsafe alert will trigger if the job's overall membership count is smaller than this amountvoid
assignSendEmailOverride
(Boolean theSendEmailOveride) if the override is not null then override the config default T or F if using failsafe.void
assignUseFailsafeOverride
(Boolean theUseFailsafe) if the override is not null then override the config default T or F if using failsafe.clone()
email addresses to send failsafe errors tosend email to this group namejob name for this failsafe (note, it could be a subjob name)int
integer from 0 to 100 which specifies the maximum percent of a group which can be removed in a loader run.int
integer from 0 to 100 which specifies the maximum percent of all loaded groups in the job which can be removed in a loader run.int
If the group list meets the criteria above and the percentage of memberships that are managed by the loader (i.e.The minimum group number of members for this group, a failsafe alert will trigger if the group is smaller than this amountint
minimum number of members for the group to be tracked by failsafe defaults to grouper-loader.base.properties: loader.failsafe.minGroupSizeThe minimum number of managed groups for this loader job for the list of groups job to be applicableThe minimum overall number of members for this job across all managed groups, a failsafe alert will trigger if the job's overall membership count is smaller than this amountboolean
If an email should be sent out when a failsafe alert happens.boolean
T or F if using failsafe.boolean
send email about failsafe (assuming there was a problem)take the email list and the group name to email and combine into one listvoid
setEmailAddresses
(String failsafeEmailAddresses) email addresses to send failsafe errors tovoid
setEmailGroupName
(String emailGroupName) send email to this group namevoid
setJobName
(String jobName) job name for this failsafe (note, it could be a subjob name)void
setMaxGroupPercentRemove
(int maxGroupPercentRemove) integer from 0 to 100 which specifies the maximum percent of a group which can be removed in a loader run.void
setMaxOverallPercentGroupsRemove
(int maxOverallPercentGroupsRemove) integer from 0 to 100 which specifies the maximum percent of all loaded groups in the job which can be removed in a loader run.void
setMaxOverallPercentMembershipsRemove
(int maxOverallPercentMembershipsRemove) If the group list meets the criteria above and the percentage of memberships that are managed by the loader (i.e.void
setMinGroupNumberOfMembers
(Integer minGroupNumberOfMembers) The minimum group number of members for this group, a failsafe alert will trigger if the group is smaller than this amountvoid
setMinGroupSize
(int minGroupSize) minimum number of members for the group to be tracked by failsafe defaults to grouper-loader.base.properties: loader.failsafe.minGroupSizevoid
setMinManagedGroups
(Integer minManagedGroups) The minimum number of managed groups for this loader job for the list of groups job to be applicablevoid
setMinOverallNumberOfMembers
(Integer minOverallNumberOfMembers) The minimum overall number of members for this job across all managed groups, a failsafe alert will trigger if the job's overall membership count is smaller than this amountvoid
setSendEmail
(boolean failsafeSendEmail) If an email should be sent out when a failsafe alert happens.void
setUseFailsafe
(boolean failsafeUse) T or F if using failsafe.boolean
shouldAbortDueToTooManyGroupListManagedGroupsBeingCleared
(int originalManagedGroupsWithMembersCount, int groupsBeingClearedCount) Group list fail safe.boolean
shouldAbortDueToTooManyMembersRemoved
(int originalGroupSize, int membersToRemoveSize, int memberToAddSize) see if too many members are being removed and if we should abort this jobboolean
shouldAbortDueToTooManyOverallMembersRemoved
(int originalTotalMembershipSize, int overallMembersToRemoveCount, int overallMembersToAddCount) group list failsafe
-
Constructor Details
-
GrouperFailsafeBean
public GrouperFailsafeBean()
-
-
Method Details
-
clone
-
shouldAbortDueToTooManyMembersRemoved
public boolean shouldAbortDueToTooManyMembersRemoved(int originalGroupSize, int membersToRemoveSize, int memberToAddSize) see if too many members are being removed and if we should abort this job- Parameters:
originalGroupSize
-membersToRemoveSize
-memberToAddSize
-- Returns:
- true if should abort
-
shouldAbortDueToTooManyOverallMembersRemoved
public boolean shouldAbortDueToTooManyOverallMembersRemoved(int originalTotalMembershipSize, int overallMembersToRemoveCount, int overallMembersToAddCount) group list failsafe- Parameters:
originalTotalMembershipSize
-overallMembersToRemoveCount
-overallMembersToAddCount
-- Returns:
- true if should abort or false if not
-
shouldAbortDueToTooManyGroupListManagedGroupsBeingCleared
public boolean shouldAbortDueToTooManyGroupListManagedGroupsBeingCleared(int originalManagedGroupsWithMembersCount, int groupsBeingClearedCount) Group list fail safe. See if too many groups managed by the loader via grouperLoaderGroupsLike used to have members but now all would be deleted.- Parameters:
originalManagedGroupsWithMembersCount
-groupsBeingClearedCount
-- Returns:
- true if should abort
-
notifyEmailAboutFailsafe
public boolean notifyEmailAboutFailsafe()send email about failsafe (assuming there was a problem) -
retrieveEmailAddressesFromAddressesAndOrGroupName
take the email list and the group name to email and combine into one list- Returns:
- the email list
-
getEmailGroupName
send email to this group name- Returns:
-
setEmailGroupName
send email to this group name- Parameters:
emailGroupName
-
-
getEmailAddresses
email addresses to send failsafe errors to- Returns:
-
setEmailAddresses
email addresses to send failsafe errors to- Parameters:
failsafeEmailAddresses
-
-
assignEmailAddressesOverride
public void assignEmailAddressesOverride(String emailAddressesOverride, String emailGroupNameOverride) if the override is not null then override the config default T or F if using failsafe. If blank use the global defaults- Parameters:
theUseFailsafe
-
-
isUseFailsafe
public boolean isUseFailsafe()T or F if using failsafe. If blank use the global defaults- Returns:
-
assignUseFailsafeOverride
if the override is not null then override the config default T or F if using failsafe. If blank use the global defaults- Parameters:
theUseFailsafe
-
-
assignSendEmailOverride
if the override is not null then override the config default T or F if using failsafe. If blank use the global defaults- Parameters:
theSendEmailOveride
-
-
assignMaxGroupPercentRemoveOverride
integer from 0 to 100 which specifies the maximum percent of a group which can be removed in a loader run. If not specified will use the global default grouper-loader.properties config setting: loader.failsafe.maxPercentRemove = 30- Parameters:
theMaxPercentRemoveOverride
-
-
setUseFailsafe
public void setUseFailsafe(boolean failsafeUse) T or F if using failsafe. If blank use the global defaults- Parameters:
failsafeUse
-
-
isSendEmail
public boolean isSendEmail()If an email should be sent out when a failsafe alert happens. The email will be sent to the list or group configured in grouper-loader.properties: loader.failsafe.sendEmailToAddresses, or loader.failsafe.sendEmailToGroup- Returns:
- send
-
setSendEmail
public void setSendEmail(boolean failsafeSendEmail) If an email should be sent out when a failsafe alert happens. The email will be sent to the list or group configured in grouper-loader.properties: loader.failsafe.sendEmailToAddresses, or loader.failsafe.sendEmailToGroup- Parameters:
failsafeSendEmail
-
-
getMaxGroupPercentRemove
public int getMaxGroupPercentRemove()integer from 0 to 100 which specifies the maximum percent of a group which can be removed in a loader run. If not specified will use the global default grouper-loader.properties config setting: loader.failsafe.maxPercentRemove = 30- Returns:
- max
-
setMaxGroupPercentRemove
public void setMaxGroupPercentRemove(int maxGroupPercentRemove) integer from 0 to 100 which specifies the maximum percent of a group which can be removed in a loader run. If not specified will use the global default grouper-loader.properties config setting: loader.failsafe.maxPercentRemove = 30- Parameters:
maxGroupPercentRemove
-
-
getMaxOverallPercentMembershipsRemove
public int getMaxOverallPercentMembershipsRemove()If the group list meets the criteria above and the percentage of memberships that are managed by the loader (i.e. match the groupLikeString) that currently have members in Grouper but wouldn't after the job runs is greater than this percentage, then don't remove members, log it as an error and fail the job. An admin would need to approve the failsafe or change this param in the config, and run the job manually, then change this config back. loader.failsafe.groupList.managedGroups.maxPercentMembershipsRemove- Returns:
-
setMaxOverallPercentMembershipsRemove
public void setMaxOverallPercentMembershipsRemove(int maxOverallPercentMembershipsRemove) If the group list meets the criteria above and the percentage of memberships that are managed by the loader (i.e. match the groupLikeString) that currently have members in Grouper but wouldn't after the job runs is greater than this percentage, then don't remove members, log it as an error and fail the job. An admin would need to approve the failsafe or change this param in the config, and run the job manually, then change this config back. loader.failsafe.groupList.managedGroups.maxPercentMembershipsRemove- Parameters:
maxOverallPercentMembershipsRemove
-
-
getMaxOverallPercentGroupsRemove
public int getMaxOverallPercentGroupsRemove()integer from 0 to 100 which specifies the maximum percent of all loaded groups in the job which can be removed in a loader run. If not specified will use the global default grouper-loader.properties config setting: loader.failsafe.groupList.managedGroups.maxPercentGroupsRemove = 30- Returns:
- max
-
setMaxOverallPercentGroupsRemove
public void setMaxOverallPercentGroupsRemove(int maxOverallPercentGroupsRemove) integer from 0 to 100 which specifies the maximum percent of all loaded groups in the job which can be removed in a loader run. If not specified will use the global default grouper-loader.properties config setting: loader.failsafe.groupList.managedGroups.maxPercentGroupsRemove = 30- Parameters:
maxOverallPercentGroupsRemove
-
-
getMinGroupSize
public int getMinGroupSize()minimum number of members for the group to be tracked by failsafe defaults to grouper-loader.base.properties: loader.failsafe.minGroupSize- Returns:
-
setMinGroupSize
public void setMinGroupSize(int minGroupSize) minimum number of members for the group to be tracked by failsafe defaults to grouper-loader.base.properties: loader.failsafe.minGroupSize- Parameters:
minGroupSize
-
-
getMinManagedGroups
The minimum number of managed groups for this loader job for the list of groups job to be applicable- Returns:
-
setMinManagedGroups
The minimum number of managed groups for this loader job for the list of groups job to be applicable- Parameters:
minManagedGroups
-
-
getMinGroupNumberOfMembers
The minimum group number of members for this group, a failsafe alert will trigger if the group is smaller than this amount- Returns:
-
setMinGroupNumberOfMembers
The minimum group number of members for this group, a failsafe alert will trigger if the group is smaller than this amount- Parameters:
minGroupNumberOfMembers
-
-
getMinOverallNumberOfMembers
The minimum overall number of members for this job across all managed groups, a failsafe alert will trigger if the job's overall membership count is smaller than this amount- Returns:
-
setMinOverallNumberOfMembers
The minimum overall number of members for this job across all managed groups, a failsafe alert will trigger if the job's overall membership count is smaller than this amount- Parameters:
minOverallNumberOfMembers
-
-
assignMaxOverallPercentGroupsRemoveOverride
public void assignMaxOverallPercentGroupsRemoveOverride(Integer theMaxOverallPercentGroupsRemoveOverride) integer from 0 to 100 which specifies the maximum percent of all loaded groups in the job which can be removed in a loader run. If not specified will use the global default grouper-loader.properties config setting: loader.failsafe.groupList.managedGroups.maxPercentGroupsRemove = 30- Parameters:
theMaxOverallPercentRemoveOverride
-
-
assignMaxOverallPercentMembershipsRemoveOverride
public void assignMaxOverallPercentMembershipsRemoveOverride(Integer theMaxOverallPercentMembershipsRemoveOverride) integer from 0 to 100 which specifies the maximum percent of all loaded groups in the job which can be removed in a loader run. If not specified will use the global default grouper-loader.properties config setting: loader.failsafe.groupList.managedGroups.maxPercentGroupsRemove = 30- Parameters:
theMaxOverallPercentRemoveOverride
-
-
assignMinGroupSizeOverride
minimum number of members for the group to be tracked by failsafe defaults to grouper-loader.base.properties: loader.failsafe.minGroupSize- Parameters:
theMinGroupSizeOverride
-
-
assignMinManagedGroupsOverride
The minimum number of managed groups for this loader job for the list of groups job to be applicable- Parameters:
theMinManagedGroupsOverride
-
-
assignMinGroupNumberOfMembersOverride
The minimum group number of members for this group, a failsafe alert will trigger if the group is smaller than this amount- Parameters:
theMinGroupNumberOfMembers
-
-
assignMinOverallNumberOfMembersOverride
The minimum overall number of members for this job across all managed groups, a failsafe alert will trigger if the job's overall membership count is smaller than this amount- Parameters:
theMinOverallNumberOfMembers
-
-
getJobName
job name for this failsafe (note, it could be a subjob name)- Returns:
-
setJobName
job name for this failsafe (note, it could be a subjob name)- Parameters:
jobName
-
-