Class NvdApiRetryStrategy
- java.lang.Object
-
- org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategy
-
- io.github.jeremylong.openvulnerability.client.nvd.NvdApiRetryStrategy
-
- All Implemented Interfaces:
org.apache.hc.client5.http.HttpRequestRetryStrategy
public class NvdApiRetryStrategy extends org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategyImplements a back-off delay retry strategy that honors the retry-after header.
-
-
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.TimeValuegetRetryInterval(org.apache.hc.core5.http.HttpResponse response, int execCount, org.apache.hc.core5.http.protocol.HttpContext context)booleanretryRequest(org.apache.hc.core5.http.HttpRequest request, java.io.IOException exception, int execCount, org.apache.hc.core5.http.protocol.HttpContext context)booleanretryRequest(org.apache.hc.core5.http.HttpResponse response, int execCount, org.apache.hc.core5.http.protocol.HttpContext context)static java.lang.StringtoOrdinal(int number)Converts a number to an ordinal string.-
Methods inherited from class org.apache.hc.client5.http.impl.DefaultHttpRequestRetryStrategy
handleAsIdempotent
-
-
-
-
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:
retryRequestin interfaceorg.apache.hc.client5.http.HttpRequestRetryStrategy- Overrides:
retryRequestin classorg.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:
retryRequestin interfaceorg.apache.hc.client5.http.HttpRequestRetryStrategy- Overrides:
retryRequestin classorg.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:
getRetryIntervalin interfaceorg.apache.hc.client5.http.HttpRequestRetryStrategy- Overrides:
getRetryIntervalin classorg.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
-
-