From 17614362f2550c29dcd746ee2c1bc01d0df5de65 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Tue, 25 May 2021 18:57:29 +0530 Subject: Improve Websocket notification interface Improve websocket notification interface Issue-ID: CCSDK-3315 Signed-off-by: Ravi Pendurty Change-Id: I0ded865adddb546ade98df4760e0a32ec964295a Signed-off-by: Ravi Pendurty --- .../ifpac/microwave/WrapperMicrowaveModelRev170324.java | 16 ++++++++++++---- .../ifpac/microwave/WrapperMicrowaveModelRev180907.java | 4 +++- .../ifpac/microwave/WrapperMicrowaveModelRev181010.java | 4 +++- 3 files changed, 18 insertions(+), 6 deletions(-) (limited to 'sdnr/wt/devicemanager-onap/onf12/provider') diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java index 6b32180d1..9ed027658 100644 --- a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java +++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java @@ -206,9 +206,11 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw public void onObjectCreationNotification(ObjectCreationNotification notification) { LOG.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName()); if (notification != null) { + // Send devicemanager specific notification for database and ODLUX microwaveModelListener.creationNotification(acessor.getNodeId(), notification.getCounter(), notification.getTimeStamp(), Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue()); - notificationService.sendNotification(notification, acessor.getNodeId().getValue(), + // Send model specific notification to WebSocketManager + notificationService.sendNotification(notification, acessor.getNodeId(), ObjectCreationNotification.QNAME, notification.getTimeStamp()); } } @@ -217,9 +219,11 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw public void onObjectDeletionNotification(ObjectDeletionNotification notification) { LOG.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName()); if (notification != null) { + // Send devicemanager specific notification for database and ODLUX microwaveModelListener.deletionNotification(acessor.getNodeId(), notification.getCounter(), notification.getTimeStamp(), Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue()); - notificationService.sendNotification(notification, acessor.getNodeId().getValue(), + // Send model specific notification to WebSocketManager + notificationService.sendNotification(notification, acessor.getNodeId(), ObjectDeletionNotification.QNAME, notification.getTimeStamp()); } } @@ -231,8 +235,10 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw .setCounter(notification.getCounter()).setTimestamp(notification.getTimeStamp()) .setObjectId(Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue()) .setAttributeName(notification.getAttributeName()).setNewValue(notification.getNewValue()).build(); + // Send devicemanager specific notification for database and ODLUX microwaveModelListener.eventNotification(beventlogEntity); - notificationService.sendNotification(notification, acessor.getNodeId().getValue(), + // Send model specific notification to WebSocketManager + notificationService.sendNotification(notification, acessor.getNodeId(), AttributeValueChangedNotification.QNAME, notification.getTimeStamp()); if (notificationQueue.isPresent()) { notificationQueue.get().put(beventlogEntity); @@ -249,8 +255,10 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw .setNodeId(this.acessor.getNodeId().getValue()) .setSeverity(mapSeverity(notification.getSeverity())).setCounter(notification.getCounter()) .build(); + // Send devicemanager specific notification for database and ODLUX faultService.faultNotification(faultAlarm); - notificationService.sendNotification(notification, acessor.getNodeId().getValue(), ProblemNotification.QNAME, + // Send model specific notification to WebSocketManager + notificationService.sendNotification(notification, acessor.getNodeId(), ProblemNotification.QNAME, notification.getTimeStamp()); } diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java index 04d72e1fa..e564881c4 100644 --- a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java +++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java @@ -265,8 +265,10 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw .setNodeId(this.acessor.getNodeId().getValue()) .setSeverity(mapSeverity(notification.getSeverity())).setCounter(notification.getCounter()) .build(); + // Send devicemanager specific notification for database and ODLUX faultService.faultNotification(faultAlarm); - notificationService.sendNotification(notification, acessor.getNodeId().getValue(), ProblemNotification.QNAME, + // Send model specific notification to WebSocketManager + notificationService.sendNotification(notification, acessor.getNodeId(), ProblemNotification.QNAME, notification.getTimeStamp()); } diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java index 623fa6220..33349ef72 100644 --- a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java +++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java @@ -260,8 +260,10 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw .setNodeId(this.acessor.getNodeId().getValue()) .setSeverity(mapSeverity(notification.getSeverity())).setCounter(notification.getCounter()) .build(); + // Send devicemanager specific notification for database and ODLUX faultService.faultNotification(faultAlarm); - notificationService.sendNotification(notification, acessor.getNodeId().getValue(), ProblemNotification.QNAME, + // Send model specific notification to WebSocketManager + notificationService.sendNotification(notification, acessor.getNodeId(), ProblemNotification.QNAME, notification.getTimeStamp()); } -- cgit 1.2.3-korg