public class DefaultCacheConfigurationBuilder extends Object implements CacheConfigurationBuilder
| Constructor and Description |
|---|
DefaultCacheConfigurationBuilder(String name) |
| Modifier and Type | Method and Description |
|---|---|
CacheConfiguration |
build() |
String |
getName() |
Duration |
getTimeToIdle() |
Duration |
getTimeToLive() |
CacheConfigurationBuilder |
withTimeToIdle(long tti,
TimeUnit ttiTimeUnit)
Sets the associated
Cache region's entry Time to Idle (TTI). |
CacheConfigurationBuilder |
withTimeToLive(long ttl,
TimeUnit ttlTimeUnit)
Sets the associated
Cache region's entry Time to Live (TTL). |
public DefaultCacheConfigurationBuilder(String name)
public CacheConfigurationBuilder withTimeToLive(long ttl, TimeUnit ttlTimeUnit)
CacheConfigurationBuilderCache region's entry Time to Live (TTL).
Time to Live is the amount of time a cache entry may exist after first being created before it will expire and no longer be available. If a cache entry ever becomes older than this amount of time (regardless of how often it is accessed), it will be removed from the cache as soon as possible.
If this value is not configured, it is assumed that the Cache's entries could potentially live indefinitely. Note however that entries can still be expunged due to other conditions (e.g. memory constraints, Time to Idle setting, etc).
...withTimeToLive(30, TimeUnit.MINUTES)...
...withTimeToLive(1, TimeUnit.HOURS)...
withTimeToLive in interface CacheConfigurationBuilderttl - Time To Live scalar valuettlTimeUnit - Time to Live unit of timeCache region's entry Time to Live (TTL).public CacheConfigurationBuilder withTimeToIdle(long tti, TimeUnit ttiTimeUnit)
CacheConfigurationBuilderCache region's entry Time to Idle (TTI).
Time to Idle is the amount of time a cache entry may be idle (unused / not accessed) before it will expire and no longer be available. If a cache entry is not accessed at all after this amount of time, it will be removed from the cache as soon as possible.
If this value is not configured, it is assumed that the Cache's entries could potentially live indefinitely. Note however that entries can still be expunged due to other conditions (e.g. memory constraints, Time to Live setting, etc).
...withTimeToIdle(30, TimeUnit.MINUTES)...
...withTimeToIdle(1, TimeUnit.HOURS)...
withTimeToIdle in interface CacheConfigurationBuildertti - Time To Idle scalar valuettiTimeUnit - Time to Idle unit of timeCache region's entry Time to Idle (TTI).public String getName()
public Duration getTimeToLive()
public Duration getTimeToIdle()
public CacheConfiguration build()
Copyright © 2017–2023 Okta. All rights reserved.