Package org.elasticsearch.license
Class LicenseService
java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.license.LicenseService
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ClusterStateListener,LifecycleComponent,Releasable,SchedulerEngine.Listener
public class LicenseService extends AbstractLifecycleComponent implements ClusterStateListener, SchedulerEngine.Listener
Service responsible for managing
LicensesMetadata.
On the master node, the service handles updating the cluster state when a new license is registered.
It also listens on all nodes for cluster state updates, and updates XPackLicenseState when
the license changes are detected in the cluster state.
-
Field Summary
Fields Modifier and Type Field Description static Setting<java.util.List<License.LicenseType>>ALLOWED_LICENSE_TYPES_SETTINGstatic longBASIC_SELF_GENERATED_LICENSE_EXPIRATION_MILLISstatic java.lang.StringLICENSE_JOBstatic Setting<License.LicenseType>SELF_GENERATED_LICENSE_TYPE -
Constructor Summary
Constructors Constructor Description LicenseService(Settings settings, ClusterService clusterService, java.time.Clock clock, Environment env, ResourceWatcherService resourceWatcherService, XPackLicenseState licenseState) -
Method Summary
Modifier and Type Method Description voidclusterChanged(ClusterChangedEvent event)When there is no global block onGatewayService.STATE_NOT_RECOVERED_BLOCKnotify licensees and issue auto-generated license if no license has been installed/issued yet.protected voiddoClose()protected voiddoStart()protected voiddoStop()static java.util.Map<java.lang.String,java.lang.String[]>getAckMessages(License newLicense, License currentLicense)LicensegetLicense()static LicensegetLicense(Metadata metadata)voidregisterLicense(PutLicenseRequest request, ActionListener<PutLicenseResponse> listener)Registers new license in the cluster Master only operation.voidremoveLicense(DeleteLicenseRequest request, ActionListener<PostStartBasicResponse> listener)Remove license from the cluster state metadatavoidtriggered(SchedulerEngine.Event event)protected voidupdateLicenseState(License license, Version mostRecentTrialVersion)Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
-
Field Details
-
SELF_GENERATED_LICENSE_TYPE
-
ALLOWED_LICENSE_TYPES_SETTING
-
BASIC_SELF_GENERATED_LICENSE_EXPIRATION_MILLIS
public static final long BASIC_SELF_GENERATED_LICENSE_EXPIRATION_MILLIS -
LICENSE_JOB
public static final java.lang.String LICENSE_JOB- See Also:
- Constant Field Values
-
-
Constructor Details
-
LicenseService
public LicenseService(Settings settings, ClusterService clusterService, java.time.Clock clock, Environment env, ResourceWatcherService resourceWatcherService, XPackLicenseState licenseState)
-
-
Method Details
-
registerLicense
public void registerLicense(PutLicenseRequest request, ActionListener<PutLicenseResponse> listener)Registers new license in the cluster Master only operation. Installs a new license on the master provided it is VALID -
getAckMessages
-
triggered
- Specified by:
triggeredin interfaceSchedulerEngine.Listener
-
removeLicense
public void removeLicense(DeleteLicenseRequest request, ActionListener<PostStartBasicResponse> listener)Remove license from the cluster state metadata -
getLicense
-
doStart
- Specified by:
doStartin classAbstractLifecycleComponent- Throws:
ElasticsearchException
-
doStop
- Specified by:
doStopin classAbstractLifecycleComponent- Throws:
ElasticsearchException
-
doClose
- Specified by:
doClosein classAbstractLifecycleComponent- Throws:
ElasticsearchException
-
clusterChanged
When there is no global block onGatewayService.STATE_NOT_RECOVERED_BLOCKnotify licensees and issue auto-generated license if no license has been installed/issued yet.- Specified by:
clusterChangedin interfaceClusterStateListener
-
updateLicenseState
-
getLicense
-