public abstract class EndpointDiscoveryRefreshCache<K> extends Object
Constructor and Description |
---|
EndpointDiscoveryRefreshCache(CacheLoader cacheLoader) |
Modifier and Type | Method and Description |
---|---|
URI |
discoverEndpoint(String key,
boolean required,
URI defaultEndpoint) |
void |
evict(String key) |
abstract URI |
get(K key,
boolean required,
URI defaultEndpoint)
Abstract method to be implemented by each service to handle retrieving
endpoints from a cache.
|
ScheduledFuture<?> |
loadAndScheduleEvict(String key,
long refreshPeriod,
TimeUnit refreshPeriodTimeUnit) |
ScheduledFuture<URI> |
loadAndScheduleRefresh(String key,
long refreshPeriod,
URI defaultEndpoint) |
abstract URI |
put(String key,
Map<String,String> endpointDetails,
URI defaultEndpoint)
Abstract method to be implemented by each service to handle storing endpoints
in it's cache.
|
void |
shutdown() |
public EndpointDiscoveryRefreshCache(CacheLoader cacheLoader)
public abstract URI get(K key, boolean required, URI defaultEndpoint)
key
- - The cache key to userequired
- - Whether or not the service requires use of endpoint discoverydefaultEndpoint
- - The default endpoint for the servicepublic abstract URI put(String key, Map<String,String> endpointDetails, URI defaultEndpoint)
key
- - The cache keyendpointDetails
- - The details for an endpoint including the address and cache period.public void evict(String key)
public ScheduledFuture<URI> loadAndScheduleRefresh(String key, long refreshPeriod, URI defaultEndpoint)
public ScheduledFuture<?> loadAndScheduleEvict(String key, long refreshPeriod, TimeUnit refreshPeriodTimeUnit)
public void shutdown()
Copyright © 2022. All rights reserved.