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;
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;
private final NotificationService microwaveModelListener;
- private final NetconfAccessor acessor;
+ private final NetconfBindingAccessor acessor;
private final TransactionUtils genericTransactionUtils;
private final FaultService faultService;
private Optional<NotificationWorker<EventlogEntity>> notificationQueue;
+ private final WebsocketManagerService notificationService;
+
/**
* @param acessor to access device
*/
- public WrapperMicrowaveModelRev170324(@NonNull NetconfAccessor acessor,
+ public WrapperMicrowaveModelRev170324(@NonNull NetconfBindingAccessor acessor,
@NonNull DeviceManagerServiceProvider serviceProvider) {
this.acessor = acessor;
this.genericTransactionUtils = acessor.getTransactionUtils();
this.microwaveModelListener = serviceProvider.getNotificationService();
this.faultService = serviceProvider.getFaultService();
+ this.notificationService = serviceProvider.getWebsocketService();
this.notificationQueue = Optional.empty();
}
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());
}
}
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());
}
}
.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);
}
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());
}
/*-----------------------------------------------------------------------------
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()));
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()));
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()));
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()));
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()));
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()));
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));