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