X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sdnr%2Fwt%2Fdevicemanager-o-ran-sc%2Fo-ran%2Fru-fh%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fccsdk%2Ffeatures%2Fsdnr%2Fwt%2Fdevicemanager%2Foran%2Fnotification%2FORanDOMFaultNotificationListener.java;h=a6329d58ef8134f5c042ee3ae70c40d249988b13;hb=c2e89eb5cd0e9a42403a45623e97a92a09c757d7;hp=3e99bcd6de23e42d319086a5837ffcfa05488047;hpb=762f33ff221125ad5ecf8d750e06df81e5662865;p=ccsdk%2Ffeatures.git diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/notification/ORanDOMFaultNotificationListener.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/notification/ORanDOMFaultNotificationListener.java index 3e99bcd6d..a6329d58e 100644 --- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/notification/ORanDOMFaultNotificationListener.java +++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/notification/ORanDOMFaultNotificationListener.java @@ -63,7 +63,7 @@ public class ORanDOMFaultNotificationListener implements DOMNotificationListener private final @NonNull DataProvider databaseService; private final @NonNull ORANFM oranfm; - private Integer counter; //Local counter is assigned to Notifications + private Integer counter; //Local counter is assigned to Events in EventLog public ORanDOMFaultNotificationListener(@NonNull NetconfDomAccessor netconfDomAccessor, Optional oranfm, @NonNull VESCollectorService vesCollectorService, @NonNull FaultService faultService, @@ -74,8 +74,8 @@ public class ORanDOMFaultNotificationListener implements DOMNotificationListener this.websocketManagerService = Objects.requireNonNull(websocketManagerService); this.databaseService = Objects.requireNonNull(databaseService); this.oranfm = oranfm.get(); - this.mapper = - new ORanDOMFaultToVESFaultMapper(netconfDomAccessor.getNodeId(), vesCollectorService, "AlarmNotif"); + this.mapper = new ORanDOMFaultToVESFaultMapper(netconfDomAccessor.getNodeId(), this.vesCollectorService, + this.oranfm, "AlarmNotif"); this.counter = 0; } @@ -112,18 +112,20 @@ public class ORanDOMFaultNotificationListener implements DOMNotificationListener // Send devicemanager specific notification for database and ODLUX Instant eventTimeInstant = ORanDMDOMUtility.getNotificationInstant(notification); faultService.faultNotification( - ORanDOMToInternalDataModel.getFaultLog(notification, oranfm, netconfDomAccessor.getNodeId(), counter)); + ORanDOMToInternalDataModel.getFaultLog(notification, oranfm, netconfDomAccessor.getNodeId())); // Send model specific notification to WebSocketManager - websocketManagerService.sendNotification(notification, netconfDomAccessor.getNodeId(), oranfm.getAlarmNotifQName()); + websocketManagerService.sendNotification(notification, netconfDomAccessor.getNodeId(), + oranfm.getAlarmNotifQName()); try { if (vesCollectorService.getConfig().isVESCollectorEnabled()) { - VESCommonEventHeaderPOJO header = mapper.mapCommonEventHeader(notification, eventTimeInstant, counter); - VESFaultFieldsPOJO body = mapper.mapFaultFields(notification, oranfm); + VESCommonEventHeaderPOJO header = mapper.mapCommonEventHeader(notification, eventTimeInstant); + VESFaultFieldsPOJO body = mapper.mapFaultFields(notification); VESMessage vesMsg = vesCollectorService.generateVESEvent(header, body); vesCollectorService.publishVESMessage(vesMsg); LOG.debug("VES Message is {}", vesMsg.getMessage()); - writeToEventLog(vesMsg.getMessage(), eventTimeInstant, oranfm.getAlarmNotifQName().getLocalName(), counter); + writeToEventLog(vesMsg.getMessage(), eventTimeInstant, oranfm.getAlarmNotifQName().getLocalName(), + counter); } } catch (JsonProcessingException | DateTimeParseException e) { LOG.debug("Can not convert event into VES message {}", notification, e); @@ -149,7 +151,7 @@ public class ORanDOMFaultNotificationListener implements DOMNotificationListener } eventlogBuilder.setNewValue(data); eventlogBuilder.setSourceType(SourceType.Netconf); - eventlogBuilder.setTimestamp(ORanDOMToInternalDataModel.getDateAndTimeOfInstant(eventTimeInstant)); + eventlogBuilder.setTimestamp(ORanDMDOMUtility.getDateAndTimeOfInstant(eventTimeInstant)); databaseService.writeEventLog(eventlogBuilder.build()); }