Package org.kiwiproject.consul.cache
Class HealthCheckCache
java.lang.Object
org.kiwiproject.consul.cache.ConsulCache<String,HealthCheck>
org.kiwiproject.consul.cache.HealthCheckCache
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.kiwiproject.consul.cache.ConsulCache
ConsulCache.CallbackConsumer<V>, ConsulCache.Listener<K,V>, ConsulCache.Scheduler, ConsulCache.State -
Method Summary
Modifier and TypeMethodDescriptionstatic HealthCheckCachenewCache(HealthClient healthClient, State checkState) static HealthCheckCachenewCache(HealthClient healthClient, State checkState, int watchSeconds) static HealthCheckCachenewCache(HealthClient healthClient, State checkState, int watchSeconds, QueryOptions queryOptions) static HealthCheckCachenewCache(HealthClient healthClient, State checkState, int watchSeconds, QueryOptions queryOptions, Function<HealthCheck, String> keyExtractor) static HealthCheckCachenewCache(HealthClient healthClient, State checkState, int watchSeconds, QueryOptions queryOptions, Function<HealthCheck, String> keyExtractor, ScheduledExecutorService callbackExecutorService) Factory method to construct a string/HealthCheckmap for a particularState.Methods inherited from class org.kiwiproject.consul.cache.ConsulCache
addListener, awaitInitialized, checkWatch, close, createDefault, createExternal, getListeners, getMap, getMapWithMetadata, getState, removeListener, start, stop, watchParams
-
Method Details
-
newCache
public static HealthCheckCache newCache(HealthClient healthClient, State checkState, int watchSeconds, QueryOptions queryOptions, Function<HealthCheck, String> keyExtractor, ScheduledExecutorService callbackExecutorService) Factory method to construct a string/HealthCheckmap for a particularState.Keys will be the
HealthCheck.getCheckId().- Parameters:
healthClient- theHealthClientcheckState- the state fo filter checkswatchSeconds- the seconds to blockqueryOptions- the query options to usekeyExtractor- a function to convert values to keyscallbackExecutorService- the ScheduledExecutorService to use for asynchronous callbacks- Returns:
- a cache object
-
newCache
public static HealthCheckCache newCache(HealthClient healthClient, State checkState, int watchSeconds, QueryOptions queryOptions, Function<HealthCheck, String> keyExtractor) -
newCache
public static HealthCheckCache newCache(HealthClient healthClient, State checkState, int watchSeconds, QueryOptions queryOptions) -
newCache
public static HealthCheckCache newCache(HealthClient healthClient, State checkState, int watchSeconds) -
newCache
-