aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniranjana <niranjana.y60@wipro.com>2020-01-21 10:51:00 +0530
committerniranjana <niranjana.y60@wipro.com>2020-01-21 10:51:00 +0530
commite05d755dfb068c5d88a0b6d5cf44b3db60afe573 (patch)
treebc7303feb4014aff4f88762dbf750ad46793c277
parentf6bfc74f26a88e27524280e5bf75617600a15a0b (diff)
Process fault clearance notification from RANSIM
Issue-ID: DCAEGEN2-2033 Signed-off-by: niranjana <niranjana.y60@wipro.com> Change-Id: I7a84dadd8bde8f403a498c4017d633148bf575c9
-rw-r--r--src/main/java/org/onap/dcaegen2/services/sonhms/MainThread.java76
1 files changed, 44 insertions, 32 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/MainThread.java b/src/main/java/org/onap/dcaegen2/services/sonhms/MainThread.java
index 43c8e3d..2f30a91 100644
--- a/src/main/java/org/onap/dcaegen2/services/sonhms/MainThread.java
+++ b/src/main/java/org/onap/dcaegen2/services/sonhms/MainThread.java
@@ -145,38 +145,50 @@ public class MainThread implements Runnable {
}
if (newFmNotification.getNewNotif()) {
- log.info("newFmNotification has come");
-
- String faultCellId = "";
- Either<List<FaultEvent>, Integer> fmNotifications = faultNotificationComponent
- .getFaultNotifications();
- if (fmNotifications.isRight()) {
- if (fmNotifications.right().value() == 400) {
- log.info("Error parsing notifications");
- } else if (fmNotifications.right().value() == 404) {
- newFmNotification.setNewNotif(false);
- }
- } else {
- for (FaultEvent fmNotification : fmNotifications.left().value()) {
- faultCellId = fmNotification.getEvent().getCommonEventHeader().getSourceName();
- bufferedFmNotificationCells.put(faultCellId, fmNotification);
- log.info("Buffered FM cell {}", faultCellId);
- log.info("fmNotification{}", fmNotification);
-
- }
- log.info("bufferedFMNotificationCells before staring timer {}",
- bufferedFmNotificationCells.keySet());
-
- for (String sdnrCell : sdnrNotificationCells) {
- bufferedFmNotificationCells.remove(sdnrCell);
- }
-
- startTimer = new Timestamp(System.currentTimeMillis());
- isTimer = true;
- log.info("Buffered FM cell {}", bufferedFmNotificationCells.keySet());
- }
-
- }
+ log.info("newFmNotification has come");
+
+ String faultCellId = "";
+ Either<List<FaultEvent>, Integer> fmNotifications = faultNotificationComponent
+ .getFaultNotifications();
+ if (fmNotifications.isRight()) {
+ if (fmNotifications.right().value() == 400) {
+ log.info("Error parsing notifications");
+ } else if (fmNotifications.right().value() == 404) {
+ newFmNotification.setNewNotif(false);
+ }
+ } else {
+ for (FaultEvent fmNotification : fmNotifications.left().value()) {
+ if (fmNotification.getEvent().getFaultFields().getSpecificProblem()
+ .equals("Optimised PCI")) {
+ log.info("PCI problem cleared for :" + fmNotification);
+ } else if ((fmNotification.getEvent().getFaultFields().getSpecificProblem()
+ .equals("Collision"))
+ || (fmNotification.getEvent().getFaultFields().getSpecificProblem()
+ .equals("Confusion"))) {
+ faultCellId = fmNotification.getEvent().getCommonEventHeader().getSourceName();
+ bufferedFmNotificationCells.put(faultCellId, fmNotification);
+ log.info("Buffered FM cell {}", faultCellId);
+ log.info("fmNotification{}", fmNotification);
+ } else {
+ log.info("Error resolving faultNotification for :" + fmNotification);
+ }
+ }
+
+ if (!(bufferedFmNotificationCells.isEmpty())) {
+ log.info("bufferedFMNotificationCells before staring timer {}",
+ bufferedFmNotificationCells.keySet());
+
+ for (String sdnrCell : sdnrNotificationCells) {
+ bufferedFmNotificationCells.remove(sdnrCell);
+ }
+
+ startTimer = new Timestamp(System.currentTimeMillis());
+ isTimer = true;
+ log.info("Buffered FM cell {}", bufferedFmNotificationCells.keySet());
+ }
+ }
+
+ }
} catch (Exception e) {
log.error("Exception in main Thread", e);