Class RetryableRestTemplate

  • All Implemented Interfaces:
    org.springframework.web.client.RestOperations

    public class RetryableRestTemplate
    extends org.springframework.web.client.RestTemplate
    REST template with retry ability. Its behavior is described by given strategy and retry template.
    • Constructor Summary

      Constructors 
      Constructor Description
      RetryableRestTemplate​(org.springframework.http.client.ClientHttpRequestFactory requestFactory, org.springframework.retry.support.RetryTemplate retryTemplate, RetryStrategy retryStrategy)
      Create a new instance of the RetryableRestTemplate.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.springframework.web.client.RestTemplate create​(RetrySettings retrySettings, org.springframework.http.client.ClientHttpRequestFactory factory)
      Creates new retryable REST template.
      protected <T> T doExecute​(java.net.URI url, org.springframework.http.HttpMethod method, org.springframework.web.client.RequestCallback requestCallback, org.springframework.web.client.ResponseExtractor<T> responseExtractor)  
      • Methods inherited from class org.springframework.web.client.RestTemplate

        acceptHeaderRequestCallback, delete, delete, delete, exchange, exchange, exchange, exchange, exchange, exchange, exchange, exchange, execute, execute, execute, getErrorHandler, getForEntity, getForEntity, getForEntity, getForObject, getForObject, getForObject, getMessageConverters, getUriTemplateHandler, handleResponse, headersExtractor, headForHeaders, headForHeaders, headForHeaders, httpEntityCallback, httpEntityCallback, optionsForAllow, optionsForAllow, optionsForAllow, patchForObject, patchForObject, patchForObject, postForEntity, postForEntity, postForEntity, postForLocation, postForLocation, postForLocation, postForObject, postForObject, postForObject, put, put, put, responseEntityExtractor, setDefaultUriVariables, setErrorHandler, setMessageConverters, setUriTemplateHandler
      • Methods inherited from class org.springframework.http.client.support.InterceptingHttpAccessor

        getInterceptors, getRequestFactory, setInterceptors, setRequestFactory
      • Methods inherited from class org.springframework.http.client.support.HttpAccessor

        createRequest, getClientHttpRequestInitializers, setClientHttpRequestInitializers
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RetryableRestTemplate

        public RetryableRestTemplate​(org.springframework.http.client.ClientHttpRequestFactory requestFactory,
                                     org.springframework.retry.support.RetryTemplate retryTemplate,
                                     RetryStrategy retryStrategy)
        Create a new instance of the RetryableRestTemplate.
        Parameters:
        requestFactory - HTTP request factory to use
        retryTemplate - retry template
        retryStrategy - retry strategy
    • Method Detail

      • doExecute

        protected <T> T doExecute​(java.net.URI url,
                                  org.springframework.http.HttpMethod method,
                                  org.springframework.web.client.RequestCallback requestCallback,
                                  org.springframework.web.client.ResponseExtractor<T> responseExtractor)
                           throws org.springframework.web.client.RestClientException
        Overrides:
        doExecute in class org.springframework.web.client.RestTemplate
        Throws:
        org.springframework.web.client.RestClientException
      • create

        public static org.springframework.web.client.RestTemplate create​(RetrySettings retrySettings,
                                                                         org.springframework.http.client.ClientHttpRequestFactory factory)
        Creates new retryable REST template.
        Parameters:
        retrySettings - retry settings
        factory - request factory
        Returns:
        retryable rest template