public abstract class RefreshPolicy
extends java.lang.Object
implements java.io.Closeable
| Modifier | Constructor and Description |
|---|---|
protected |
RefreshPolicy(ConfigFetcher configFetcher,
ConfigCache cache)
Constructor used by the child classes.
|
| Modifier and Type | Method and Description |
|---|---|
protected ConfigCache |
cache()
Through this getter, child classes can use the cache to
control the cached configuration.
|
void |
close() |
protected ConfigFetcher |
fetcher()
Through this getter, child classes can use the fetcher to
get the latest configuration over HTTP.
|
abstract java.util.concurrent.CompletableFuture<java.lang.String> |
getConfigurationJsonAsync()
Child classes has to implement this method, the
ConfigCatClient
uses it to read the current configuration value through the applied policy. |
java.util.concurrent.CompletableFuture<java.lang.Void> |
refreshAsync()
Initiates a force refresh on the cached configuration.
|
protected RefreshPolicy(ConfigFetcher configFetcher, ConfigCache cache)
configFetcher - the internal config fetcher instance.cache - the internal cache instance.protected ConfigFetcher fetcher()
protected ConfigCache cache()
public abstract java.util.concurrent.CompletableFuture<java.lang.String> getConfigurationJsonAsync()
ConfigCatClient
uses it to read the current configuration value through the applied policy.public java.util.concurrent.CompletableFuture<java.lang.Void> refreshAsync()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException