From d9b2a6fef81bf657eac6224dba75254db49c926b Mon Sep 17 00:00:00 2001 From: Yashwanth Date: Tue, 10 Aug 2021 04:42:33 +0000 Subject: Update FM message spec to VES 7.2 Issue-ID: DCAEGEN2-2884 Signed-off-by: Yashwanth Change-Id: I8f609af56604fae86b8a75aaadce14c78ba8ffb8 --- .../org/onap/dcaegen2/services/sonhms/EventHandler.java | 16 +++++++--------- .../org/onap/dcaegen2/services/sonhms/FaultFields.java | 13 +++++++++++-- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'src/main/java') 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 cellIds = new HashSet<>(); List clusterDetails = clusterUtils.getAllClusters(); String networkId = ""; Map> collisionConfusionMap = new HashMap<>(); - for (FaultEvent faultEvent : fmNotification) { String cellId = faultEvent.getEvent().getCommonEventHeader().getSourceName(); cellIds.add(cellId); networkId = faultEvent.getEvent().getFaultFields().getAlarmAdditionalInformation().getNetworkId(); + ArrayList 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; } -- cgit 1.2.3-korg