public static class CacheConfig.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
CacheConfig |
build() |
CacheConfig.Builder |
withBackOffDelay(Duration delay)
Sets the back-off delay used in caches.
|
CacheConfig.Builder |
withBackOffDelay(Duration minDelay,
Duration maxDelay)
Sets a random delay between the
minDelay and maxDelay (inclusive) to occur between retries. |
CacheConfig.Builder |
withMinDelayBetweenRequests(Duration delay)
Sets the minimum time between two requests for caches.
|
CacheConfig.Builder |
withMinDelayOnEmptyResult(Duration delay)
Sets the minimum time between two requests for caches when an empty result is returned.
|
CacheConfig.Builder |
withRefreshErrorLoggedAs(CacheConfig.RefreshErrorLogConsumer fn)
Log refresh errors using custom function
|
CacheConfig.Builder |
withRefreshErrorLoggedAsError()
Log refresh errors as error
|
CacheConfig.Builder |
withRefreshErrorLoggedAsWarning()
Log refresh errors as warning
|
CacheConfig.Builder |
withTimeoutAutoAdjustmentEnabled(boolean enabled)
Enable/Disable the automatic adjustment of read timeout
|
CacheConfig.Builder |
withTimeoutAutoAdjustmentMargin(Duration margin)
Sets the margin of the read timeout for caches.
|
public CacheConfig.Builder withBackOffDelay(Duration delay)
IllegalArgumentException - if delay is negative.public CacheConfig.Builder withBackOffDelay(Duration minDelay, Duration maxDelay)
minDelay and maxDelay (inclusive) to occur between retries.IllegalArgumentException - if minDelay or maxDelay is negative, or if minDelay is superior to maxDelay.public CacheConfig.Builder withMinDelayBetweenRequests(Duration delay)
public CacheConfig.Builder withMinDelayOnEmptyResult(Duration delay)
public CacheConfig.Builder withTimeoutAutoAdjustmentEnabled(boolean enabled)
public CacheConfig.Builder withTimeoutAutoAdjustmentMargin(Duration margin)
public CacheConfig.Builder withRefreshErrorLoggedAsWarning()
public CacheConfig.Builder withRefreshErrorLoggedAsError()
public CacheConfig.Builder withRefreshErrorLoggedAs(CacheConfig.RefreshErrorLogConsumer fn)
public CacheConfig build()
Copyright © 2019. All rights reserved.