Class DefaultCacheConfigurationBuilder

java.lang.Object
com.okta.sdk.impl.cache.DefaultCacheConfigurationBuilder
All Implemented Interfaces:
CacheConfigurationBuilder

public class DefaultCacheConfigurationBuilder extends Object implements CacheConfigurationBuilder
Since:
0.5.0
  • Constructor Details

    • DefaultCacheConfigurationBuilder

      public DefaultCacheConfigurationBuilder(String name)
  • Method Details

    • withTimeToLive

      public CacheConfigurationBuilder withTimeToLive(long ttl, TimeUnit ttlTimeUnit)
      Description copied from interface: CacheConfigurationBuilder
      Sets the associated Cache 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). Usage

           ...withTimeToLive(30, TimeUnit.MINUTES)...
           ...withTimeToLive(1, TimeUnit.HOURS)...
       
      Specified by:
      withTimeToLive in interface CacheConfigurationBuilder
      Parameters:
      ttl - Time To Live scalar value
      ttlTimeUnit - Time to Live unit of time
      Returns:
      the associated Cache region's entry Time to Live (TTL).
    • withTimeToIdle

      public CacheConfigurationBuilder withTimeToIdle(long tti, TimeUnit ttiTimeUnit)
      Description copied from interface: CacheConfigurationBuilder
      Sets the associated Cache 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). Usage

           ...withTimeToIdle(30, TimeUnit.MINUTES)...
           ...withTimeToIdle(1, TimeUnit.HOURS)...
       
      Specified by:
      withTimeToIdle in interface CacheConfigurationBuilder
      Parameters:
      tti - Time To Idle scalar value
      ttiTimeUnit - Time to Idle unit of time
      Returns:
      the associated Cache region's entry Time to Idle (TTI).
    • getName

      public String getName()
    • getTimeToLive

      public Duration getTimeToLive()
    • getTimeToIdle

      public Duration getTimeToIdle()
    • build

      public CacheConfiguration build()