java.lang.Object
org.elasticsearch.license.LicenseUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatMillis(long millis) getAckMessages(License newLicense, License currentLicense) static longgetExpiryDate(License license) Gets the effective expiry date of the given license, including any overrides.static StringgetExpiryWarning(long licenseExpiryDate, long currentTime) static intGets the maximum license version this cluster is compatible with.static XPackLicenseStatusgetXPackLicenseStatus(License license, Clock clock) Derive the status from theLicensefor use withXPackLicenseStatestatic booleanChecks if a givenElasticsearchSecurityExceptionrefers to a feature that requires a valid license, but the license has expired.static booleanlicenseNeedsExtended(License license) newComplianceException(String feature) Exception to be thrown when a feature action requires a valid license, but license has expiredfeatureaccessible throughEXPIRED_FEATURE_METADATAin the exception's rest headerstatic booleansignatureNeedsUpdate(License license) Checks if the signature of a self generated license with older version needs to be recreated with the new keystatic LicenseStatusGets the current status of a license
-
Field Details
-
EXPIRED_FEATURE_METADATA
- See Also:
-
-
Constructor Details
-
LicenseUtils
public LicenseUtils()
-
-
Method Details
-
formatMillis
-
newComplianceException
Exception to be thrown when a feature action requires a valid license, but license has expiredfeatureaccessible throughEXPIRED_FEATURE_METADATAin the exception's rest header -
isLicenseExpiredException
Checks if a givenElasticsearchSecurityExceptionrefers to a feature that requires a valid license, but the license has expired. -
licenseNeedsExtended
-
signatureNeedsUpdate
Checks if the signature of a self generated license with older version needs to be recreated with the new key -
getMaxCompatibleLicenseVersion
public static int getMaxCompatibleLicenseVersion()Gets the maximum license version this cluster is compatible with. This is semantically different fromLicense.VERSION_CURRENTas that field is the maximum that can be handled _by this node_, whereas this method determines the maximum license version that can be handled _by this cluster_. -
getExpiryDate
Gets the effective expiry date of the given license, including any overrides. -
status
Gets the current status of a license -
getXPackLicenseStatus
Derive the status from theLicensefor use withXPackLicenseState- Parameters:
license- The license used to derive the returnedXPackLicenseStatusclock- The clock used for expiry checks. Will typically be Clock.systemUTC();- Returns:
- The status for use with
XPackLicenseState
-
getAckMessages
-
getExpiryWarning
-