summaryrefslogtreecommitdiff
path: root/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/EaafHttpRequestRetryHandler.java
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-05-12 14:59:05 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-05-12 14:59:05 +0200
commitbc119ad402708fde970ba8b7e2123607806b6307 (patch)
treedbed6f5e12187ac2f8e296b7aeba7dc6616334c2 /eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/EaafHttpRequestRetryHandler.java
parent96a3be0bf0396e888745b71465a34a9e367b9841 (diff)
parentb5aeeac822bfe1a734835e3aa0caa65b56b3643a (diff)
downloadEAAF-Components-bc119ad402708fde970ba8b7e2123607806b6307.tar.gz
EAAF-Components-bc119ad402708fde970ba8b7e2123607806b6307.tar.bz2
EAAF-Components-bc119ad402708fde970ba8b7e2123607806b6307.zip
Merge branch 'nightlyBuild' of gitlab.iaik.tugraz.at:egiz/eaaf_components into nightlyBuild1.1.4
Diffstat (limited to 'eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/EaafHttpRequestRetryHandler.java')
-rw-r--r--eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/EaafHttpRequestRetryHandler.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/EaafHttpRequestRetryHandler.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/EaafHttpRequestRetryHandler.java
new file mode 100644
index 00000000..3aa908e8
--- /dev/null
+++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/EaafHttpRequestRetryHandler.java
@@ -0,0 +1,33 @@
+package at.gv.egiz.eaaf.core.impl.http;
+
+import java.net.UnknownHostException;
+import java.util.Arrays;
+
+import javax.net.ssl.SSLException;
+
+import org.apache.http.client.HttpRequestRetryHandler;
+import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
+
+public class EaafHttpRequestRetryHandler extends DefaultHttpRequestRetryHandler implements
+ HttpRequestRetryHandler {
+
+ /**
+ * Create the request retry handler using the following list of non-retriable.
+ * IOException classes: <br>
+ * <ul>
+ * <li>UnknownHostException</li>
+ * <li>SSLException</li>
+ * </ul>
+ *
+ * @param retryCount how many times to retry; 0 means no retries
+ * @param requestSentRetryEnabled true if it's OK to retry non-idempotent
+ * requests that have been sent
+ */
+ public EaafHttpRequestRetryHandler(final int retryCount, final boolean requestSentRetryEnabled) {
+ super(retryCount, requestSentRetryEnabled, Arrays.asList(
+ UnknownHostException.class,
+ SSLException.class));
+
+ }
+
+}