Package org.kiwiproject.consul.cache
Class ServiceHealthCache
java.lang.Object
org.kiwiproject.consul.cache.ConsulCache<ServiceHealthKey,ServiceHealth>
org.kiwiproject.consul.cache.ServiceHealthCache
- 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 ServiceHealthCachenewCache(HealthClient healthClient, String serviceName) static ServiceHealthCachenewCache(HealthClient healthClient, String serviceName, boolean passing, int watchSeconds, QueryOptions queryOptions) static ServiceHealthCachenewCache(HealthClient healthClient, String serviceName, boolean passing, int watchSeconds, QueryOptions queryOptions, Function<ServiceHealth, ServiceHealthKey> keyExtractor) static ServiceHealthCachenewCache(HealthClient healthClient, String serviceName, boolean passing, int watchSeconds, QueryOptions queryOptions, Function<ServiceHealth, ServiceHealthKey> keyExtractor, ScheduledExecutorService callbackExecutorService) Factory method to construct a string/ServiceHealthmap for a particular service.static ServiceHealthCachenewCache(HealthClient healthClient, String serviceName, boolean passing, QueryOptions queryOptions, int watchSeconds) 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 ServiceHealthCache newCache(HealthClient healthClient, String serviceName, boolean passing, int watchSeconds, QueryOptions queryOptions, Function<ServiceHealth, ServiceHealthKey> keyExtractor, ScheduledExecutorService callbackExecutorService) Factory method to construct a string/ServiceHealthmap for a particular service.Keys will be a
HostAndPortobject made up of the service's address/port combo- Parameters:
healthClient- theHealthClientserviceName- the name of the servicepassing- include only passing services?watchSeconds- 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 ServiceHealthCache newCache(HealthClient healthClient, String serviceName, boolean passing, int watchSeconds, QueryOptions queryOptions, Function<ServiceHealth, ServiceHealthKey> keyExtractor) -
newCache
public static ServiceHealthCache newCache(HealthClient healthClient, String serviceName, boolean passing, int watchSeconds, QueryOptions queryOptions) -
newCache
public static ServiceHealthCache newCache(HealthClient healthClient, String serviceName, boolean passing, QueryOptions queryOptions, int watchSeconds) -
newCache
-