diff options
author | Ittay Stern <ittay.stern@att.com> | 2020-01-14 20:35:51 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-01-15 15:42:46 +0200 |
commit | 9dab9fa0a02e19123149e2fe661ec61cac955120 (patch) | |
tree | a955d3098350079af076894fa3418a55738a5103 /vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java | |
parent | e8d84989d4ff3489901934825279b73c453cbeb5 (diff) |
Honor user-cookie to select a temporal feature set
Issue-ID: VID-747
Change-Id: I5acd4685bedfed8570a6fd698101f541d03c8d82
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java index 4d4387d4e..96331b7c4 100644 --- a/vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java +++ b/vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java @@ -20,6 +20,8 @@ package org.onap.vid.properties; +import java.io.File; +import javax.servlet.ServletContext; import org.apache.commons.lang3.StringUtils; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; @@ -30,9 +32,6 @@ import org.togglz.core.manager.FeatureManagerBuilder; import org.togglz.core.repository.file.FileBasedStateRepository; import org.togglz.spring.listener.TogglzApplicationContextBinderApplicationListener; -import javax.servlet.ServletContext; -import java.io.File; - @Configuration public class FeaturesTogglingConfiguration { @Bean @@ -52,11 +51,13 @@ public class FeaturesTogglingConfiguration { filename = StringUtils.trimToNull(filename); - return new FeatureManagerBuilder() + return new FeatureSetsManager( + new FeatureManagerBuilder() .featureEnum(Features.class) .stateRepository(new FileBasedStateRepository( - new File(filename.startsWith("/")? filename : servletContext.getRealPath("/WEB-INF/conf/" + filename)) + new File(filename.startsWith("/") ? filename : servletContext.getRealPath("/WEB-INF/conf/" + filename)) )) - .build(); + .build(), new AlternativeFeatureSetNameFromCookie(), servletContext + ); } } |