From c991034cbfc9e7fe6480fa438c5343fce3d838d5 Mon Sep 17 00:00:00 2001 From: Dominic Miglar Date: Sat, 7 May 2022 16:43:09 +0200 Subject: [PATCH] removed unused code --- .../common/ResponseErrorHandlerFactory.java | 30 ------------------- .../utils/retry/RetryTemplateFactory.java | 18 ----------- 2 files changed, 48 deletions(-) delete mode 100644 src/main/java/com/logreposit/ta/cmireaderservice/communication/http/common/ResponseErrorHandlerFactory.java diff --git a/src/main/java/com/logreposit/ta/cmireaderservice/communication/http/common/ResponseErrorHandlerFactory.java b/src/main/java/com/logreposit/ta/cmireaderservice/communication/http/common/ResponseErrorHandlerFactory.java deleted file mode 100644 index 938b267..0000000 --- a/src/main/java/com/logreposit/ta/cmireaderservice/communication/http/common/ResponseErrorHandlerFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.logreposit.ta.cmireaderservice.communication.http.common; - -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.web.client.ResponseErrorHandler; - -public class ResponseErrorHandlerFactory -{ - private ResponseErrorHandlerFactory() - { - } - - public static ResponseErrorHandler createWithoutHttpStatusErrorHandling() - { - ResponseErrorHandler responseErrorHandler = new ResponseErrorHandler() - { - @Override - public boolean hasError(ClientHttpResponse response) - { - return false; - } - - @Override - public void handleError(ClientHttpResponse response) - { - } - }; - - return responseErrorHandler; - } -} diff --git a/src/main/java/com/logreposit/ta/cmireaderservice/utils/retry/RetryTemplateFactory.java b/src/main/java/com/logreposit/ta/cmireaderservice/utils/retry/RetryTemplateFactory.java index aa78439..d291333 100644 --- a/src/main/java/com/logreposit/ta/cmireaderservice/utils/retry/RetryTemplateFactory.java +++ b/src/main/java/com/logreposit/ta/cmireaderservice/utils/retry/RetryTemplateFactory.java @@ -14,24 +14,6 @@ private RetryTemplateFactory() { } - public static RetryTemplate getRetryTemplateWithExponentialBackOffForAllExceptions(int maxAttempts, - long initialBackOffInterval, - double backOffMultiplier) - { - SimpleRetryPolicy simpleRetryPolicy = new SimpleRetryPolicy(); - simpleRetryPolicy.setMaxAttempts(maxAttempts); - - ExponentialBackOffPolicy exponentialBackOffPolicy = new ExponentialBackOffPolicy(); - exponentialBackOffPolicy.setInitialInterval(initialBackOffInterval); - exponentialBackOffPolicy.setMultiplier(backOffMultiplier); - - RetryTemplate retryTemplate = new RetryTemplate(); - retryTemplate.setBackOffPolicy(exponentialBackOffPolicy); - retryTemplate.setRetryPolicy(simpleRetryPolicy); - - return retryTemplate; - } - public static RetryTemplate getRetryTemplateWithExponentialBackOffForGivenException(int maxAttempts, long initialBackOffInterval, double backOffMultiplier,