diff --git a/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java b/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java index 97f0a3a23b2..1b37a55166c 100644 --- a/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java +++ b/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java @@ -80,6 +80,7 @@ public class License implements ToXContent { public enum OperationMode { TRIAL, BASIC, + STANDARD, GOLD, PLATINUM; @@ -92,6 +93,8 @@ public class License implements ToXContent { return TRIAL; case "basic": return BASIC; + case "standard": + return STANDARD; case "silver": case "gold": return GOLD; diff --git a/elasticsearch/license/base/src/test/java/org/elasticsearch/license/core/LicenseOperationModeTests.java b/elasticsearch/license/base/src/test/java/org/elasticsearch/license/core/LicenseOperationModeTests.java index 9eaf477169a..12022a712cb 100644 --- a/elasticsearch/license/base/src/test/java/org/elasticsearch/license/core/LicenseOperationModeTests.java +++ b/elasticsearch/license/base/src/test/java/org/elasticsearch/license/core/LicenseOperationModeTests.java @@ -28,6 +28,11 @@ public class LicenseOperationModeTests extends ESTestCase { assertResolve(OperationMode.BASIC, "bAsIc", "basic"); } + public void testResolveStandard() { + // assert expected (2.x+) variant (note: no 1.x variant of STANDARD) + assertResolve(OperationMode.STANDARD, "StAnDARd", "standard"); + } + public void testResolveGold() { // assert expected (2.x+) variant (note: no different 1.x variant of GOLD) assertResolve(OperationMode.GOLD, "SiLvEr", "gOlD", "silver", "gold"); @@ -41,8 +46,7 @@ public class LicenseOperationModeTests extends ESTestCase { } public void testResolveUnknown() { - // standard will hopefully trip the upcoming standard license to add the test here for FWC - String[] types = { "standard", "unknown", "fake" }; + String[] types = { "unknown", "fake" }; for (String type : types) { try { diff --git a/elasticsearch/license/plugin-api/src/main/java/org/elasticsearch/license/plugin/core/Licensee.java b/elasticsearch/license/plugin-api/src/main/java/org/elasticsearch/license/plugin/core/Licensee.java index 27432b4ce8c..3e32e0aa5e8 100644 --- a/elasticsearch/license/plugin-api/src/main/java/org/elasticsearch/license/plugin/core/Licensee.java +++ b/elasticsearch/license/plugin-api/src/main/java/org/elasticsearch/license/plugin/core/Licensee.java @@ -45,7 +45,8 @@ public interface Licensee { * whenever checking different parts of the {@code Status}: *
* Status status = this.status; - * return status.getLicenseState().isActive() && status.getMode().isPaid(); + * return status.getLicenseState() != LicenseState.DISABLED && + * (status.getMode() == OperationMode.TRAIL || status.getMode == OperationMode.PLATINUM); ** Otherwise the license has the potential to change in-between both checks. */ diff --git a/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/graph/license/GraphLicensee.java b/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/graph/license/GraphLicensee.java index 5b6e66ec8e8..9848e4679b0 100644 --- a/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/graph/license/GraphLicensee.java +++ b/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/graph/license/GraphLicensee.java @@ -35,6 +35,7 @@ public class GraphLicensee extends AbstractLicenseeComponent
- * Only users with the following license types can update the retention period: - *
* Note: This does not consider the state of the license so that any change is remembered for when they fix their license.
*
* @return {@code true} if the user is allowed to modify the retention. Otherwise {@code false}.
diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/MarvelLicenseeTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/MarvelLicenseeTests.java
index ea7754bebe0..6462e003259 100644
--- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/MarvelLicenseeTests.java
+++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/MarvelLicenseeTests.java
@@ -6,7 +6,6 @@
package org.elasticsearch.marvel.license;
import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.license.core.License;
import org.elasticsearch.license.core.License.OperationMode;
import org.elasticsearch.license.plugin.core.AbstractLicenseeTestCase;
import org.elasticsearch.license.plugin.core.LicenseState;
@@ -35,7 +34,7 @@ public class MarvelLicenseeTests extends AbstractLicenseeTestCase {
}
public void testAcknowledgementMessagesToTrialGoldOrPlatinumFromAnyIsNoOp() {
- assertEmptyAck(randomMode(), randomTrialGoldOrPlatinumMode(), licensee);
+ assertEmptyAck(randomMode(), randomTrialStandardGoldOrPlatinumMode(), licensee);
}
public void testAcknowledgementMessagesToBasicFromNotBasicNotesLimits() {
diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/license/ShieldLicensee.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/license/ShieldLicensee.java
index 7befc95f4c6..0592a0273dc 100644
--- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/license/ShieldLicensee.java
+++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/license/ShieldLicensee.java
@@ -51,27 +51,30 @@ public class ShieldLicensee extends AbstractLicenseeComponent
*
*
@@ -82,9 +84,6 @@ public class WatcherLicensee extends AbstractLicenseeComponent