public class ConfluentLicenseValidator extends java.lang.Object implements org.apache.kafka.server.license.LicenseValidator, java.util.function.Consumer<LicenseChanged>
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 |
Modifier | Constructor and Description |
---|---|
|
ConfluentLicenseValidator() |
protected |
ConfluentLicenseValidator(LicenseManager licenseManager,
java.util.concurrent.ScheduledExecutorService executorService,
java.time.Duration checkLicenseInterval) |
Modifier and Type | Method and Description |
---|---|
void |
accept(LicenseChanged licenseChanged) |
protected void |
checkLicense() |
void |
close() |
void |
configure(java.util.Map<java.lang.String,?> configs) |
protected LicenseManager |
createLicenseManager(LicenseConfig licenseConfig) |
protected io.confluent.license.validator.ConfluentLicenseValidator.KafkaLicenseStore |
createLicenseStore(LicenseConfig licenseConfig) |
boolean |
enabled() |
protected long |
getNextCheckIntervalMsAndMaybeLog(long timeRemainingMs) |
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 |
updateInvalidStatus(java.lang.String reason) |
protected void |
updateLicenseStatus(ConfluentLicenseValidator.LicenseStatus status) |
public static final java.lang.String METRIC_GROUP
public static final java.lang.String METRIC_NAME
public ConfluentLicenseValidator()
protected ConfluentLicenseValidator(LicenseManager licenseManager, java.util.concurrent.ScheduledExecutorService executorService, java.time.Duration checkLicenseInterval)
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 io.confluent.license.validator.ConfluentLicenseValidator.KafkaLicenseStore createLicenseStore(LicenseConfig licenseConfig)
protected LicenseManager createLicenseManager(LicenseConfig licenseConfig)
protected void updateExpiredStatus(ConfluentLicenseValidator.LicenseStatus status, java.util.Date expirationDate)
protected void updateInvalidStatus(java.lang.String reason)
protected void updateLicenseStatus(ConfluentLicenseValidator.LicenseStatus status)
protected void registerMetric(java.lang.String metricGroup)
protected void schedulePeriodicValidation()
protected void checkLicense()
protected long getNextCheckIntervalMsAndMaybeLog(long timeRemainingMs)