From c7c0df9348125a0ffc3992c18be23a3ab961c47d Mon Sep 17 00:00:00 2001 From: Niranjana Date: Wed, 17 Jun 2020 20:37:05 +0530 Subject: Modify policy-notification to align with policy. Issue-ID: DCAEGEN2-2216 Signed-off-by: Niranjana Change-Id: I768b4cf785dacc865b0312f5c2ccfdccf2e32a14 --- .../org/onap/dcaegen2/services/sonhms/PmNotificationHandler.java | 3 --- .../dcaegen2/services/sonhms/dmaap/PolicyNotificationCallback.java | 7 ++++--- .../onap/dcaegen2/services/sonhms/model/PolicyNotification.java | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/PmNotificationHandler.java b/src/main/java/org/onap/dcaegen2/services/sonhms/PmNotificationHandler.java index b9ab254..5b7a58f 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/PmNotificationHandler.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/PmNotificationHandler.java @@ -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); diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyNotificationCallback.java b/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyNotificationCallback.java index 82e940d..ad2baf5 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyNotificationCallback.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/PolicyNotificationCallback.java @@ -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); } } diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/model/PolicyNotification.java b/src/main/java/org/onap/dcaegen2/services/sonhms/model/PolicyNotification.java index 2cb1335..8766dff 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/model/PolicyNotification.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/model/PolicyNotification.java @@ -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() { -- cgit 1.2.3-korg