aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYashwanth <gandhapu.yashwanth@wipro.com>2021-08-10 04:42:33 +0000
committerYashwanth <gandhapu.yashwanth@wipro.com>2021-08-24 05:17:23 +0000
commitd9b2a6fef81bf657eac6224dba75254db49c926b (patch)
tree5456a8ed5f29c2a77ffed72f907996b1a0e5998f /src
parent160ae68e618e1ecddc9a067a986b7c8c26ce457f (diff)
Update FM message spec to VES 7.2
Issue-ID: DCAEGEN2-2884 Signed-off-by: Yashwanth <gandhapu.yashwanth@wipro.com> Change-Id: I8f609af56604fae86b8a75aaadce14c78ba8ffb8
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/dcaegen2/services/sonhms/EventHandler.java16
-rw-r--r--src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java13
-rw-r--r--src/test/resources/faultNotification.json9
3 files changed, 22 insertions, 16 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/EventHandler.java b/src/main/java/org/onap/dcaegen2/services/sonhms/EventHandler.java
index c96cbc8..325de6f 100644
--- a/src/main/java/org/onap/dcaegen2/services/sonhms/EventHandler.java
+++ b/src/main/java/org/onap/dcaegen2/services/sonhms/EventHandler.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* son-handler
* ================================================================================
- * Copyright (C) 2019 Wipro Limited.
+ * Copyright (C) 2019-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -86,25 +86,25 @@ public class EventHandler {
log.info("Handling Fault notification");
log.info("fm notification {}", fmNotification);
-
+
Set<String> cellIds = new HashSet<>();
List<ClusterDetails> clusterDetails = clusterUtils.getAllClusters();
String networkId = "";
Map<String, ArrayList<Integer>> collisionConfusionMap = new HashMap<>();
-
for (FaultEvent faultEvent : fmNotification) {
String cellId = faultEvent.getEvent().getCommonEventHeader().getSourceName();
cellIds.add(cellId);
networkId = faultEvent.getEvent().getFaultFields().getAlarmAdditionalInformation().getNetworkId();
+
ArrayList<Integer> counts = new ArrayList<>();
- counts.add(faultEvent.getEvent().getFaultFields().getAlarmAdditionalInformation().getCollisions());
- counts.add(faultEvent.getEvent().getFaultFields().getAlarmAdditionalInformation().getConfusions());
+ counts.add(faultEvent.getEvent().getFaultFields().getEventCategory().contains("Collision")?1:0);
+ counts.add(faultEvent.getEvent().getFaultFields().getEventCategory().contains("Confusion")?1:0);
collisionConfusionMap.put(cellId, counts);
}
FaultNotificationtoClusterMapping faultNotificationtoClusterMapping = clusterUtils
.getClustersForFmNotification(cellIds, clusterDetails);
-
faultNotificationtoClusterMapping.setCollisionConfusionMap(collisionConfusionMap);
+
// matching cells
if (faultNotificationtoClusterMapping.getCellsinCluster() != null
&& !faultNotificationtoClusterMapping.getCellsinCluster().isEmpty()) {
@@ -113,13 +113,11 @@ public class EventHandler {
} catch (ConfigDbNotFoundException e) {
log.error("Config DB Exception {}", e);
}
-
}
// unmatched new cells
if (faultNotificationtoClusterMapping.getNewCells() != null
&& !faultNotificationtoClusterMapping.getNewCells().isEmpty()) {
- handleUnmatchedFmCells(faultNotificationtoClusterMapping, networkId);
-
+ handleUnmatchedFmCells(faultNotificationtoClusterMapping, networkId);
}
return true;
diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java b/src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java
index e95d38e..0501fb0 100644
--- a/src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java
+++ b/src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* son-handler
* ================================================================================
- * Copyright (C) 2019 Wipro Limited.
+ * Copyright (C) 2019-2021 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ public class FaultFields {
@Override
public String toString() {
return "FaultFields [faultFieldsVersion=" + faultFieldsVersion + ", alarmCondition=" + alarmCondition
- + ", eventSourceType=" + eventSourceType + ", specificProblem=" + specificProblem + ", eventSeverity="
+ + ", eventSourceType=" + eventSourceType + ", eventCategory=" + eventCategory + ", specificProblem=" + specificProblem + ", eventSeverity="
+ eventSeverity + ", vfStatus=" + vfStatus + ", alarmAdditionalInformation="
+ alarmAdditionalInformation + "]";
}
@@ -37,6 +37,7 @@ public class FaultFields {
private double faultFieldsVersion;
private String alarmCondition;
private String eventSourceType;
+ private String eventCategory;
private String specificProblem;
private String eventSeverity;
private String vfStatus;
@@ -74,6 +75,14 @@ public class FaultFields {
this.eventSourceType = eventSourceType;
}
+ public String getEventCategory() {
+ return eventCategory;
+ }
+
+ public void setEventCategory(String eventCategory) {
+ this.eventCategory = eventCategory;
+ }
+
public String getSpecificProblem() {
return specificProblem;
}
diff --git a/src/test/resources/faultNotification.json b/src/test/resources/faultNotification.json
index 803302a..0df4974 100644
--- a/src/test/resources/faultNotification.json
+++ b/src/test/resources/faultNotification.json
@@ -2,7 +2,7 @@
"event":{
"commonEventHeader":{
"version":"4.0.1",
- "vesEventListenerVersion":"7.0.1",
+ "vesEventListenerVersion":"7.2",
"domain":"fault",
"eventName":"Fault_RansimAgent-Wipro_RanPCIProblem",
"eventId":"fault000001",
@@ -22,13 +22,12 @@
"faultFieldsVersion":"4.0",
"alarmCondition":"RanPciCollisionConfusionOccurred",
"eventSourceType":"other",
- "specificProblem":"Collision",
+ "specificProblem":"Chn0025",
"eventSeverity":"CRITICAL",
+ "eventCategory": "PCICollision",
"vfStatus":"Active",
"alarmAdditionalInformation":{
- "networkId":"NTWK005",
- "collisions":"2",
- "confusions":"0"
+ "networkId":"NTWK005"
}
}
}