diff options
author | 2021-10-14 12:58:18 +0000 | |
---|---|---|
committer | 2021-10-20 11:27:39 +0000 | |
commit | 9f1c4f29af6640cccaad8fec941fa58fcd833dcd (patch) | |
tree | 29ee8143f8aa02d0e0dc3a3e275facdbc0e993fa /src/main/java/org | |
parent | 29f3dc9cabe5b6a6b2cfddc8a7a24d7a3ff98b4f (diff) |
Fix bug in filtering new FM notification
Issue-ID: DCAEGEN2-2943
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
Change-Id: Ibd0a06695bd14267667f57fe57c3e36b41fb2e12
Diffstat (limited to 'src/main/java/org')
7 files changed, 26 insertions, 17 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/Configuration.java b/src/main/java/org/onap/dcaegen2/services/sonhms/Configuration.java index d0a8702..2ddeaa6 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/Configuration.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/Configuration.java @@ -468,6 +468,7 @@ public class Configuration { public ConfigInterface getConfigurationClient() { ConfigInterface conf = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()); + log.info("ConfigurationClient obj is : " + conf); return conf; } 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 64d8593..f551a4a 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/EventHandler.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/EventHandler.java @@ -98,8 +98,8 @@ public class EventHandler { networkId = faultEvent.getEvent().getFaultFields().getAlarmAdditionalInformation().getNetworkId(); ArrayList<Integer> counts = new ArrayList<>(); - counts.add(faultEvent.getEvent().getFaultFields().getEventCategory().contains("Collision")?1:0); - counts.add(faultEvent.getEvent().getFaultFields().getEventCategory().contains("Confusion")?1:0); + counts.add(faultEvent.getEvent().getFaultFields().getEventCategory().contains("PCICollision")?1:0); + counts.add(faultEvent.getEvent().getFaultFields().getEventCategory().contains("PCIConfusion")?1:0); collisionConfusionMap.put(cellId, counts); } FaultNotificationtoClusterMapping faultNotificationtoClusterMapping = clusterUtils diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/FaultNotificationComponent.java b/src/main/java/org/onap/dcaegen2/services/sonhms/FaultNotificationComponent.java index 9f889da..8b97359 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/FaultNotificationComponent.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/FaultNotificationComponent.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * son-handler * ================================================================================ - * Copyright (C) 2019-2020 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. @@ -47,6 +47,7 @@ public class FaultNotificationComponent { .getBean(FaultNotificationsRepository.class); String notificationString = faultNotificationsRepository.getFaultNotificationFromQueue(); log.info("get fault notifications method"); + log.info("Notification String " + notificationString); if (notificationString == null) { return Either.right(404); } 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 a434b31..ebbfb34 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/MainThread.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/MainThread.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * son-handler * ================================================================================ - * Copyright (C) 2019-2020 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. @@ -161,12 +161,9 @@ public class MainThread implements Runnable { 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")) - || (fmNotification.getEvent().getFaultFields().getSpecificProblem() - .equals("CollisionAndConfusion"))) { + } else if ((fmNotification.getEvent().getFaultFields().getAlarmCondition() + .equalsIgnoreCase("RanPciCollisionConfusionOccurred"))) + { faultCellId = fmNotification.getEvent().getCommonEventHeader().getSourceName(); bufferedFmNotificationCells.put(faultCellId, fmNotification); log.info("Buffered FM cell {}", faultCellId); diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/ConfigurationClient.java b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/ConfigurationClient.java index 3430469..e4ecda8 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/ConfigurationClient.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/ConfigurationClient.java @@ -21,6 +21,9 @@ package org.onap.dcaegen2.services.sonhms.restclient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * Class with method to get the Client type depending on the * configuration client specified. @@ -30,6 +33,8 @@ package org.onap.dcaegen2.services.sonhms.restclient; public class ConfigurationClient { + private static Logger log = LoggerFactory.getLogger(ConfigurationClient.class); + /** * Method to get the Client type. * @@ -39,12 +44,16 @@ public class ConfigurationClient */ public static ConfigInterface configClient(String config_name) { - if (config_name == null || config_name.isEmpty()) - return null; - if ("ConfigDB".equals(config_name)) { + if (config_name == null || config_name.isEmpty()){ + log.info("Returning null from ConfigClient class"); + return null; + } + if ("ConfigDB".equalsIgnoreCase(config_name)) { + log.info("Creating SdnrClient object"); return new SdnrRestClient(); } - else if ("CPS".equals(config_name)) { + if ("CPS".equalsIgnoreCase(config_name)) { + log.info("Creating CPSClient object"); return new CpsClient(); } return null; diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java index 20b95c7..f19c9e8 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java @@ -141,9 +141,9 @@ public class CpsClient extends ConfigInterface { new ParameterizedTypeReference<String>() { }); if (response == null) { - throw new CpsNotFoundException("Cannot reach Config DB"); + throw new CpsNotFoundException("Cannot reach CPS"); } return response.getBody(); } -}
\ No newline at end of file +} diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java b/src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java index 7ac3b9e..c358ef8 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java @@ -304,8 +304,9 @@ public class ClusterUtils { * Find cluster Map. */ public Map<CellPciPair, ArrayList<CellPciPair>> findClusterMap(String cellId) throws ConfigDbNotFoundException, CpsNotFoundException { - log.info("indide clusterMap"); + log.info("inside clusterMap"); int phyCellId = config.getConfigurationClient().getPci(cellId); + log.info("phyCellId of clustermap is" + phyCellId); CellPciPair main = new CellPciPair(); main.setCellId(cellId); main.setPhysicalCellId(phyCellId); |