Class CacheConfig.Builder

  • Enclosing class:
    CacheConfig

    public static class CacheConfig.Builder
    extends java.lang.Object
    • Method Detail

      • withBackOffDelay

        public CacheConfig.Builder withBackOffDelay​(java.time.Duration delay)
        Sets the back-off delay used in caches.
        Throws:
        java.lang.IllegalArgumentException - if delay is negative.
      • withBackOffDelay

        public CacheConfig.Builder withBackOffDelay​(java.time.Duration minDelay,
                                                    java.time.Duration maxDelay)
        Sets a random delay between the minDelay and maxDelay (inclusive) to occur between retries.
        Throws:
        java.lang.IllegalArgumentException - if minDelay or maxDelay is negative, or if minDelay is superior to maxDelay.
      • withMinDelayBetweenRequests

        public CacheConfig.Builder withMinDelayBetweenRequests​(java.time.Duration delay)
        Sets the minimum time between two requests for caches.
      • withMinDelayOnEmptyResult

        public CacheConfig.Builder withMinDelayOnEmptyResult​(java.time.Duration delay)
        Sets the minimum time between two requests for caches when an empty result is returned.
      • withTimeoutAutoAdjustmentEnabled

        public CacheConfig.Builder withTimeoutAutoAdjustmentEnabled​(boolean enabled)
        Enable/Disable the automatic adjustment of read timeout
      • withTimeoutAutoAdjustmentMargin

        public CacheConfig.Builder withTimeoutAutoAdjustmentMargin​(java.time.Duration margin)
        Sets the margin of the read timeout for caches. The margin represents the additional amount of time given to the read timeout, in addition to the wait duration.
      • withRefreshErrorLoggedAsWarning

        public CacheConfig.Builder withRefreshErrorLoggedAsWarning()
        Log refresh errors as warning
      • withRefreshErrorLoggedAsError

        public CacheConfig.Builder withRefreshErrorLoggedAsError()
        Log refresh errors as error