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
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(ConsulCache.Listener<K,V> listener) |
boolean |
awaitInitialized(long timeout,
TimeUnit unit) |
void |
close() |
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) |
public void start()
public void stop()
public void close()
throws Exception
close in interface AutoCloseableExceptionpublic 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)
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 © 2018. All rights reserved.