java.lang.Object
org.elasticsearch.license.XPackLicenseState
A holder for the current state of the license for all xpack features.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionXPackLicenseState(LongSupplier epochMillisProvider) XPackLicenseState(LongSupplier epochMillisProvider, XPackLicenseStatus xPackLicenseStatus) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(LicenseStateListener listener) Add a listener to be notified on license changeCreates a copy of this object based on the state at the time the method was called.Returns a mapping of gold+ features to the last time that feature was used.Return the current license type.booleanisActive()Return true if the license is currently within its time boundaries, false otherwise.booleanisAllowedByLicense(License.OperationMode minimumMode) A convenient method to test whether a feature is by license status.booleanisAllowedByLicense(License.OperationMode minimumMode, boolean needActive) Deprecated.static booleanisFipsAllowedForOperationMode(License.OperationMode operationMode) voidremoveListener(LicenseStateListener listener) Remove a listener
-
Constructor Details
-
XPackLicenseState
-
XPackLicenseState
-
-
Method Details
-
addListener
Add a listener to be notified on license change -
removeListener
Remove a listener -
getOperationMode
Return the current license type. -
isActive
public boolean isActive()Return true if the license is currently within its time boundaries, false otherwise. -
statusDescription
-
getLastUsed
Returns a mapping of gold+ features to the last time that feature was used. Note that if a feature has not been used, it will not appear in the map. -
isFipsAllowedForOperationMode
-
copyCurrentLicenseState
Creates a copy of this object based on the state at the time the method was called. The returned object will not be modified by a license update/expiration so it can be used to make multiple method calls on the license state safely. This object should not be long lived but instead used within a method when a consistent view of the license state is needed for multiple interactions with the license state. -
isAllowedByLicense
@Deprecated public boolean isAllowedByLicense(License.OperationMode minimumMode, boolean needActive) Deprecated.Test whether a feature is allowed by the status of license.- Parameters:
minimumMode- The minimum license to meet or exceedneedActive- Whether current license needs to be active- Returns:
- true if feature is allowed, otherwise false
-
isAllowedByLicense
A convenient method to test whether a feature is by license status.- Parameters:
minimumMode- The minimum license to meet or exceed- See Also:
-