From 7f2e4aa47f56085be6c95cb81b6a8bea8126d56d Mon Sep 17 00:00:00 2001 From: decheng zhang Date: Mon, 28 Feb 2022 11:15:20 -0500 Subject: Jakarta changes in slice-analysis-ms for IBN Cloud leased line update and CCVPN closed-loop. This commit contains work in sub-task: 1) AAI monitor thread; 2) bandwidth evaluator; 3) policy notification code. Issue-ID: DCAEGEN2-3063 Signed-off-by: decheng zhang Change-Id: I9029ffd7563e65be59f7fd76adc2a749ff624172 Signed-off-by: decheng zhang --- .../slice/analysis/ms/models/Configuration.java | 239 +++------------------ 1 file changed, 34 insertions(+), 205 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 2f3f6c2a..d5aeb7b4 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 @@ -3,6 +3,7 @@ * slice-analysis-ms * ================================================================================ * Copyright (C) 2020-2022 Wipro Limited. + * Copyright (C) 2022 Huawei Canada Limited. * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,12 +32,16 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import lombok.Getter; +import lombok.Setter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Model class for the application Configuration */ +@Getter +@Setter public class Configuration { private static Logger log = LoggerFactory.getLogger(Configuration.class); @@ -65,48 +70,22 @@ public class Configuration { private String desUrl; private int pmDataDurationInWeeks; + private int vesNotifPollingInterval; + private String vesNotifChangeIdentifier; + private String vesNotifChangeType; + private int ccvpnEvalInterval; + private double ccvpnEvalThreshold; + private double ccvpnEvalPrecision; + private String aaiNotifTargetAction; + private String aaiNotifTargetSource; + private String aaiNotifTargetEntity; + private boolean ccvpnEvalPeriodicCheckOn; + private boolean ccvpnEvalOnDemandCheckOn; + /** - * Check if topic is secure. + * No args constructor */ - public boolean isSecured() { - return (aafUsername != null); - - } - - public String getAafUsername() { - return aafUsername; - } - - public void setAafUsername(String aafUsername) { - this.aafUsername = aafUsername; - } - - public String getAafPassword() { - return aafPassword; - } - - public void setAafPassword(String aafPassword) { - this.aafPassword = aafPassword; - } - - public Map getStreamsSubscribes() { - return streamsSubscribes; - } - - public void setStreamsSubscribes(Map streamsSubscribes) { - this.streamsSubscribes = streamsSubscribes; - } - - public Map getStreamsPublishes() { - return streamsPublishes; - } - - public void setStreamsPublishes(Map streamsPublishes) { - this.streamsPublishes = streamsPublishes; - } - protected Configuration() { - } /** @@ -119,174 +98,11 @@ public class Configuration { return instance; } - public String getCg() { - return cg; - } - - public void setCg(String cg) { - this.cg = cg; - } - - public String getCid() { - return cid; - } - - public void setCid(String cid) { - this.cid = cid; - } - - public int getPollingInterval() { - return pollingInterval; - } - - public void setPollingInterval(int pollingInterval) { - this.pollingInterval = pollingInterval; - } - - public int getPollingTimeout() { - return pollingTimeout; - } - - public void setPollingTimeout(int pollingTimeout) { - this.pollingTimeout = pollingTimeout; - } - - public String getPgHost() { - return pgHost; - } - - public void setPgHost(String pgHost) { - this.pgHost = pgHost; - } - - public int getPgPort() { - return pgPort; - } - - public void setPgPort(int pgPort) { - this.pgPort = pgPort; - } - - public String getPgUsername() { - return pgUsername; - } - - public void setPgUsername(String pgUsername) { - this.pgUsername = pgUsername; - } - - public String getPgPassword() { - return pgPassword; - } - - public void setPgPassword(String pgPassword) { - this.pgPassword = pgPassword; - } - - public List getDmaapServers() { - return dmaapServers; - } - - public void setDmaapServers(List dmaapServers) { - this.dmaapServers = dmaapServers; - } - - public String getConfigDbService() { - return configDbService; - } - - public void setConfigDbService(String configDbService) { - this.configDbService = configDbService; - } - - public String getCpsUrl() { - return cpsUrl; - } - - public void setCpsUrl(String cpsUrl) { - this.cpsUrl = cpsUrl; - } - - public String getAaiUrl() { - return aaiUrl; - } - - public void setAaiUrl(String aaiUrl) { - this.aaiUrl = aaiUrl; - } - - public Boolean getConfigDbEnabled() { - return configDbEnabled; - } - - public void setConfigDbEnabled(Boolean configDbEnabled) { - this.configDbEnabled = configDbEnabled; - } - - public int getSamples() { - return samples; - } - - public void setSamples(int samples) { - this.samples = samples; - } - - public int getMinPercentageChange() { - return minPercentageChange; - } - - public void setMinPercentageChange(int minPercentageChange) { - this.minPercentageChange = minPercentageChange; - } - - public long getInitialDelaySeconds() { - return initialDelaySeconds; - } - - public void setInitialDelaySeconds(long initialDelaySeconds) { - this.initialDelaySeconds = initialDelaySeconds; - } - - /** - * Get RannfnssiDetails TemplateId from Configuration - */ - public String getRannfnssiDetailsTemplateId() { - return rannfnssiDetailsTemplateId; - } - - /** - * Set RannfnssiDetails TemplateId - */ - public void setRannfnssiDetailsTemplateId(String rannfnssiDetailsTemplateId) { - this.rannfnssiDetailsTemplateId = rannfnssiDetailsTemplateId; - } - - /** - * Get Data Extraction Service Url - */ - public String getDesUrl() { - return desUrl; - } - - /** - * Set Data Extraction Service Url - */ - public void setDesUrl(String desUrl) { - this.desUrl = desUrl; - } - - /** - * Get duration for which PM data is to be fetched from DES - */ - public int getPmDataDurationInWeeks() { - return pmDataDurationInWeeks; - } - /** - * Set duration for which PM data is to be fetched from DES + * Check if topic is secure. */ - public void setPmDataDurationInWeeks(int pmDataDurationInWeeks) { - this.pmDataDurationInWeeks = pmDataDurationInWeeks; + public boolean isSecured() { + return (aafUsername != null); } @Override @@ -340,6 +156,19 @@ public class Configuration { desUrl = jsonObject.get("sliceanalysisms.desUrl").getAsString(); pmDataDurationInWeeks = jsonObject.get("sliceanalysisms.pmDataDurationInWeeks").getAsInt(); + vesNotifChangeIdentifier = jsonObject.get("sliceanalysisms.vesNotifChangeIdentifier").getAsString(); + vesNotifChangeType = jsonObject.get("sliceanalysisms.vesNotifChangeType").getAsString(); + vesNotifPollingInterval = jsonObject.get("sliceanalysisms.vesNotifPollingInterval").getAsInt(); + + aaiNotifTargetAction = jsonObject.get("sliceanalysisms.aaiNotif.targetAction").getAsString(); + aaiNotifTargetSource = jsonObject.get("sliceanalysisms.aaiNotif.targetSource").getAsString(); + aaiNotifTargetSource = jsonObject.get("sliceanalysisms.aaiNotif.targetEntity").getAsString(); + ccvpnEvalInterval = jsonObject.get("sliceanalysisms.ccvpnEvalInterval").getAsInt(); + ccvpnEvalThreshold = jsonObject.get("sliceanalysisms.ccvpnEvalThreshold").getAsDouble(); + ccvpnEvalPrecision = jsonObject.get("sliceanalysisms.ccvpnEvalPrecision").getAsDouble(); + ccvpnEvalPeriodicCheckOn = jsonObject.get("sliceanalysisms.ccvpnEvalPeriodicCheckOn").getAsBoolean(); + ccvpnEvalOnDemandCheckOn = jsonObject.get("sliceanalysisms.ccvpnEvalOnDemandCheckOn").getAsBoolean(); + if (Objects.isNull(jsonObject.get("aafUsername"))) { aafUsername = null; } else { -- cgit 1.2.3-korg