Class KVCache

All Implemented Interfaces:
AutoCloseable

public class KVCache extends ConsulCache<String,Value>
  • Method Details

    • newCache

      public static KVCache newCache(KeyValueClient kvClient, String rootPath, int watchSeconds, QueryOptions queryOptions, ScheduledExecutorService callbackExecutorService)
    • newCache

      public static KVCache newCache(KeyValueClient kvClient, String rootPath, int watchSeconds, QueryOptions queryOptions)
    • newCache

      public static KVCache newCache(KeyValueClient kvClient, String rootPath, int watchSeconds)
      Factory method to construct a String/Value map.
      Parameters:
      kvClient - the KeyValueClient to use
      rootPath - the root path (will be stripped from keys in the cache)
      watchSeconds - how long to tell the Consul server to wait for new values (note that if this is 60 seconds or more, the client's read timeout will need to be increased as well)
      Returns:
      the cache object
    • newCache

      public static KVCache newCache(KeyValueClient kvClient, String rootPath)
      Factory method to construct a String/Value map with a 10-second block interval
      Parameters:
      kvClient - the KeyValueClient to use
      rootPath - the root path
      Returns:
      the cache object