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 aClassifier
that is used to identify aRetryPolicy
based on a providedThrowable
. If a RetryPolicy is not identified, then aNeverRetryPolicy
should be returned - ie only retry for specific identified errors.- Author:
- Chris Kittrell (ckittrell)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultPayPalCheckoutRetryPolicyClassifier(org.springframework.retry.RetryPolicy retryPolicy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.retry.RetryPolicy
classify(Throwable throwable)
protected org.springframework.retry.RetryPolicy
getRetryPolicy()
protected boolean
is5xxError(Throwable throwable)
Determines whether or not the given throwable coming from PayPal's API is their representation of a 5xx errorprotected boolean
isNetworkError(Throwable throwable)
Determines whether or not the given throwable coming from PayPal's API is their representation of a network error
-
-
-
Method Detail
-
classify
public org.springframework.retry.RetryPolicy classify(Throwable throwable)
- Specified by:
classify
in interfaceorg.springframework.classify.Classifier<Throwable,org.springframework.retry.RetryPolicy>
-
isNetworkError
protected boolean isNetworkError(Throwable throwable)
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
protected boolean is5xxError(Throwable throwable)
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()
-
-