Class DefaultPayPalCheckoutRetryPolicyClassifier
java.lang.Object
com.broadleafcommerce.paypal.micro.gateway.service.DefaultPayPalCheckoutRetryPolicyClassifier
- All Implemented Interfaces:
Serializable,org.springframework.classify.Classifier<Throwable,org.springframework.retry.RetryPolicy>
public class DefaultPayPalCheckoutRetryPolicyClassifier
extends Object
implements org.springframework.classify.Classifier<Throwable,org.springframework.retry.RetryPolicy>
Implementation of a
Classifier that is used to identify a RetryPolicy based on a
provided Throwable. If a RetryPolicy is not identified, then a NeverRetryPolicy
should be returned - ie only retry for specific identified errors.- Author:
- Chris Kittrell (ckittrell)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPayPalCheckoutRetryPolicyClassifier(org.springframework.retry.RetryPolicy retryPolicy) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.retry.RetryPolicyprotected org.springframework.retry.RetryPolicyprotected booleanis5xxError(Throwable throwable) Determines whether or not the given throwable coming from PayPal's API is their representation of a 5xx errorprotected booleanisNetworkError(Throwable throwable) Determines whether or not the given throwable coming from PayPal's API is their representation of a network error
-
Constructor Details
-
DefaultPayPalCheckoutRetryPolicyClassifier
public DefaultPayPalCheckoutRetryPolicyClassifier(org.springframework.retry.RetryPolicy retryPolicy)
-
-
Method Details
-
classify
- Specified by:
classifyin interfaceorg.springframework.classify.Classifier<Throwable,org.springframework.retry.RetryPolicy>
-
isNetworkError
Determines whether or not the given throwable coming from PayPal's API is their representation of a network error- Parameters:
throwable- the throwable that is returned by PayPal's SDK- Returns:
- whether or not the given throwable represents a network error
-
is5xxError
Determines whether or not the given throwable coming from PayPal's API is their representation of a 5xx error- Parameters:
throwable- the throwable that is returned by PayPal's SDK- Returns:
- whether or not the given throwable represents a 5xx error
-
getRetryPolicy
protected org.springframework.retry.RetryPolicy getRetryPolicy()
-