Class NoLongTermFailureStrategy

java.lang.Object
com.atlassian.crowd.manager.webhook.NoLongTermFailureStrategy
All Implemented Interfaces:
WebhookHealthStrategy

public class NoLongTermFailureStrategy extends Object implements WebhookHealthStrategy
A Webhook health strategy that imposes a limit to the number of consecutive failures for at least some time.
Since:
v2.7
  • Field Details

    • DEFAULT_MIN_FAILURES

      public static final long DEFAULT_MIN_FAILURES
      See Also:
    • DEFAULT_MIN_INTERVAL_MILLIS

      public static final long DEFAULT_MIN_INTERVAL_MILLIS
  • Constructor Details

    • NoLongTermFailureStrategy

      public NoLongTermFailureStrategy()
    • NoLongTermFailureStrategy

      public NoLongTermFailureStrategy(long minFailures, long minIntervalMillis)
  • Method Details

    • registerSuccess

      public Webhook registerSuccess(Webhook webhook)
      Description copied from interface: WebhookHealthStrategy
      Register a successful ping delivery to a Webhook.
      Specified by:
      registerSuccess in interface WebhookHealthStrategy
      Parameters:
      webhook - Webhook that has just been successfully pinged
      Returns:
      a Webhook template to update the Webhook
    • registerFailure

      public Webhook registerFailure(Webhook webhook)
      Description copied from interface: WebhookHealthStrategy
      Register a failed ping delivery to a Webhook. It simply registers the failure, but it does not take any further action, i.e., it does not remove the Webhook.
      Specified by:
      registerFailure in interface WebhookHealthStrategy
      Parameters:
      webhook - Webhook that has just been unsuccessfully pinged
      Returns:
      a Webhook template to update the Webhook
    • isInGoodStanding

      public boolean isInGoodStanding(Webhook webhook)
      Description copied from interface: WebhookHealthStrategy
      Decides whether the Webhook is in good standing. Applications may use this information to deactivate a Webhook that is no longer behaving. This check is made after each successful or failed Webhook ping.
      Specified by:
      isInGoodStanding in interface WebhookHealthStrategy
      Parameters:
      webhook - Webhook which status is examined.
      Returns:
      true if the Webhook is in good standing.
    • getMinFailures

      public long getMinFailures()
      Returns:
      the minimum number of times that a Webhook has to fail before it can be considered in bad standing
    • getMinIntervalMillis

      public long getMinIntervalMillis()
      Returns:
      the minimum number of millis that a Webhook has to be failing before it can be considered in bad standing