V - public class ConsulCache<K,V> extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
ConsulCache.CallbackConsumer<V>
passed in by creators to vary the content of the cached values
|
static interface |
ConsulCache.Listener<K,V>
Implementers can register a listener to receive
a new map when it changes
|
protected static class |
ConsulCache.Scheduler |
| Modifier | Constructor and Description |
|---|---|
protected |
ConsulCache(Function<V,K> keyConversion,
ConsulCache.CallbackConsumer<V> callbackConsumer,
CacheConfig cacheConfig,
ClientEventHandler eventHandler,
CacheDescriptor cacheDescriptor) |
protected |
ConsulCache(Function<V,K> keyConversion,
ConsulCache.CallbackConsumer<V> callbackConsumer,
CacheConfig cacheConfig,
ClientEventHandler eventHandler,
CacheDescriptor cacheDescriptor,
ConsulCache.Scheduler callbackScheduler) |
protected |
ConsulCache(Function<V,K> keyConversion,
ConsulCache.CallbackConsumer<V> callbackConsumer,
CacheConfig cacheConfig,
ClientEventHandler eventHandler,
CacheDescriptor cacheDescriptor,
ScheduledExecutorService callbackScheduleExecutorService) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(ConsulCache.Listener<K,V> listener) |
boolean |
awaitInitialized(long timeout,
TimeUnit unit) |
void |
close() |
protected static ConsulCache.Scheduler |
createDefault() |
protected static ConsulCache.Scheduler |
createExternal(ScheduledExecutorService executor) |
List<ConsulCache.Listener<K,V>> |
getListeners() |
com.google.common.collect.ImmutableMap<K,V> |
getMap() |
ConsulResponse<com.google.common.collect.ImmutableMap<K,V>> |
getMapWithMetadata() |
protected com.orbitz.consul.cache.ConsulCache.State |
getState() |
boolean |
removeListener(ConsulCache.Listener<K,V> listener) |
void |
start() |
void |
stop() |
protected static QueryOptions |
watchParams(BigInteger index,
int blockSeconds,
QueryOptions queryOptions) |
protected ConsulCache(Function<V,K> keyConversion, ConsulCache.CallbackConsumer<V> callbackConsumer, CacheConfig cacheConfig, ClientEventHandler eventHandler, CacheDescriptor cacheDescriptor)
protected ConsulCache(Function<V,K> keyConversion, ConsulCache.CallbackConsumer<V> callbackConsumer, CacheConfig cacheConfig, ClientEventHandler eventHandler, CacheDescriptor cacheDescriptor, ScheduledExecutorService callbackScheduleExecutorService)
protected ConsulCache(Function<V,K> keyConversion, ConsulCache.CallbackConsumer<V> callbackConsumer, CacheConfig cacheConfig, ClientEventHandler eventHandler, CacheDescriptor cacheDescriptor, ConsulCache.Scheduler callbackScheduler)
public void start()
public void stop()
public void close()
close in interface AutoCloseablepublic boolean awaitInitialized(long timeout,
TimeUnit unit)
throws InterruptedException
InterruptedExceptionpublic ConsulResponse<com.google.common.collect.ImmutableMap<K,V>> getMapWithMetadata()
protected static QueryOptions watchParams(BigInteger index, int blockSeconds, QueryOptions queryOptions)
protected static ConsulCache.Scheduler createDefault()
protected static ConsulCache.Scheduler createExternal(ScheduledExecutorService executor)
public boolean addListener(ConsulCache.Listener<K,V> listener)
public List<ConsulCache.Listener<K,V>> getListeners()
public boolean removeListener(ConsulCache.Listener<K,V> listener)
protected com.orbitz.consul.cache.ConsulCache.State getState()
Copyright © 2019. All rights reserved.