Interface ConfigProvider
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,Configurable
- All Known Implementing Classes:
FileConfigProvider
public interface ConfigProvider extends Configurable, java.io.Closeable
A provider of configuration data, which may optionally support subscriptions to configuration changes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ConfigData
get(java.lang.String path)
Retrieves the data at the given path.ConfigData
get(java.lang.String path, java.util.Set<java.lang.String> keys)
Retrieves the data with the given keys at the given path.default void
subscribe(java.lang.String path, java.util.Set<java.lang.String> keys, ConfigChangeCallback callback)
Subscribes to changes for the given keys at the given path (optional operation).default void
unsubscribe(java.lang.String path, java.util.Set<java.lang.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(java.lang.String path)
Retrieves the data at the given path.- Parameters:
path
- the path where the data resides- Returns:
- the configuration data
-
get
ConfigData get(java.lang.String path, java.util.Set<java.lang.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(java.lang.String path, java.util.Set<java.lang.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(java.lang.String path, java.util.Set<java.lang.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).
-
-