diff options
author | qingshuting <qingshuting1@huawei.com> | 2022-09-14 12:05:19 +0800 |
---|---|---|
committer | qingshuting <qingshuting1@huawei.com> | 2022-09-20 23:14:48 +0800 |
commit | f5db5bd223d369a1186c94f43ab642e9c4d69709 (patch) | |
tree | 1acf6e5cdeff298622d6f6fad8c1431d0e90b43a /components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallback.java | |
parent | 3a0de968e2c5a32a2fa43f791c78455db1c3e641 (diff) |
[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 <qingshuting1@huawei.com>
Change-Id: Id611d10973fca1e1715e9e220819dfcf51bbd1ba
Diffstat (limited to 'components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallback.java')
-rw-r--r-- | components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallback.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallback.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallback.java index 584da7b7..4b880e3d 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallback.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallback.java @@ -3,6 +3,7 @@ * slice-analysis-ms * ================================================================================ * 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. @@ -21,9 +22,10 @@ package org.onap.slice.analysis.ms.dmaap; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Set; +import org.onap.slice.analysis.ms.aai.AaiService; import org.onap.slice.analysis.ms.models.Configuration; import org.onap.slice.analysis.ms.models.vesnotification.NotificationFields; @@ -51,6 +53,9 @@ public class VesNotificationCallback implements NotificationCallback { @Autowired CCVPNPmDatastore ccvpnPmDatastore; + @Autowired + AaiService aaiService; + private static Logger log = LoggerFactory.getLogger(VesNotificationCallback.class); /** @@ -86,6 +91,7 @@ public class VesNotificationCallback implements NotificationCallback { String uniId = null; String bw = null; try { + updateCllInstance(); JsonNode node = obj.readTree(msg); JsonNode notificationNode = node.get(EVENT).get(NOTIFICATIONFIELDS); output = obj.treeToValue(notificationNode, NotificationFields.class); @@ -104,11 +110,18 @@ public class VesNotificationCallback implements NotificationCallback { log.error("Error converting VES msg to object, {}", e.getMessage()); } if (cllId != null && uniId != null && bw != null){ - log.info("Saving new CCVPN service usage data into ccvpnPmDatastore"); log.debug("new bandwidth data -- serviceId: {}, uniId: {}, bw: {}", cllId, uniId, bw); ccvpnPmDatastore.addUsedBwToEndpoint(cllId, uniId, bw); } + } + /** + * Get latest services list, and update local related variables. + */ + public void updateCllInstance(){ + Set<String> instances = aaiService.fetchAllCllInstances(); + log.error("instances {}", instances); + ccvpnPmDatastore.updateCllInstances(instances); } } |