diff --git a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/GetStatusAction.java b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/GetStatusAction.java index 8446bfca7513b..ec8c85d39015e 100644 --- a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/GetStatusAction.java +++ b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/GetStatusAction.java @@ -36,7 +36,6 @@ public static class Response extends ActionResponse implements ToXContentObject private boolean resourcesCreated; private boolean pre891Data; private boolean timedOut; - private boolean validLicense; public Response(StreamInput in) throws IOException { super(in); @@ -45,21 +44,13 @@ public Response(StreamInput in) throws IOException { resourcesCreated = in.readBoolean(); pre891Data = in.readBoolean(); timedOut = in.readBoolean(); - validLicense = in.readBoolean(); } - public Response( - boolean profilingEnabled, - boolean resourceManagementEnabled, - boolean resourcesCreated, - boolean pre891Data, - boolean validLicense - ) { + public Response(boolean profilingEnabled, boolean resourceManagementEnabled, boolean resourcesCreated, boolean pre891Data) { this.profilingEnabled = profilingEnabled; this.resourceManagementEnabled = resourceManagementEnabled; this.resourcesCreated = resourcesCreated; this.pre891Data = pre891Data; - this.validLicense = validLicense; } public void setTimedOut(boolean timedOut) { @@ -73,7 +64,7 @@ public boolean isResourcesCreated() { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); - builder.startObject("profiling").field("enabled", profilingEnabled).field("valid_license", validLicense).endObject(); + builder.startObject("profiling").field("enabled", profilingEnabled).endObject(); builder.startObject("resource_management").field("enabled", resourceManagementEnabled).endObject(); builder.startObject("resources").field("created", resourcesCreated).field("pre_8_9_1_data", pre891Data).endObject(); builder.endObject(); @@ -87,7 +78,6 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(resourcesCreated); out.writeBoolean(pre891Data); out.writeBoolean(timedOut); - out.writeBoolean(validLicense); } @Override @@ -99,13 +89,12 @@ public boolean equals(Object o) { && resourceManagementEnabled == response.resourceManagementEnabled && resourcesCreated == response.resourcesCreated && pre891Data == response.pre891Data - && timedOut == response.timedOut - && validLicense == response.validLicense; + && timedOut == response.timedOut; } @Override public int hashCode() { - return Objects.hash(profilingEnabled, resourceManagementEnabled, resourcesCreated, pre891Data, timedOut, validLicense); + return Objects.hash(profilingEnabled, resourceManagementEnabled, resourcesCreated, pre891Data, timedOut); } @Override diff --git a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/TransportGetStatusAction.java b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/TransportGetStatusAction.java index 147c10b579fb4..6c4a7d455539f 100644 --- a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/TransportGetStatusAction.java +++ b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/TransportGetStatusAction.java @@ -41,8 +41,7 @@ public TransportGetStatusAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver, - ProfilingLicenseChecker licenseChecker + IndexNameExpressionResolver indexNameExpressionResolver ) { super( GetStatusAction.NAME, @@ -55,7 +54,7 @@ public TransportGetStatusAction( GetStatusAction.Response::new, EsExecutors.DIRECT_EXECUTOR_SERVICE ); - this.resolver = new StatusResolver(clusterService, licenseChecker); + this.resolver = new StatusResolver(clusterService); } @Override @@ -129,11 +128,9 @@ public void onTimeout(TimeValue timeout) { private static class StatusResolver { private final ClusterService clusterService; - private final ProfilingLicenseChecker licenseChecker; - private StatusResolver(ClusterService clusterService, ProfilingLicenseChecker licenseChecker) { + private StatusResolver(ClusterService clusterService) { this.clusterService = clusterService; - this.licenseChecker = licenseChecker; } private GetStatusAction.Response getResponse(ClusterState state) { @@ -152,9 +149,8 @@ private GetStatusAction.Response getResponse(ClusterState state) { boolean indicesPre891 = ProfilingIndexManager.isAnyResourceTooOld(state, indexStateResolver); boolean dataStreamsPre891 = ProfilingDataStreamManager.isAnyResourceTooOld(state, indexStateResolver); boolean anyPre891Data = indicesPre891 || dataStreamsPre891; - boolean validLicense = licenseChecker.isSupportedLicense(); - return new GetStatusAction.Response(pluginEnabled, resourceManagementEnabled, resourcesCreated, anyPre891Data, validLicense); + return new GetStatusAction.Response(pluginEnabled, resourceManagementEnabled, resourcesCreated, anyPre891Data); } private boolean getValue(ClusterState state, Setting setting) {