com.atlassian.crowd.manager.webhook
Class NoLongTermFailureStrategy

java.lang.Object
  extended by 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 Summary
static long DEFAULT_MIN_FAILURES
           
static long DEFAULT_MIN_INTERVAL_MILLIS
           
 
Constructor Summary
NoLongTermFailureStrategy()
           
NoLongTermFailureStrategy(long minFailures, long minIntervalMillis)
           
 
Method Summary
 long getMinFailures()
           
 long getMinIntervalMillis()
           
 boolean isInGoodStanding(Webhook webhook)
          Decides whether the Webhook is in good standing.
 Webhook registerFailure(Webhook webhook)
          Register a failed ping delivery to a Webhook.
 Webhook registerSuccess(Webhook webhook)
          Register a successful ping delivery to a Webhook.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MIN_FAILURES

public static final long DEFAULT_MIN_FAILURES
See Also:
Constant Field Values

DEFAULT_MIN_INTERVAL_MILLIS

public static final long DEFAULT_MIN_INTERVAL_MILLIS
Constructor Detail

NoLongTermFailureStrategy

public NoLongTermFailureStrategy()

NoLongTermFailureStrategy

public NoLongTermFailureStrategy(long minFailures,
                                 long minIntervalMillis)
Method Detail

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


Copyright © 2013 Atlassian. All Rights Reserved.