Package com.orbitz.consul.cache
Class KVCache
- java.lang.Object
-
- com.orbitz.consul.cache.ConsulCache<java.lang.String,Value>
-
- com.orbitz.consul.cache.KVCache
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class KVCache extends ConsulCache<java.lang.String,Value>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.orbitz.consul.cache.ConsulCache
ConsulCache.CallbackConsumer<V>, ConsulCache.Listener<K,V>, ConsulCache.Scheduler
-
-
Method Summary
Modifier and Type Method Description static KVCachenewCache(KeyValueClient kvClient, java.lang.String rootPath)Factory method to construct a String/Valuemap with a 10 second block intervalstatic KVCachenewCache(KeyValueClient kvClient, java.lang.String rootPath, int watchSeconds)Factory method to construct a String/Valuemap.static KVCachenewCache(KeyValueClient kvClient, java.lang.String rootPath, int watchSeconds, QueryOptions queryOptions)static KVCachenewCache(KeyValueClient kvClient, java.lang.String rootPath, int watchSeconds, QueryOptions queryOptions, java.util.concurrent.ScheduledExecutorService callbackExecutorService)-
Methods inherited from class com.orbitz.consul.cache.ConsulCache
addListener, awaitInitialized, close, createDefault, createExternal, getListeners, getMap, getMapWithMetadata, getState, removeListener, start, stop, watchParams
-
-
-
-
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, QueryOptions queryOptions)
-
newCache
public static KVCache newCache(KeyValueClient kvClient, java.lang.String rootPath, int watchSeconds)
Factory method to construct a String/Valuemap.- Parameters:
kvClient- theKeyValueClientto userootPath- 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/Valuemap with a 10 second block interval- Parameters:
kvClient- theKeyValueClientto userootPath- the root path- Returns:
- the cache object
-
-