Class NoLongTermFailureStrategy
java.lang.Object
com.atlassian.crowd.manager.webhook.NoLongTermFailureStrategy
- All Implemented Interfaces:
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
Modifier and TypeFieldDescriptionstatic final long
static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
long
boolean
isInGoodStanding
(Webhook webhook) Decides whether the Webhook is in good standing.registerFailure
(Webhook webhook) Register a failed ping delivery to a Webhook.registerSuccess
(Webhook webhook) Register a successful ping delivery to a Webhook.
-
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
Description copied from interface:WebhookHealthStrategy
Register a successful ping delivery to a Webhook.- Specified by:
registerSuccess
in interfaceWebhookHealthStrategy
- Parameters:
webhook
- Webhook that has just been successfully pinged- Returns:
- a Webhook template to update the Webhook
-
registerFailure
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 interfaceWebhookHealthStrategy
- Parameters:
webhook
- Webhook that has just been unsuccessfully pinged- Returns:
- a Webhook template to update the Webhook
-
isInGoodStanding
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 interfaceWebhookHealthStrategy
- 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
-