summaryrefslogtreecommitdiffstats
path: root/src/main
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/main
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/main')
-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
2 files changed, 18 insertions, 11 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;
}