public class AutoPollingPolicy extends RefreshPolicy
RefreshPolicy which polls the latest configuration
over HTTP and updates the local cache repeatedly.| Modifier and Type | Class and Description |
|---|---|
static class |
AutoPollingPolicy.Builder
A builder that helps construct a
AutoPollingPolicy instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigurationChangeListener(ConfigurationChangeListener listener)
Subscribes a new listener to the configuration changed event.
|
void |
close() |
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. |
static AutoPollingPolicy.Builder |
newBuilder()
Creates a new builder instance.
|
void |
removeConfigurationChangeListener(ConfigurationChangeListener listener)
Removes a given listener from the configuration changed event.
|
cache, fetcher, refreshAsyncpublic java.util.concurrent.CompletableFuture<java.lang.String> getConfigurationJsonAsync()
RefreshPolicyConfigCatClient
uses it to read the current configuration value through the applied policy.getConfigurationJsonAsync in class RefreshPolicypublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class RefreshPolicyjava.io.IOExceptionpublic void addConfigurationChangeListener(ConfigurationChangeListener listener)
listener - the listener.public void removeConfigurationChangeListener(ConfigurationChangeListener listener)
listener - the listener.public static AutoPollingPolicy.Builder newBuilder()