Class CacheConfig

java.lang.Object
org.kiwiproject.consul.config.CacheConfig

public class CacheConfig extends Object
  • Method Details

    • getWatchDuration

      public Duration getWatchDuration()
      Gets the default watch duration for caches.
      Returns:
      the watch duration
    • getMinimumBackOffDelay

      public Duration getMinimumBackOffDelay()
      Gets the minimum back-off delay used in caches.
      Returns:
      the minimum back-off delay
    • getMaximumBackOffDelay

      public Duration getMaximumBackOffDelay()
      Gets the maximum back-off delay used in caches.
      Returns:
      maximum back-off delay
    • isTimeoutAutoAdjustmentEnabled

      public boolean isTimeoutAutoAdjustmentEnabled()
      Is the automatic adjustment of read timeout enabled?
      Returns:
      true if automatic adjustment of read timeout is enabled, otherwise false
    • getTimeoutAutoAdjustmentMargin

      public Duration getTimeoutAutoAdjustmentMargin()
      Gets 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.

      Returns:
      the margin of the read timeout
    • getMinimumDurationBetweenRequests

      public Duration getMinimumDurationBetweenRequests()
      Gets the minimum time between two requests for caches.
      Returns:
      the minimum time between two requests
    • getMinimumDurationDelayOnEmptyResult

      public Duration getMinimumDurationDelayOnEmptyResult()
      Gets the minimum time between two requests for caches.
      Returns:
      the minimum time between two requests
    • getRefreshErrorLoggingConsumer

      public CacheConfig.RefreshErrorLogConsumer getRefreshErrorLoggingConsumer()
      Gets the function that will be called in case of error.
      Returns:
      a RefreshErrorLogConsumer that will be called when errors occur
    • builder

      public static CacheConfig.Builder builder()
      Creates a new CacheConfig.Builder object.
      Returns:
      A new Consul builder.