Class KVCache

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class KVCache
    extends ConsulCache<java.lang.String,​Value>
    • Method Detail

      • newCache

        public static KVCache newCache​(KeyValueClient kvClient,
                                       java.lang.String rootPath,
                                       int watchSeconds,
                                       QueryOptions queryOptions,
                                       java.util.concurrent.ScheduledExecutorService callbackExecutorService)
      • newCache

        public static KVCache newCache​(KeyValueClient kvClient,
                                       java.lang.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,
                                       java.lang.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