summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2021-12-01 14:22:37 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2021-12-01 15:25:34 +0800
commit5cc6fc1a762c547f420ce281deac69f02f6c2b83 (patch)
treef59492080a97a46699cffa634a19423e0050f06d /rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java
parent2eedf476653c9054d946332a15b62d465619abd4 (diff)
Change rule retrieval from CBS to ConfigMap
Issue-ID: HOLMES-488 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn> Change-Id: I89f4d47b9b2e0f1c9c9d32083a146d54d0000c5d
Diffstat (limited to 'rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java')
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java17
1 files changed, 6 insertions, 11 deletions
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java
index f77b909..a9a78c8 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java
@@ -17,13 +17,10 @@
package org.onap.holmes.rulemgt;
import io.dropwizard.setup.Environment;
-import org.onap.holmes.common.config.MicroServiceConfig;
+import org.onap.holmes.common.ConfigFileScanner;
import org.onap.holmes.common.dropwizard.ioc.bundle.IOCApplication;
-import org.onap.holmes.common.utils.CommonUtils;
import org.onap.holmes.common.utils.transactionid.TransactionIdFilter;
-import org.onap.holmes.rulemgt.dcae.DcaeConfigurationPolling;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.onap.holmes.rulemgt.dcae.ConfigFileScanningTask;
import javax.servlet.DispatcherType;
import java.util.EnumSet;
@@ -41,12 +38,10 @@ public class RuleActiveApp extends IOCApplication<RuleAppConfig> {
public void run(RuleAppConfig configuration, Environment environment) throws Exception {
super.run(configuration, environment);
- if (!"1".equals(System.getenv("TESTING"))) {
- ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
- service.scheduleAtFixedRate(
- new DcaeConfigurationPolling(CommonUtils.getEnv(MicroServiceConfig.HOSTNAME)), 0,
- DcaeConfigurationPolling.POLLING_PERIOD, TimeUnit.MILLISECONDS);
- }
+ ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
+ service.scheduleAtFixedRate(
+ new ConfigFileScanningTask(new ConfigFileScanner()), 60L,
+ ConfigFileScanningTask.POLLING_PERIOD, TimeUnit.SECONDS);
environment.servlets().addFilter("customFilter", new TransactionIdFilter()).addMappingForUrlPatterns(EnumSet
.allOf(DispatcherType.class), true, "/*");