Class NvdApiRetryStrategy

  • All Implemented Interfaces:
    org.apache.hc.client5.http.HttpRequestRetryStrategy

    public class NvdApiRetryStrategy
    extends org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategy
    Implements a back-off delay retry strategy that honors the retry-after header.
    • Field Summary

      • Fields inherited from class org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategy

        INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
      NvdApiRetryStrategy​(int maxRetries, long delay)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.hc.core5.util.TimeValue getRetryInterval​(org.apache.hc.core5.http.HttpResponse response, int execCount, org.apache.hc.core5.http.protocol.HttpContext context)  
      boolean retryRequest​(org.apache.hc.core5.http.HttpRequest request, java.io.IOException exception, int execCount, org.apache.hc.core5.http.protocol.HttpContext context)  
      boolean retryRequest​(org.apache.hc.core5.http.HttpResponse response, int execCount, org.apache.hc.core5.http.protocol.HttpContext context)  
      static java.lang.String toOrdinal​(int number)
      Converts a number to an ordinal string.
      • Methods inherited from class org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategy

        handleAsIdempotent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.hc.client5.http.HttpRequestRetryStrategy

        getRetryInterval
    • Constructor Detail

      • NvdApiRetryStrategy

        public NvdApiRetryStrategy​(int maxRetries,
                                   long delay)
    • Method Detail

      • retryRequest

        public boolean retryRequest​(@Nonnull
                                    org.apache.hc.core5.http.HttpRequest request,
                                    @Nonnull
                                    java.io.IOException exception,
                                    int execCount,
                                    org.apache.hc.core5.http.protocol.HttpContext context)
        Specified by:
        retryRequest in interface org.apache.hc.client5.http.HttpRequestRetryStrategy
        Overrides:
        retryRequest in class org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategy
      • retryRequest

        public boolean retryRequest​(org.apache.hc.core5.http.HttpResponse response,
                                    int execCount,
                                    org.apache.hc.core5.http.protocol.HttpContext context)
        Specified by:
        retryRequest in interface org.apache.hc.client5.http.HttpRequestRetryStrategy
        Overrides:
        retryRequest in class org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategy
      • getRetryInterval

        public org.apache.hc.core5.util.TimeValue getRetryInterval​(org.apache.hc.core5.http.HttpResponse response,
                                                                   int execCount,
                                                                   org.apache.hc.core5.http.protocol.HttpContext context)
        Specified by:
        getRetryInterval in interface org.apache.hc.client5.http.HttpRequestRetryStrategy
        Overrides:
        getRetryInterval in class org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategy
      • toOrdinal

        public static java.lang.String toOrdinal​(int number)
        Converts a number to an ordinal string.
        Parameters:
        number - the number to convert
        Returns:
        the ordinal string