Class HttpRequestFetcher


  • public final class HttpRequestFetcher
    extends java.lang.Object
    Schedule tasks for caching Http Requests that can be run simultaneously.

    The instances of the returned request will use a future to wait for the actual request to be really completed.

    • Constructor Summary

      Constructors 
      Constructor Description
      HttpRequestFetcher​(java.io.File temporaryDirectory, com.codahale.metrics.MetricRegistry registry, Processor.ExecutionContext context, java.util.concurrent.ForkJoinPool requestForkJoinPool)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.client.ClientHttpRequest register​(org.springframework.http.client.ClientHttpRequest originalRequest)
      Register a http request for caching.
      • Methods inherited from class java.lang.Object

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

      • HttpRequestFetcher

        public HttpRequestFetcher​(java.io.File temporaryDirectory,
                                  com.codahale.metrics.MetricRegistry registry,
                                  Processor.ExecutionContext context,
                                  java.util.concurrent.ForkJoinPool requestForkJoinPool)
        Constructor.
        Parameters:
        temporaryDirectory - temporary directory for cached requests
        registry - the metric registry
        context - the job ID
        requestForkJoinPool - the work pool to use to do the requests
    • Method Detail

      • register

        public org.springframework.http.client.ClientHttpRequest register​(org.springframework.http.client.ClientHttpRequest originalRequest)
        Register a http request for caching. Returns a handle to the HttpRequest that will be cached.
        Parameters:
        originalRequest - the original request
        Returns:
        the cached http request