summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-onf/provider/src/main
diff options
context:
space:
mode:
authorMichael DÜrre <michael.duerre@highstreet-technologies.com>2021-04-08 06:34:22 +0200
committerMichael DÜrre <michael.duerre@highstreet-technologies.com>2021-04-08 06:34:46 +0200
commitf3969004c6ccac18e742c5fc48c844e315991023 (patch)
treef5486a62e842bb16ca7d3af47a8663df08feef55 /sdnr/wt/devicemanager-onf/provider/src/main
parenta252be83694ae33260d99d5371ed48c1558aa2e8 (diff)
update websocketmanager
update complete notification flow Issue-ID: CCSDK-3252 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com> Change-Id: I87ba00f615707b942471fcace57bcda50ce37e61
Diffstat (limited to 'sdnr/wt/devicemanager-onf/provider/src/main')
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java3
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java1
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java48
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java21
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java41
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java10
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java3
7 files changed, 86 insertions, 41 deletions
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java
index ed9726a11..e6c3865f7 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java
@@ -29,6 +29,7 @@ import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.manufactured.thing.g.ManufacturerProperties;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.InventoryBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -85,7 +86,7 @@ public class ExtendedEquipment {
// General
inventoryBuilder.setNodeId(getNodeId());
inventoryBuilder.setParentUuid(getParentUuid());
- inventoryBuilder.setTreeLevel(Long.valueOf(getTreeLevel()));
+ inventoryBuilder.setTreeLevel(Uint32.valueOf(getTreeLevel()));
if (getEquipment() != null) {
inventoryBuilder.setUuid(getEquipment().getUuid().getValue());
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java
index 0c51c5ebc..3c0878495 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java
@@ -29,7 +29,6 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.OnfInterfacePac;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.EquipmentData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.InventoryInformationDcae;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java
index 12c8b540a..6b32180d1 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java
@@ -33,9 +33,9 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
+import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
@@ -74,6 +74,9 @@ import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.r
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.tdm.container.pac.TdmContainerCurrentProblems;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.NotificationListener;
import org.opendaylight.yangtools.yang.common.QName;
@@ -95,6 +98,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
private Optional<NotificationWorker<EventlogEntity>> notificationQueue;
+ private final WebsocketManagerService notificationService;
+
/**
* @param acessor to access device
*/
@@ -104,6 +109,7 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
this.genericTransactionUtils = acessor.getTransactionUtils();
this.microwaveModelListener = serviceProvider.getNotificationService();
this.faultService = serviceProvider.getFaultService();
+ this.notificationService = serviceProvider.getWebsocketService();
this.notificationQueue = Optional.empty();
}
@@ -202,6 +208,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
if (notification != null) {
microwaveModelListener.creationNotification(acessor.getNodeId(), notification.getCounter(),
notification.getTimeStamp(), Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue());
+ notificationService.sendNotification(notification, acessor.getNodeId().getValue(),
+ ObjectCreationNotification.QNAME, notification.getTimeStamp());
}
}
@@ -211,6 +219,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
if (notification != null) {
microwaveModelListener.deletionNotification(acessor.getNodeId(), notification.getCounter(),
notification.getTimeStamp(), Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue());
+ notificationService.sendNotification(notification, acessor.getNodeId().getValue(),
+ ObjectDeletionNotification.QNAME, notification.getTimeStamp());
}
}
@@ -222,6 +232,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
.setObjectId(Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue())
.setAttributeName(notification.getAttributeName()).setNewValue(notification.getNewValue()).build();
microwaveModelListener.eventNotification(beventlogEntity);
+ notificationService.sendNotification(notification, acessor.getNodeId().getValue(),
+ AttributeValueChangedNotification.QNAME, notification.getTimeStamp());
if (notificationQueue.isPresent()) {
notificationQueue.get().put(beventlogEntity);
}
@@ -231,10 +243,15 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
public void onProblemNotification(ProblemNotification notification) {
LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
-
- faultService.faultNotification(acessor.getNodeId(), notification.getCounter(), notification.getTimeStamp(),
- Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue(), notification.getProblem(),
- mapSeverity(notification.getSeverity()));
+ FaultlogEntity faultAlarm = new FaultlogBuilder().setObjectId(notification.getObjectIdRef().getValue())
+ .setProblem(notification.getProblem()).setSourceType(SourceType.Netconf)
+ .setTimestamp(notification.getTimeStamp())
+ .setNodeId(this.acessor.getNodeId().getValue())
+ .setSeverity(mapSeverity(notification.getSeverity())).setCounter(notification.getCounter())
+ .build();
+ faultService.faultNotification(faultAlarm);
+ notificationService.sendNotification(notification, acessor.getNodeId().getValue(), ProblemNotification.QNAME,
+ notification.getTimeStamp());
}
/*-----------------------------------------------------------------------------
@@ -267,7 +284,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
if (problems == null) {
LOG.debug("DBRead Id {} no AirInterfaceCurrentProblems", interfacePacUuid);
} else {
- for (AirInterfaceCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (AirInterfaceCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -300,7 +318,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
if (problems == null) {
LOG.debug("DBRead Id {} no EthernetContainerCurrentProblems", interfacePacUuid);
} else {
- for (ContainerCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (ContainerCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -332,7 +351,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
if (problems == null) {
LOG.debug("DBRead Id {} no AirInterfaceDiversityCurrentProblems", interfacePacUuid);
} else {
- for (AirInterfaceDiversityCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (AirInterfaceDiversityCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -364,7 +384,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
if (problems == null) {
LOG.debug("DBRead Id {} no PureEthernetStructureCurrentProblems", interfacePacUuid);
} else {
- for (StructureCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (StructureCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -396,7 +417,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
if (problems == null) {
LOG.debug("DBRead Id {} no HybridMwStructureCurrentProblems", interfacePacUuid);
} else {
- for (StructureCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (StructureCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -441,7 +463,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
} else {
// -- Specific part 3
- for (ContainerCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (ContainerCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -527,7 +550,8 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw
LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
} else {
Collection<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList =
- YangHelper.getCollection(ethContainerHistoricalPerformanceData.nonnullHistoricalPerformanceDataList());
+ YangHelper.getCollection(
+ ethContainerHistoricalPerformanceData.nonnullHistoricalPerformanceDataList());
LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
result.add(new PerformanceDataAirInterface170324Builder(acessor.getNodeId(), lp, pmRecord));
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java
index 653a786f0..04d72e1fa 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java
@@ -33,9 +33,9 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
+import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
@@ -74,6 +74,9 @@ import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.r
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.tdm.container.pac.TdmContainerCurrentProblems;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.NotificationListener;
import org.opendaylight.yangtools.yang.common.QName;
@@ -93,10 +96,12 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw
private final TransactionUtils genericTransactionUtil;
private final String mountpointId;
private final @NonNull FaultService faultService;
+ private final WebsocketManagerService notificationService;
private Optional<NotificationWorker<EventlogEntity>> notificationQueue;
+
/**
* Handle specific version of microwave model
*
@@ -110,6 +115,7 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw
this.genericTransactionUtil = acessor.getTransactionUtils();
this.microwaveModelListener = serviceProvider.getNotificationService();
this.faultService = serviceProvider.getFaultService();
+ this.notificationService = serviceProvider.getWebsocketService();
this.notificationQueue = Optional.empty();
}
@@ -253,10 +259,15 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw
public void onProblemNotification(ProblemNotification notification) {
LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
-
- faultService.faultNotification(acessor.getNodeId(), notification.getCounter(), notification.getTimeStamp(),
- Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue(), notification.getProblem(),
- mapSeverity(notification.getSeverity()));
+ FaultlogEntity faultAlarm = new FaultlogBuilder().setObjectId(notification.getObjectIdRef().getValue())
+ .setProblem(notification.getProblem()).setSourceType(SourceType.Netconf)
+ .setTimestamp(notification.getTimeStamp())
+ .setNodeId(this.acessor.getNodeId().getValue())
+ .setSeverity(mapSeverity(notification.getSeverity())).setCounter(notification.getCounter())
+ .build();
+ faultService.faultNotification(faultAlarm);
+ notificationService.sendNotification(notification, acessor.getNodeId().getValue(), ProblemNotification.QNAME,
+ notification.getTimeStamp());
}
/*-----------------------------------------------------------------------------
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java
index a1f71c586..623fa6220 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java
@@ -33,9 +33,9 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
+import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
@@ -74,6 +74,9 @@ import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.r
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.tdm.container.pac.TdmContainerCurrentProblems;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.NotificationListener;
import org.opendaylight.yangtools.yang.common.QName;
@@ -93,6 +96,7 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
private final TransactionUtils genericTransactionUtils;
private final String mountpointId;
private final @NonNull FaultService faultService;
+ private final WebsocketManagerService notificationService;
private Optional<NotificationWorker<EventlogEntity>> notificationQueue;
@@ -109,6 +113,7 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
this.mountpointId = acessor.getNodeId().getValue();
this.microwaveModelListener = serviceProvider.getNotificationService();
this.faultService = serviceProvider.getFaultService();
+ this.notificationService = serviceProvider.getWebsocketService();
this.notificationQueue = Optional.empty();
}
@@ -249,10 +254,15 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
public void onProblemNotification(ProblemNotification notification) {
LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
-
- faultService.faultNotification(acessor.getNodeId(), notification.getCounter(), notification.getTimeStamp(),
- Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue(), notification.getProblem(),
- mapSeverity(notification.getSeverity()));
+ FaultlogEntity faultAlarm = new FaultlogBuilder().setObjectId(notification.getObjectIdRef().getValue())
+ .setProblem(notification.getProblem()).setSourceType(SourceType.Netconf)
+ .setTimestamp(notification.getTimeStamp())
+ .setNodeId(this.acessor.getNodeId().getValue())
+ .setSeverity(mapSeverity(notification.getSeverity())).setCounter(notification.getCounter())
+ .build();
+ faultService.faultNotification(faultAlarm);
+ notificationService.sendNotification(notification, acessor.getNodeId().getValue(), ProblemNotification.QNAME,
+ notification.getTimeStamp());
}
/*-----------------------------------------------------------------------------
@@ -286,7 +296,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
} else if (problems.getCurrentProblemList() == null) {
LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
} else {
- for (AirInterfaceCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (AirInterfaceCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -319,7 +330,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
} else if (problems.getCurrentProblemList() == null) {
LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
} else {
- for (ContainerCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (ContainerCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -352,7 +364,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
} else if (problems.getCurrentProblemList() == null) {
LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
} else {
- for (AirInterfaceDiversityCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (AirInterfaceDiversityCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -385,7 +398,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
} else if (problems.getCurrentProblemList() == null) {
LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
} else {
- for (StructureCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (StructureCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -418,7 +432,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
} else if (problems.getCurrentProblemList() == null) {
LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
} else {
- for (StructureCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (StructureCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -462,7 +477,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
} else {
// -- Specific part 3
- for (ContainerCurrentProblemTypeG problem : YangHelper.getCollection(problems.nonnullCurrentProblemList())) {
+ for (ContainerCurrentProblemTypeG problem : YangHelper
+ .getCollection(problems.nonnullCurrentProblemList())) {
resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
interfacePacUuid.getValue(), problem.getProblemName(),
mapSeverity(problem.getProblemSeverity()));
@@ -549,7 +565,8 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw
LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
} else {
Collection<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList =
- YangHelper.getCollection(ethContainerHistoricalPerformanceData.nonnullHistoricalPerformanceDataList());
+ YangHelper.getCollection(
+ ethContainerHistoricalPerformanceData.nonnullHistoricalPerformanceDataList());
LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
result.add(new PerformanceDataAirInterface181010Builder(acessor.getNodeId(), lp, pmRecord));
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java
index 3c6140d82..a7a09fccb 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java
@@ -31,7 +31,6 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNotifications;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementDeviceType;
@@ -70,8 +69,6 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base {
private final @NonNull String mountPointNodeName;
private final @NonNull NetconfBindingAccessor acessor;
private final @NonNull DeviceManagerOnfConfiguration pollAlarmConfig;
-
- private final NetconfNotifications notificationAccessor;
/*-----------------------------------------------------------------------------
* Construction
@@ -98,9 +95,6 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base {
this.performanceManager = serviceProvider.getPerformanceManagerService();
this.eventListenerHandler = serviceProvider.getEventHandlingService();
this.dataProvider = serviceProvider.getDataProvider();
-
- this.notificationAccessor = acessor.getNotificationAccessor().get();
-
}
/*-----------------------------------------------------------------------------
@@ -167,7 +161,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base {
faultService.initCurrentProblemStatus(nodeId, resultList);
LOG.debug("DB write current problems completed");
- equipmentService.writeEquipment(equipment.getEquipmentData());
+ equipmentService.writeEquipment(nodeId, equipment.getEquipmentData());
LOG.info("Found info at {} for device {} number of problems: {}", getMountpoint(), getUuId(),
resultList.size());
@@ -207,7 +201,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base {
doRegisterEventListener(acessor.getMountpoint());
// Register netconf stream
- notificationAccessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream);
+ acessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream);
// Set core-model revision value in "core-model-capability" field
setCoreModel(acessor.getNetconfNode());
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java
index 6cd6c949a..836f36214 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java
@@ -33,7 +33,6 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.EquipmentService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.opendaylight.mdsal.binding.api.MountPoint;
import org.opendaylight.mdsal.binding.api.NotificationService;
@@ -216,7 +215,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas
microwaveEventListener.initCurrentProblemStatus(nodeId, resultList);
LOG.debug("DB write current problems completed");
- equipmentService.writeEquipment(equipment.getEquipmentData());
+ equipmentService.writeEquipment(nodeId, equipment.getEquipmentData());
LOG.info("Found info at {} for device {} number of problems: {}", getMountpoint(), getUuId(),
resultList.size());