Package com.pingidentity.sdk.util
Class ConfigCache<ConfigType>
java.lang.Object
com.pingidentity.sdk.util.ConfigCache<ConfigType>
- Type Parameters:
ConfigType- The type of the configuration object that is cached.
This class allows plugins to create a configuration cache that is automatically reloaded
when a replication event occurs. During replication, a fresh instance of the cached configuration is created
in the background, without impacting runtime requests. When replication completes, the new cache becomes the
active cache for runtime requests.
A typical use case is if a plugin needs to register a single endpoint for all instances of the plugin. The endpoint may rely on a configuration cache which is built from all instances of the plugin. If building the configuration cache may be time-consuming, this class allows the cache to be built in the background, without impacting runtime requests. A limitation is that, in standalone mode, if an instance of the plugin is saved or deleted, the configuration cache will not be automatically refreshed.
A typical use case is if a plugin needs to register a single endpoint for all instances of the plugin. The endpoint may rely on a configuration cache which is built from all instances of the plugin. If building the configuration cache may be time-consuming, this class allows the cache to be built in the background, without impacting runtime requests. A limitation is that, in standalone mode, if an instance of the plugin is saved or deleted, the configuration cache will not be automatically refreshed.
- Since:
- 10.2
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConfigCache(Supplier<ConfigType> configSupplier) Create an instance with the specified supplier. -
Method Summary
-
Constructor Details
-
ConfigCache
Create an instance with the specified supplier.- Parameters:
configSupplier- The function used to create the cached configuration object.
-
-
Method Details
-
get
Get the cached configuration object.- Returns:
- The cached configuration object.
-
clear
public void clear()Clear the cached configuration object.
-