Modify policy-notification to align with policy. 45/109945/3 frankfurt 6.0.1-ONAP
authorNiranjana <niranjana.y60@wipro.com>
Wed, 17 Jun 2020 15:07:05 +0000 (20:37 +0530)
committerNiranjana Y <niranjana.y60@wipro.com>
Thu, 9 Jul 2020 13:22:01 +0000 (13:22 +0000)
Issue-ID: DCAEGEN2-2216
Signed-off-by: Niranjana <niranjana.y60@wipro.com>
Change-Id: I768b4cf785dacc865b0312f5c2ccfdccf2e32a14

pom.xml
src/main/java/org/onap/dcaegen2/services/sonhms/PmNotificationHandler.java
src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyNotificationCallback.java
src/main/java/org/onap/dcaegen2/services/sonhms/model/PolicyNotification.java
version.properties

diff --git a/pom.xml b/pom.xml
index 9ec00c6..55d581a 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.0.3-SNAPSHOT</version>
+       <version>2.0.4-SNAPSHOT</version>
 
        <!--parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId>
                <version>2.0.4.RELEASE</version> </parent -->
index b9ab254..5b7a58f 100644 (file)
@@ -223,9 +223,6 @@ public class PmNotificationHandler {
             log.info("Policy Notification: {}", notification);
             Boolean result = policyDmaapClient.sendNotificationToPolicy(notification);
             log.info("send notification to policy result {} ", result);
-            // getting policy response
-            policyDmaapClient.handlePolicyResponse(requestId);
-            log.info("handled policy response");
 
         } catch (Exception e) {
             log.error("Exception in sending Anr update to policy ", e);
index 82e940d..ad2baf5 100644 (file)
@@ -45,8 +45,9 @@ public class PolicyNotificationCallback extends NotificationCallback {
        }
 
        private void handlePolicyNotification(String msg) {
+                log.info("Message received from policy: " +msg);
                PciUpdateRepository pciUpdateRepository = BeanUtil.getBean(PciUpdateRepository.class);
-        Configuration configuration = Configuration.getInstance();
+                Configuration configuration = Configuration.getInstance();
                try {
                        ObjectMapper mapper = new ObjectMapper();
                        PolicyNotification policyResponse = mapper.readValue(msg, PolicyNotification.class);
@@ -82,8 +83,8 @@ public class PolicyNotificationCallback extends NotificationCallback {
                                String statusToString = Integer.toString(status);
                                log.info("Handled response from policy, status code {}", statusToString);
                        }
-               } catch (IOException e) {
-                       log.info("caught io exception while fetching policy response");
+               } catch (Exception e) {
+                       log.info("caught exception while fetching policy response:" + e);
 
                }
        }
index 2cb1335..8766dff 100644 (file)
@@ -80,6 +80,8 @@ public class PolicyNotification {
         aai.put("generic-vnf.is-closed-loop-disabled", "false");
         aai.put("generic-vnf.prov-status", "ACTIVE");
         aai.put("pnf.pnf-name", pnfName);
+        this.policyName = "PCI";
+        this.policyVersion = "1.0.2";
     }
 
     public long getClosedLoopAlarmStart() {
index 49429b8..4117421 100644 (file)
@@ -20,7 +20,7 @@
 ###############################################################################
 major=2
 minor=0
-patch=3
+patch=4
 base_version=${major}.${minor}.${patch}
 release_version=${base_version}
 snapshot_version=${base_version}-SNAPSHOT