Class 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:
    Serialized Form
    • Constructor Detail

      • DefaultPayPalCheckoutRetryPolicyClassifier

        public DefaultPayPalCheckoutRetryPolicyClassifier​(org.springframework.retry.RetryPolicy retryPolicy)
    • Method Detail

      • classify

        public org.springframework.retry.RetryPolicy classify​(Throwable throwable)
        Specified by:
        classify in interface org.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()