From f5db5bd223d369a1186c94f43ab642e9c4d69709 Mon Sep 17 00:00:00 2001 From: qingshuting Date: Wed, 14 Sep 2022 12:05:19 +0800 Subject: [SLICEMS] Add bw decrease logics and enhance runtime config feature Add closed loop assurance decrease bw logics. Add a thread transfers latest data from cbs client configs to corresponding value. Add runtime configuration function. Fix the bug that cll service info didn't get updated when a cll service is deleted. Issue-ID: DCAEGEN2-3240 Issue-ID: DCAEGEN2-3264 Issue-ID: DCAEGEN2-3255 Issue-ID: DCAEGEN2-3238 Signed-off-by: qingshuting Change-Id: Id611d10973fca1e1715e9e220819dfcf51bbd1ba --- .../slice/analysis/ms/models/Configuration.java | 40 ++++++++++++++-------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java') diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java index 4b5fe2ed..c1599517 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2020-2022 Wipro Limited. * Copyright (C) 2022 Huawei Canada Limited. + * Copyright (C) 2022 Huawei Technologies Co., Ltd. * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,12 +70,12 @@ public class Configuration { private String rannfnssiDetailsTemplateId; private String desUrl; private int pmDataDurationInWeeks; - private int vesNotifPollingInterval; private String vesNotifChangeIdentifier; private String vesNotifChangeType; private int ccvpnEvalInterval; - private double ccvpnEvalThreshold; + private double ccvpnEvalUpperThreshold; + private double ccvpnEvalLowerThreshold; private double ccvpnEvalPrecision; private String aaiNotifTargetAction; private String aaiNotifTargetSource; @@ -108,15 +109,21 @@ public class Configuration { @Override public String toString() { - return "Configuration [pgHost=" + pgHost + ", pgPort=" + pgPort + ", pgUsername=" + pgUsername + ", pgPassword=" - + pgPassword + ", dmaapServers=" + dmaapServers + ", configDbService=" + configDbService + ", cpsUrl=" - + cpsUrl + ", aaiUrl=" + aaiUrl + ", configDbEnabled=" + configDbEnabled + ", cg=" + cg + ", cid=" + cid - + ", pollingInterval=" + pollingInterval + ", pollingTimeout=" + pollingTimeout + ", aafUsername=" - + aafUsername + ", aafPassword=" + aafPassword + ", streamsSubscribes=" + streamsSubscribes - + ", streamsPublishes=" + streamsPublishes + ", samples=" + samples + ", minPercentageChange=" - + minPercentageChange + ", initialDelaySeconds=" + initialDelaySeconds + ", rannfnssiDetailsTemplateId=" - + rannfnssiDetailsTemplateId + ", desUrl=" + desUrl + ", pmDataDurationInWeeks=" + pmDataDurationInWeeks - + "]"; + return "Configuration [pgHost=" + pgHost + ", pgPort=" + pgPort + ", pgUsername=" + pgUsername + + ", dmaapServers=" + dmaapServers + ", configDbService=" + configDbService + ", cpsUrl=" + + cpsUrl + ", aaiUrl=" + aaiUrl + ", configDbEnabled=" + configDbEnabled + ", cg=" + cg + ", cid=" + cid + + ", pollingInterval=" + pollingInterval + ", pollingTimeout=" + pollingTimeout + ", aafUsername=" + + aafUsername + ", streamsSubscribes=" + streamsSubscribes + + ", streamsPublishes=" + streamsPublishes + ", samples=" + samples + ", minPercentageChange=" + + minPercentageChange + ", initialDelaySeconds=" + initialDelaySeconds + ", rannfnssiDetailsTemplateId=" + + rannfnssiDetailsTemplateId + ", desUrl=" + desUrl + ", pmDataDurationInWeeks=" + pmDataDurationInWeeks + + ", vesNotifPollingInterval=" + vesNotifPollingInterval + ", vesNotifChangeIdentifier=" + + vesNotifChangeIdentifier + ", vesNotifChangeIdentifier=" + vesNotifChangeType + ", ccvpnEvalInterval=" + + ccvpnEvalInterval + ", ccvpnEvalUpperThreshold=" + ccvpnEvalUpperThreshold + ", ccvpnEvalLowerThreshold=" + + ccvpnEvalLowerThreshold + ", ccvpnEvalPrecision=" + ccvpnEvalPrecision + ", aaiNotifTargetAction=" + + aaiNotifTargetAction + ", aaiNotifTargetSource=" + aaiNotifTargetSource + ", aaiNotifTargetEntity=" + + aaiNotifTargetEntity + ", ccvpnEvalPeriodicCheckOn=" + ccvpnEvalPeriodicCheckOn + + ", ccvpnEvalOnDemandCheckOn=" + ccvpnEvalOnDemandCheckOn + ", ccvpnEvalStrategy=" + ccvpnEvalStrategy + "]"; } /** @@ -126,7 +133,8 @@ public class Configuration { log.info("Updating configuration from CBS"); - Type mapType = new TypeToken>() {}.getType(); + Type mapType = new TypeToken>() { + }.getType(); JsonObject subscribes = jsonObject.getAsJsonObject("streams_subscribes"); streamsSubscribes = new Gson().fromJson(subscribes, mapType); @@ -141,7 +149,8 @@ public class Configuration { pgHost = jsonObject.get("postgres.host").getAsString(); JsonArray servers = jsonObject.getAsJsonArray("sliceanalysisms.dmaap.server"); - Type listType = new TypeToken>() {}.getType(); + Type listType = new TypeToken>() { + }.getType(); dmaapServers = new Gson().fromJson(servers, listType); cg = jsonObject.get("sliceanalysisms.cg").getAsString(); @@ -165,7 +174,8 @@ public class Configuration { aaiNotifTargetSource = jsonObject.get("sliceanalysisms.aaiNotif.targetSource").getAsString(); aaiNotifTargetEntity = jsonObject.get("sliceanalysisms.aaiNotif.targetEntity").getAsString(); ccvpnEvalInterval = jsonObject.get("sliceanalysisms.ccvpnEvalInterval").getAsInt(); - ccvpnEvalThreshold = jsonObject.get("sliceanalysisms.ccvpnEvalThreshold").getAsDouble(); + ccvpnEvalUpperThreshold = jsonObject.get("sliceanalysisms.ccvpnEvalUpperThreshold").getAsDouble(); + ccvpnEvalLowerThreshold = jsonObject.get("sliceanalysisms.ccvpnEvalLowerThreshold").getAsDouble(); ccvpnEvalPrecision = jsonObject.get("sliceanalysisms.ccvpnEvalPrecision").getAsDouble(); ccvpnEvalPeriodicCheckOn = jsonObject.get("sliceanalysisms.ccvpnEvalPeriodicCheckOn").getAsBoolean(); ccvpnEvalOnDemandCheckOn = jsonObject.get("sliceanalysisms.ccvpnEvalOnDemandCheckOn").getAsBoolean(); @@ -191,6 +201,6 @@ public class Configuration { } else { cpsUrl = jsonObject.get("sliceanalysisms.cps.url").getAsString(); } - log.info("configuration from CBS {}", this); + log.info("configuration from CBS has been updated to {}", this); } } -- cgit 1.2.3-korg