From 3453264c35275af52a2fdcde33f6e8347a65d15b Mon Sep 17 00:00:00 2001 From: marine Date: Fri, 18 Jun 2021 17:51:46 +0200 Subject: External license as "toggleable feature" Code modification in onboarding BE and onboarding UI so that the External License can be seen as a toggleable feature. By default this will set to true but could be disabled. Issue-ID: SDC-3618 Signed-off-by: sebdet Change-Id: I01690c4cb44d3df590987bb340e8fbb58fe960e0 Signed-off-by: marine --- .../main/java/org/openecomp/sdc/be/togglz/ToggleableFeature.java | 2 +- .../main/java/org/openecomp/sdc/be/togglz/TogglzConfiguration.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'common-be/src') diff --git a/common-be/src/main/java/org/openecomp/sdc/be/togglz/ToggleableFeature.java b/common-be/src/main/java/org/openecomp/sdc/be/togglz/ToggleableFeature.java index bc60eb9be4..7cd5bbdc44 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/togglz/ToggleableFeature.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/togglz/ToggleableFeature.java @@ -25,7 +25,7 @@ import org.togglz.core.annotation.Label; import org.togglz.core.context.FeatureContext; public enum ToggleableFeature implements Feature { - @Label("Default Feature") DEFAULT_FEATURE, @Label("Healing") HEALING; + @Label("Default Feature") DEFAULT_FEATURE, @Label("Healing") HEALING, @Label("External License") EXTERNAL_LICENSE; public static Feature getFeatureByName(String featureName) { return Arrays.stream(values()).filter(e -> e.name().equals(featureName)).findFirst().orElse(null); diff --git a/common-be/src/main/java/org/openecomp/sdc/be/togglz/TogglzConfiguration.java b/common-be/src/main/java/org/openecomp/sdc/be/togglz/TogglzConfiguration.java index 9278b4fb44..9f5b486354 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/togglz/TogglzConfiguration.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/togglz/TogglzConfiguration.java @@ -29,7 +29,10 @@ import org.togglz.core.user.UserProvider; public class TogglzConfiguration implements TogglzConfig { - private static final String TOGGLZ_FILE_LOCATION = "/tmp/features.properties"; + private String togglzFileLocation; + public TogglzConfiguration(){ + this.togglzFileLocation = System.getProperty("features.properties","/tmp/features.properties"); + } @Override public Class getFeatureClass() { @@ -38,7 +41,7 @@ public class TogglzConfiguration implements TogglzConfig { @Override public StateRepository getStateRepository() { - return new FileBasedStateRepository(new File(TOGGLZ_FILE_LOCATION)); + return new FileBasedStateRepository(new File(togglzFileLocation)); } @Override -- cgit 1.2.3-korg