Class LicenseStore
java.lang.Object
io.confluent.license.LicenseStore
- All Implemented Interfaces:
ConfluentLicenseStore
IMPORTANT: This class should not use Kafka APIs newer than AK 0.11.0/CP 3.3.0.
All of our proprietary connectors are dependent upon the LicenseManager framework
and they all include this dependency in their plugin directory. So, when the connectors are
installed into any CP version, the connector's LicenseManager uses the AK APIs provided by the
Connect installation to create the license topic if necessary. Connectors may be installed into
CP 3.3.0 or newer when `AdminClient.createTopics(...)` was added. We should maintain
compatibility for the LicenseManager for all these versions by using only older APIs that are
available from 3.3.0.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLicenseStore(io.confluent.command.record.Command.CommandKey commandKey, String topic, ConcurrentHashMap<io.confluent.command.record.Command.CommandKey, String> latestLicenses, LicenseKafkaBasedLog<io.confluent.command.record.Command.CommandKey, io.confluent.command.record.Command.CommandMessage> licenseLog, org.apache.kafka.common.utils.Time time) LicenseStore(String topic, Map<String, Object> producerConfig, Map<String, Object> consumerConfig, Map<String, Object> topicConfig) LicenseStore(String topic, Map<String, Object> producerConfig, Map<String, Object> consumerConfig, Map<String, Object> topicConfig, Duration topicCreateTimeout, Duration retryBackoffMinMs, Duration retryBackoffMaxMs, org.apache.kafka.common.utils.Time time) LicenseStore(String topic, Map<String, Object> producerConfig, Map<String, Object> consumerConfig, Map<String, Object> topicConfig, Duration topicCreateTimeout, Duration retryBackoffMinMs, Duration retryBackoffMaxMs, org.apache.kafka.common.utils.Time time, List<io.confluent.command.record.Command.CommandKey> commandKeys) LicenseStore(String topic, Map<String, Object> producerConfig, Map<String, Object> consumerConfig, Map<String, Object> topicConfig, List<io.confluent.command.record.Command.CommandKey> commandKeys) LicenseStore(List<io.confluent.command.record.Command.CommandKey> commandKeys, String topic, ConcurrentHashMap<io.confluent.command.record.Command.CommandKey, String> latestLicenses, LicenseKafkaBasedLog<io.confluent.command.record.Command.CommandKey, io.confluent.command.record.Command.CommandMessage> licenseLog, org.apache.kafka.common.utils.Time time) -
Method Summary
Modifier and TypeMethodDescriptionReads the license storeLicenseStoreand returns the latest licenses perLicense.DeploymentScope.Returns a single license only whenLicenseStoreis configured with exactly oneCommand.CommandKey.voidregisterLicense(License.DeploymentScope deploymentScope, String license) Registers a license JWT for the givenLicense.DeploymentScope.voidregisterLicense(String license) Supports single-licenseLicenseStoreonly.voidregisterLicense(String license, org.apache.kafka.clients.producer.Callback callback) Supports single-licenseLicenseStoreonly.voidstart()voidstop()topic()
-
Field Details
-
REPLICATION_FACTOR_CONFIG
- See Also:
-
MIN_INSYNC_REPLICAS_CONFIG
- See Also:
-
READ_TO_END_TIMEOUT_MS
public static final long READ_TO_END_TIMEOUT_MS- See Also:
-
-
Constructor Details
-
LicenseStore
-
LicenseStore
-
LicenseStore
-
LicenseStore
public LicenseStore(String topic, Map<String, Object> producerConfig, Map<String, Object> consumerConfig, Map<String, Object> topicConfig, Duration topicCreateTimeout, Duration retryBackoffMinMs, Duration retryBackoffMaxMs, org.apache.kafka.common.utils.Time time, List<io.confluent.command.record.Command.CommandKey> commandKeys) -
LicenseStore
public LicenseStore(List<io.confluent.command.record.Command.CommandKey> commandKeys, String topic, ConcurrentHashMap<io.confluent.command.record.Command.CommandKey, String> latestLicenses, LicenseKafkaBasedLog<io.confluent.command.record.Command.CommandKey, io.confluent.command.record.Command.CommandMessage> licenseLog, org.apache.kafka.common.utils.Time time) -
LicenseStore
public LicenseStore(io.confluent.command.record.Command.CommandKey commandKey, String topic, ConcurrentHashMap<io.confluent.command.record.Command.CommandKey, String> latestLicenses, LicenseKafkaBasedLog<io.confluent.command.record.Command.CommandKey, io.confluent.command.record.Command.CommandMessage> licenseLog, org.apache.kafka.common.utils.Time time)
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceConfluentLicenseStore
-
stop
public void stop()- Specified by:
stopin interfaceConfluentLicenseStore
-
licenseScan
Returns a single license only whenLicenseStoreis configured with exactly oneCommand.CommandKey. When multiple license types are supported, this method returns null. UsegetLatestLicenses()to retrieve all licenses byLicense.DeploymentScope. For multi-license stores, usegetLatestLicenses()instead.- Specified by:
licenseScanin interfaceConfluentLicenseStore
-
getLatestLicenses
Reads the license storeLicenseStoreand returns the latest licenses perLicense.DeploymentScope. Only keys inRECORDS_KEY_ID_MAPPINGare included; others are ignored.- Specified by:
getLatestLicensesin interfaceConfluentLicenseStore- Returns:
- map of scope to latest license JWT (possibly empty)
- Throws:
IllegalStateException- if reading the log fails or times out
-
registerLicense
Supports single-licenseLicenseStoreonly. For multi-license configurations useregisterLicense(DeploymentScope, String). UseregisterLicense(DeploymentScope, String)for multi-license stores.- Specified by:
registerLicensein interfaceConfluentLicenseStore
-
registerLicense
Supports single-licenseLicenseStoreonly. UseregisterLicense(DeploymentScope, String)for multi-license configurations. -
registerLicense
Registers a license JWT for the givenLicense.DeploymentScope. Only scopes present inLICENSE_SCOPE_TO_KEY_MAPPINGare supported.- Specified by:
registerLicensein interfaceConfluentLicenseStore- Parameters:
deploymentScope- target scope (e.g. CP, CP_FOR_CC)license- JWT to write
-
topic
-