Class ClientSideCachingParams

java.lang.Object
org.redisson.api.options.ClientSideCachingParams
All Implemented Interfaces:
ClientSideCachingOptions

public final class ClientSideCachingParams extends Object implements ClientSideCachingOptions
Author:
Nikita Koksharov
  • Constructor Details

    • ClientSideCachingParams

      public ClientSideCachingParams()
  • Method Details

    • evictionPolicy

      public ClientSideCachingOptions evictionPolicy(ClientSideCachingOptions.EvictionPolicy evictionPolicy)
      Description copied from interface: ClientSideCachingOptions
      Defines client cache eviction policy.
      Specified by:
      evictionPolicy in interface ClientSideCachingOptions
      Parameters:
      evictionPolicy -

      LRU - uses client cache with LRU (least recently used) eviction policy.

      LFU - uses client cache with LFU (least frequently used) eviction policy.

      SOFT - uses client cache with soft references. The garbage collector will evict items from the client cache when the JVM is running out of memory.

      WEAK - uses client cache with weak references. The garbage collector will evict items from the client cache when it became weakly reachable.

      NONE - doesn't use eviction policy, but timeToLive and maxIdleTime params are still working.

      Returns:
      options instance
    • size

      public ClientSideCachingOptions size(int size)
      Description copied from interface: ClientSideCachingOptions
      Defines client cache size.

      If size is 0 then client cache is unbounded.

      If size is -1 then client cache is always empty and doesn't store data.

      Specified by:
      size in interface ClientSideCachingOptions
      Parameters:
      size - size of client cache
      Returns:
      options instance
    • timeToLive

      public ClientSideCachingOptions timeToLive(Duration ttl)
      Description copied from interface: ClientSideCachingOptions
      Defines time to live in milliseconds of each map entry in client cache. If value equals to 0 then timeout is not applied
      Specified by:
      timeToLive in interface ClientSideCachingOptions
      Parameters:
      ttl - - time to live in milliseconds
      Returns:
      LocalCachedMapOptions instance
    • maxIdle

      public ClientSideCachingOptions maxIdle(Duration idleTime)
      Description copied from interface: ClientSideCachingOptions
      Defines max idle time in milliseconds of each map entry in client cache. If value equals to 0 then timeout is not applied
      Specified by:
      maxIdle in interface ClientSideCachingOptions
      Parameters:
      idleTime - time to live in milliseconds
      Returns:
      LocalCachedMapOptions instance
    • getEvictionPolicy

      public ClientSideCachingOptions.EvictionPolicy getEvictionPolicy()
    • getSize

      public int getSize()
    • getTtl

      public long getTtl()
    • getIdleTime

      public long getIdleTime()