Fix bug in filtering new FM notification 00/125000/3
authormalar <malarvizhi.44@wipro.com>
Thu, 14 Oct 2021 12:58:18 +0000 (12:58 +0000)
committermalar <malarvizhi.44@wipro.com>
Wed, 20 Oct 2021 11:27:39 +0000 (11:27 +0000)
Issue-ID: DCAEGEN2-2943
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
Change-Id: Ibd0a06695bd14267667f57fe57c3e36b41fb2e12

Changelog.md
dpo/spec/sonhandler-componentspec.json
pom.xml
src/main/java/org/onap/dcaegen2/services/sonhms/Configuration.java
src/main/java/org/onap/dcaegen2/services/sonhms/EventHandler.java
src/main/java/org/onap/dcaegen2/services/sonhms/FaultNotificationComponent.java
src/main/java/org/onap/dcaegen2/services/sonhms/MainThread.java
src/main/java/org/onap/dcaegen2/services/sonhms/restclient/ConfigurationClient.java
src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java
src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java
version.properties

index 02649a6..5a0864b 100644 (file)
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/)
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
+## [2.1.5] - 2021/10/14
+        - [DCAEGEN2-2943](https://jira.onap.org/browse/DCAEGEN2-2943) - Fix bug in filtering new FM notification
+
 ## [2.1.4] - 2021/06/21
          - [DCAEGEN2-2711](https://jira.onap.org/browse/DCAEGEN2-2711) - Update sdk version to load policies from a file mounted by policy sidecar container
          - [DCAEGEN2-2809](https://jira.onap.org/browse/DCAEGEN2-2809) - Remove security vulnerabilities
index 8899dfc..4133c73 100644 (file)
                },
                {
                        "name": "sonhandler.get.cell.data.url",
-                       "value": "execute/cps-ran-schema/get-cell-data",
+                       "value": "execute/cps-ran-schemaset/get-cell-list",
                        "description": "Cps get cell data url",
                        "sourced_at_deployment": false,
                        "policy_editable": false,
                },
                {
                        "name": "sonhandler.get.nbr.list.url",
-                       "value": "execute/cps-ran-schema/get-nbr-list",
+                       "value": "execute/cps-ran-schemaset/get-nbr-list",
                        "description": "Cps get nbr list url",
                        "sourced_at_deployment": false,
                        "policy_editable": false,
                },
                {
                        "name": "sonhandler.get.pci.url",
-                       "value": "execute/cps-ran-schema/get-pci",
+                       "value": "execute/ran-network-schemaset/get-pci",
                        "description": "Cps get pci url",
                        "sourced_at_deployment": false,
                        "policy_editable": false,
                },
                {
                        "name": "sonhandler.get.pnf.url",
-                       "value": "execute/cps-ran-schema/get-pnf",
+                       "value": "execute/ran-network-schemaset/get-pnf",
                        "description": "Cps get pnf url",
                        "sourced_at_deployment": false,
                        "policy_editable": false,
diff --git a/pom.xml b/pom.xml
index 9e41846..1102bfb 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -27,7 +27,7 @@
         <groupId>org.onap.dcaegen2.services.son-handler</groupId>
         <artifactId>son-handler</artifactId>
         <name>dcaegen2-services-son-handler</name>
-        <version>2.1.4-SNAPSHOT</version>
+        <version>2.1.5-SNAPSHOT</version>
 
        <!--parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId>
                 <version>2.0.4.RELEASE</version> </parent -->
index d0a8702..2ddeaa6 100644 (file)
@@ -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;
     }
 
index 64d8593..f551a4a 100644 (file)
@@ -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
index 9f889da..8b97359 100644 (file)
@@ -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);
                }
index a434b31..ebbfb34 100644 (file)
@@ -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);
index 3430469..e4ecda8 100644 (file)
@@ -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;
index 20b95c7..f19c9e8 100644 (file)
@@ -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
+}
index 7ac3b9e..c358ef8 100644 (file)
@@ -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);
index a1b17e4..1d2b98e 100644 (file)
@@ -20,7 +20,7 @@
 ###############################################################################
 major=2
 minor=1
-patch=4
+patch=5
 base_version=${major}.${minor}.${patch}
 release_version=${base_version}
 snapshot_version=${base_version}-SNAPSHOT