public class ConfluentLicenseValidator extends java.lang.Object implements org.apache.kafka.server.license.LicenseValidator, java.util.function.Consumer<LicenseChanged>
InvalidLicenseException
if the license is
invalid or has expired. The component using the license (e.g. broker) fails to start as
a result without a valid or free license. Thereafter, the component may continue to function
with proprietary features enabled even if license expires. In this case, an error is logged
periodically.
License is stored in a Kafka topic in the MDS cluster if MDS is enabled. Otherwise it is stored
in the Kafka cluster associated with the component.Modifier and Type | Class and Description |
---|---|
static class |
ConfluentLicenseValidator.LicenseStatus |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
METRIC_GROUP |
static java.lang.String |
METRIC_NAME |
Constructor and Description |
---|
ConfluentLicenseValidator() |
Modifier and Type | Method and Description |
---|---|
void |
accept(LicenseChanged licenseChanged) |
void |
close() |
void |
configure(java.util.Map<java.lang.String,?> configs) |
protected LicenseManager |
createLicenseManager(LicenseConfig licenseConfig) |
boolean |
enabled() |
boolean |
isLicenseValid() |
protected void |
registerMetric(java.lang.String metricGroup) |
protected void |
schedulePeriodicValidation() |
void |
start(java.lang.String componentId) |
protected void |
updateExpiredStatus(ConfluentLicenseValidator.LicenseStatus status,
java.util.Date expirationDate) |
protected void |
updateLicenseStatus(ConfluentLicenseValidator.LicenseStatus status) |
public static final java.lang.String METRIC_GROUP
public static final java.lang.String METRIC_NAME
public void configure(java.util.Map<java.lang.String,?> configs)
configure
in interface org.apache.kafka.common.Configurable
public final boolean enabled()
enabled
in interface org.apache.kafka.server.license.LicenseValidator
public void start(java.lang.String componentId)
start
in interface org.apache.kafka.server.license.LicenseValidator
public boolean isLicenseValid()
isLicenseValid
in interface org.apache.kafka.server.license.LicenseValidator
public void accept(LicenseChanged licenseChanged)
accept
in interface java.util.function.Consumer<LicenseChanged>
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
protected LicenseManager createLicenseManager(LicenseConfig licenseConfig)
protected void updateExpiredStatus(ConfluentLicenseValidator.LicenseStatus status, java.util.Date expirationDate)
protected void updateLicenseStatus(ConfluentLicenseValidator.LicenseStatus status)
protected void registerMetric(java.lang.String metricGroup)
protected void schedulePeriodicValidation()