Class GrouperFailsafeBean

java.lang.Object
edu.internet2.middleware.grouper.misc.GrouperFailsafeBean

public class GrouperFailsafeBean extends Object
  • Constructor Details

    • GrouperFailsafeBean

      public GrouperFailsafeBean()
  • Method Details

    • clone

      public GrouperFailsafeBean clone()
      Overrides:
      clone in class Object
      Returns:
      clone of this
    • 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

      public String retrieveEmailAddressesFromAddressesAndOrGroupName()
      take the email list and the group name to email and combine into one list
      Returns:
      the email list
    • getEmailGroupName

      public String getEmailGroupName()
      send email to this group name
      Returns:
    • setEmailGroupName

      public void setEmailGroupName(String emailGroupName)
      send email to this group name
      Parameters:
      emailGroupName -
    • getEmailAddresses

      public String getEmailAddresses()
      email addresses to send failsafe errors to
      Returns:
    • setEmailAddresses

      public void setEmailAddresses(String failsafeEmailAddresses)
      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

      public void assignUseFailsafeOverride(Boolean theUseFailsafe)
      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

      public void assignSendEmailOverride(Boolean theSendEmailOveride)
      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

      public 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. 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

      public Integer getMinManagedGroups()
      The minimum number of managed groups for this loader job for the list of groups job to be applicable
      Returns:
    • setMinManagedGroups

      public void setMinManagedGroups(Integer minManagedGroups)
      The minimum number of managed groups for this loader job for the list of groups job to be applicable
      Parameters:
      minManagedGroups -
    • getMinGroupNumberOfMembers

      public Integer 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

      public 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 amount
      Parameters:
      minGroupNumberOfMembers -
    • getMinOverallNumberOfMembers

      public Integer 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

      public void 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 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

      public void assignMinGroupSizeOverride(Integer theMinGroupSizeOverride)
      minimum number of members for the group to be tracked by failsafe defaults to grouper-loader.base.properties: loader.failsafe.minGroupSize
      Parameters:
      theMinGroupSizeOverride -
    • assignMinManagedGroupsOverride

      public void assignMinManagedGroupsOverride(Integer theMinManagedGroupsOverride)
      The minimum number of managed groups for this loader job for the list of groups job to be applicable
      Parameters:
      theMinManagedGroupsOverride -
    • assignMinGroupNumberOfMembersOverride

      public 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 amount
      Parameters:
      theMinGroupNumberOfMembers -
    • assignMinOverallNumberOfMembersOverride

      public void 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 amount
      Parameters:
      theMinOverallNumberOfMembers -
    • getJobName

      public String getJobName()
      job name for this failsafe (note, it could be a subjob name)
      Returns:
    • setJobName

      public void setJobName(String jobName)
      job name for this failsafe (note, it could be a subjob name)
      Parameters:
      jobName -