Interface ConfluentLicenseStore
- All Known Implementing Classes:
InMemoryLicenseStore, LicenseStore
public interface ConfluentLicenseStore
Interface for Confluent license storage implementations.
This interface supports both simple and advanced license storage:
- Simple stores (like InMemoryLicenseStore): Single license storage using basic methods
- Advanced stores (like LicenseStore): Multi-license storage with CommandKey structure
The interface provides default implementations for advanced features that delegate to basic methods, ensuring backward compatibility while enabling rich functionality for stores that support it.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Map<License.DeploymentScope, String> Returns the current in-memory license state without reading from the topic.default Map<License.DeploymentScope, String> Get all licenses with their corresponding type Simple stores should return an empty map.default booleanWhether this store supports event-based license propagation.default voidregisterLicense(License.DeploymentScope key, String license) voidregisterLicense(String license) default voidsetOnDataChangeListener(Runnable listener) Set a listener that is called when new license data arrives in the store.voidstart()voidstop()default Stringtopic()LicenseStore falls back to_confluent-commandtopic if the topic given in the constructor doesn't exist, so this method provides the actual topic used by the license store.
-
Method Details
-
start
void start() -
stop
void stop() -
licenseScan
String licenseScan() -
registerLicense
-
topic
LicenseStore falls back to_confluent-commandtopic if the topic given in the constructor doesn't exist, so this method provides the actual topic used by the license store. -
getLatestLicenses
Get all licenses with their corresponding type Simple stores should return an empty map.- Returns:
- Map of DeploymentScope to license string for advanced stores, empty map for simple stores
-
registerLicense
-
isEventBasedPropagationSupported
default boolean isEventBasedPropagationSupported()Whether this store supports event-based license propagation. When true, the store can notify listeners immediately when new license records arrive, instead of requiring periodic polling.- Returns:
- true if event-based propagation is supported
-
setOnDataChangeListener
Set a listener that is called when new license data arrives in the store. Only supported whenisEventBasedPropagationSupported()returns true.- Parameters:
listener- the callback to invoke on data change, or null to clear- Throws:
UnsupportedOperationException- if event-based propagation is not supported
-
getInMemoryLicenses
Returns the current in-memory license state without reading from the topic. Only supported whenisEventBasedPropagationSupported()returns true.- Returns:
- map of deployment scope to license JWT
- Throws:
UnsupportedOperationException- if event-based propagation is not supported
-