Interface ConfigProvider
-
- All Superinterfaces:
AutoCloseable
,Closeable
,Configurable
- All Known Implementing Classes:
DirectoryConfigProvider
,FileConfigProvider
public interface ConfigProvider extends Configurable, Closeable
A provider of configuration data, which may optionally support subscriptions to configuration changes. Implementations are required to safely support concurrent calls to any of the methods in this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ConfigData
get(String path)
Retrieves the data at the given path.ConfigData
get(String path, Set<String> keys)
Retrieves the data with the given keys at the given path.default void
subscribe(String path, Set<String> keys, ConfigChangeCallback callback)
Subscribes to changes for the given keys at the given path (optional operation).default void
unsubscribe(String path, Set<String> keys, ConfigChangeCallback callback)
Unsubscribes to changes for the given keys at the given path (optional operation).default void
unsubscribeAll()
Clears all subscribers (optional operation).-
Methods inherited from interface org.apache.kafka.common.Configurable
configure
-
-
-
-
Method Detail
-
get
ConfigData get(String path)
Retrieves the data at the given path.- Parameters:
path
- the path where the data resides- Returns:
- the configuration data
-
get
ConfigData get(String path, Set<String> keys)
Retrieves the data with the given keys at the given path.- Parameters:
path
- the path where the data resideskeys
- the keys whose values will be retrieved- Returns:
- the configuration data
-
subscribe
default void subscribe(String path, Set<String> keys, ConfigChangeCallback callback)
Subscribes to changes for the given keys at the given path (optional operation).- Parameters:
path
- the path where the data resideskeys
- the keys whose values will be retrievedcallback
- the callback to invoke upon change
-
unsubscribe
default void unsubscribe(String path, Set<String> keys, ConfigChangeCallback callback)
Unsubscribes to changes for the given keys at the given path (optional operation).- Parameters:
path
- the path where the data resideskeys
- the keys whose values will be retrievedcallback
- the callback to be unsubscribed from changes
-
unsubscribeAll
default void unsubscribeAll()
Clears all subscribers (optional operation).
-
-