2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave;
22 import java.lang.reflect.Constructor;
23 import java.lang.reflect.InvocationTargetException;
24 import java.util.List;
25 import java.util.Optional;
26 import org.eclipse.jdt.annotation.NonNull;
27 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm.PerformanceDataAirInterface170324Builder;
28 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.notifications.NotificationWorker;
29 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName;
30 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
31 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
32 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
33 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
34 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
35 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
36 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
37 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
38 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
39 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
40 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceCurrentProblemTypeG;
41 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceDiversityCurrentProblemTypeG;
42 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceHistoricalPerformanceTypeG;
43 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AttributeValueChangedNotification;
44 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ContainerCurrentProblemTypeG;
45 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ContainerHistoricalPerformanceTypeG;
46 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MicrowaveModelListener;
47 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfaceDiversityPac;
48 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfaceDiversityPacKey;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfacePac;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfacePacKey;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwEthernetContainerPac;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwEthernetContainerPacKey;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwHybridMwStructurePac;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwHybridMwStructurePacKey;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwPureEthernetStructurePac;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwPureEthernetStructurePacKey;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwTdmContainerPac;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwTdmContainerPacKey;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ObjectCreationNotification;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ObjectDeletionNotification;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ProblemNotification;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.SeverityType;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.StructureCurrentProblemTypeG;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceConfiguration;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceCurrentProblems;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
72 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.tdm.container.pac.TdmContainerCurrentProblems;
73 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogBuilder;
74 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity;
75 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
76 import org.opendaylight.yangtools.yang.binding.NotificationListener;
77 import org.opendaylight.yangtools.yang.common.QName;
78 import org.slf4j.Logger;
79 import org.slf4j.LoggerFactory;
82 public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, MicrowaveModelListener {
84 private static final Logger LOG = LoggerFactory.getLogger(WrapperMicrowaveModelRev170324.class);
86 public static final QName QNAME = MwAirInterfacePac.QNAME;
89 private final NotificationService microwaveModelListener;
90 private final NetconfAccessor acessor;
91 private final TransactionUtils genericTransactionUtils;
92 private final FaultService faultService;
94 private Optional<NotificationWorker<EventlogEntity>> notificationQueue;
97 * @param acessor to access device
99 public WrapperMicrowaveModelRev170324(@NonNull NetconfAccessor acessor,
100 @NonNull DeviceManagerServiceProvider serviceProvider) {
101 this.acessor = acessor;
102 this.genericTransactionUtils = acessor.getTransactionUtils();
103 this.microwaveModelListener = serviceProvider.getNotificationService();
104 this.faultService = serviceProvider.getFaultService();
105 this.notificationQueue = Optional.empty();
108 /*-----------------------------------------------------------------------------
112 @SuppressWarnings("unchecked")
114 public <T extends NotificationListener> T getNotificationListener() {
119 public void setNotificationQueue(NotificationWorker<EventlogEntity> notificationQueue) {
120 this.notificationQueue = Optional.of(notificationQueue);
123 /*-----------------------------------------------------------------------------
124 * Interface functions
128 public void readTheFaultsOfMicrowaveModel(ONFLayerProtocolName lpName, Class<?> lpClass, UniversalId uuid,
129 FaultData resultList) {
133 readTheFaultsOfMwAirInterfacePac(uuid, resultList);
136 case ETHERNETCONTAINER12:
137 readTheFaultsOfMwEthernetContainerPac(uuid, resultList);
141 readTheFaultsOfMwTdmContainerPac(uuid, resultList);
145 if (lpClass == MwHybridMwStructurePac.class) {
146 readTheFaultsOfMwHybridMwStructurePac(uuid, resultList);
148 } else if (lpClass == MwAirInterfaceDiversityPac.class) {
149 readTheFaultsOfMwAirInterfaceDiversityPac(uuid, resultList);
151 } else if (lpClass == MwPureEthernetStructurePac.class) {
152 readTheFaultsOfMwPureEthernetStructurePac(uuid, resultList);
155 LOG.warn("Unassigned lp model {} class {}", lpName, lpClass);
159 // No alarms supported
161 case ETHERNETCONTAINER10:
163 LOG.warn("Unassigned or not expected lp in model {}", lpName);
168 public @NonNull PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName,
170 PerformanceDataLtp res = new PerformanceDataLtp();
171 readAirInterfacePerformanceData(lp, res);
172 readEthernetContainerPerformanceData(lp, res);
178 public Class<?> getClassForLtpExtension(QName qName) {
180 if (qName.equals(MwAirInterfacePac.QNAME)) {
181 res = MwAirInterfacePac.class;
182 } else if (qName.equals(MwAirInterfaceDiversityPac.QNAME)) {
183 res = MwAirInterfaceDiversityPac.class;
184 } else if (qName.equals(MwPureEthernetStructurePac.QNAME)) {
185 res = MwPureEthernetStructurePac.class;
186 } else if (qName.equals(MwHybridMwStructurePac.QNAME)) {
187 res = MwHybridMwStructurePac.class;
188 } else if (qName.equals(MwEthernetContainerPac.QNAME)) {
189 res = MwEthernetContainerPac.class;
190 } else if (qName.equals(MwTdmContainerPac.QNAME)) {
191 res = MwTdmContainerPac.class;
193 LOG.info("Found QName {} mapped to {}", String.valueOf(qName), String.valueOf(res));
198 public void onObjectCreationNotification(ObjectCreationNotification notification) {
199 LOG.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName());
200 if (notification != null) {
201 microwaveModelListener.creationNotification(acessor.getNodeId(), notification.getCounter(),
202 notification.getTimeStamp(), Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue());
207 public void onObjectDeletionNotification(ObjectDeletionNotification notification) {
208 LOG.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName());
209 if (notification != null) {
210 microwaveModelListener.deletionNotification(acessor.getNodeId(), notification.getCounter(),
211 notification.getTimeStamp(), Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue());
216 public void onAttributeValueChangedNotification(AttributeValueChangedNotification notification) {
217 LOG.debug("Got event of type :: {}", AttributeValueChangedNotification.class.getSimpleName());
218 EventlogEntity beventlogEntity = new EventlogBuilder().setNodeId(acessor.getNodeId().getValue())
219 .setCounter(notification.getCounter()).setTimestamp(notification.getTimeStamp())
220 .setObjectId(Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue())
221 .setAttributeName(notification.getAttributeName()).setNewValue(notification.getNewValue()).build();
222 microwaveModelListener.eventNotification(beventlogEntity);
223 if (notificationQueue.isPresent()) {
224 notificationQueue.get().put(beventlogEntity);
229 public void onProblemNotification(ProblemNotification notification) {
231 LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
233 faultService.faultNotification(acessor.getNodeId(), notification.getCounter(), notification.getTimeStamp(),
234 Helper.nnGetUniversalId(notification.getObjectIdRef()).getValue(), notification.getProblem(),
235 mapSeverity(notification.getSeverity()));
238 /*-----------------------------------------------------------------------------
239 * Reading problems for specific interface pacs
243 * Read problems of specific interfaces
245 * @param uuId Universal Id String of the interface
246 * @return number of alarms
248 private FaultData readTheFaultsOfMwAirInterfacePac(UniversalId interfacePacUuid, FaultData resultList) {
250 final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class;
252 String mountpointId = acessor.getNodeId().getValue();
253 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
254 mountpointId, interfacePacUuid.getValue());
256 // Step 2.2: construct data and the relative iid
257 InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID =
258 InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(interfacePacUuid))
259 .child(AirInterfaceCurrentProblems.class).build();
261 // Step 2.3: read to the config data store
262 AirInterfaceCurrentProblems problems = genericTransactionUtils.readData(acessor.getDataBroker(),
263 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID);
265 if (problems == null) {
266 LOG.debug("DBRead Id {} no AirInterfaceCurrentProblems", interfacePacUuid);
268 for (AirInterfaceCurrentProblemTypeG problem : problems.nonnullCurrentProblemList()) {
269 resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
270 interfacePacUuid.getValue(), problem.getProblemName(),
271 mapSeverity(problem.getProblemSeverity()));
279 * Read problems of specific interfaces
281 * @param uuId Universal index of Interfacepac
282 * @return number of alarms
284 private FaultData readTheFaultsOfMwEthernetContainerPac(UniversalId interfacePacUuid, FaultData resultList) {
286 final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class;
288 String mountpointId = acessor.getNodeId().getValue();
289 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
290 mountpointId, interfacePacUuid.getValue());
292 InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
293 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(interfacePacUuid))
294 .child(EthernetContainerCurrentProblems.class).build();
296 EthernetContainerCurrentProblems problems = genericTransactionUtils.readData(acessor.getDataBroker(),
297 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
298 if (problems == null) {
299 LOG.debug("DBRead Id {} no EthernetContainerCurrentProblems", interfacePacUuid);
301 for (ContainerCurrentProblemTypeG problem : problems.nonnullCurrentProblemList()) {
302 resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
303 interfacePacUuid.getValue(), problem.getProblemName(),
304 mapSeverity(problem.getProblemSeverity()));
311 * Read problems of specific interfaces
313 * @param uuId Universal index of Interfacepac
314 * @return number of alarms
316 private FaultData readTheFaultsOfMwAirInterfaceDiversityPac(UniversalId interfacePacUuid, FaultData resultList) {
318 final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
319 final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
321 String mountpointId = acessor.getNodeId().getValue();
322 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
323 mountpointId, interfacePacUuid.getValue());
325 InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
326 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(interfacePacUuid)).child(clazzProblems).build();
328 AirInterfaceDiversityCurrentProblems problems = genericTransactionUtils.readData(acessor.getDataBroker(),
329 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
330 if (problems == null) {
331 LOG.debug("DBRead Id {} no AirInterfaceDiversityCurrentProblems", interfacePacUuid);
333 for (AirInterfaceDiversityCurrentProblemTypeG problem : problems.nonnullCurrentProblemList()) {
334 resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
335 interfacePacUuid.getValue(), problem.getProblemName(),
336 mapSeverity(problem.getProblemSeverity()));
343 * Read problems of specific interfaces
345 * @param uuId Universal index of Interfacepac
346 * @return number of alarms
348 private FaultData readTheFaultsOfMwPureEthernetStructurePac(UniversalId interfacePacUuid, FaultData resultList) {
350 final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
351 final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
353 String mountpointId = acessor.getNodeId().getValue();
354 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
355 mountpointId, interfacePacUuid.getValue());
357 InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
358 .builder(clazzPac, new MwPureEthernetStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
360 PureEthernetStructureCurrentProblems problems = genericTransactionUtils.readData(acessor.getDataBroker(),
361 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
362 if (problems == null) {
363 LOG.debug("DBRead Id {} no PureEthernetStructureCurrentProblems", interfacePacUuid);
365 for (StructureCurrentProblemTypeG problem : problems.nonnullCurrentProblemList()) {
366 resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
367 interfacePacUuid.getValue(), problem.getProblemName(),
368 mapSeverity(problem.getProblemSeverity()));
375 * Read problems of specific interfaces
377 * @param uuId Universal index of Interfacepac
378 * @return number of alarms
380 private FaultData readTheFaultsOfMwHybridMwStructurePac(UniversalId interfacePacUuid, FaultData resultList) {
382 final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
383 final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
385 String mountpointId = acessor.getNodeId().getValue();
386 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
387 mountpointId, interfacePacUuid.getValue());
389 InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
390 .builder(clazzPac, new MwHybridMwStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
392 HybridMwStructureCurrentProblems problems = genericTransactionUtils.readData(acessor.getDataBroker(),
393 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
394 if (problems == null) {
395 LOG.debug("DBRead Id {} no HybridMwStructureCurrentProblems", interfacePacUuid);
397 for (StructureCurrentProblemTypeG problem : problems.nonnullCurrentProblemList()) {
398 resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
399 interfacePacUuid.getValue(), problem.getProblemName(),
400 mapSeverity(problem.getProblemSeverity()));
407 * Read problems of specific interfaces. TODO Goal for future implementation without usage of explicit new. Key is
408 * generated by newInstance() function here to verify this approach.
410 * @param uuId Universal index of Interfacepac
411 * @return number of alarms
412 * @throws SecurityException
413 * @throws NoSuchMethodException
414 * @throws InvocationTargetException
415 * @throws IllegalArgumentException
416 * @throws IllegalAccessException
417 * @throws InstantiationException
419 private FaultData readTheFaultsOfMwTdmContainerPac(UniversalId interfacePacUuid, FaultData resultList) {
421 final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
422 final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
423 final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
425 String mountpointId = acessor.getNodeId().getValue();
426 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
427 mountpointId, interfacePacUuid.getValue());
430 // -- Specific part 1
431 Constructor<MwTdmContainerPacKey> cons = clazzPacKey.getConstructor(UniversalId.class); // Avoid new()
432 InstanceIdentifier<TdmContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
433 .builder(clazzPac, cons.newInstance(interfacePacUuid)).child(clazzProblems).build();
435 // -- Specific part 2
436 TdmContainerCurrentProblems problems = genericTransactionUtils.readData(acessor.getDataBroker(),
437 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
438 if (problems == null) {
439 LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
441 // -- Specific part 3
442 for (ContainerCurrentProblemTypeG problem : problems.nonnullCurrentProblemList()) {
443 resultList.add(acessor.getNodeId(), problem.getSequenceNumber(), problem.getTimeStamp(),
444 interfacePacUuid.getValue(), problem.getProblemName(),
445 mapSeverity(problem.getProblemSeverity()));
448 } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
449 | IllegalArgumentException | InvocationTargetException e) {
450 LOG.warn("Could not reade instance of MwTdmContainerPacKey: ", e);
456 * Read and add performance data
458 * @param lp to read from
459 * @param result Object to be filled with data
462 private @NonNull PerformanceDataLtp readAirInterfacePerformanceData(Lp lp, PerformanceDataLtp result) {
464 LOG.debug("DBRead Get {} MWAirInterfacePac: {}", acessor.getNodeId(), lp.getUuid());
466 UniversalId mwAirInterfacePacuuId = lp.getUuid();
467 // Step 2.1: construct data and the relative iid
468 InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID =
469 InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
470 .child(AirInterfaceConfiguration.class).build();
471 AirInterfaceConfiguration airConfiguration = acessor.getTransactionUtils().readData(acessor.getDataBroker(),
472 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID);
474 if (airConfiguration == null) {
475 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId);
478 // Step 2.2: construct data and the relative iid
479 InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID =
480 InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
481 .child(AirInterfaceHistoricalPerformances.class).build();
483 // Step 2.3: read to the config data store
484 AirInterfaceHistoricalPerformances airHistoricalPerformanceData = genericTransactionUtils.readData(
485 acessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID);
487 if (airHistoricalPerformanceData == null) {
488 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances",
489 mwAirInterfacePacuuId);
491 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.air._interface.historical.performances.g.HistoricalPerformanceDataList
492 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList =
493 airHistoricalPerformanceData.nonnullHistoricalPerformanceDataList();
494 LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId,
495 airHistPMList.size());
496 for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistoricalPerformanceData
497 .nonnullHistoricalPerformanceDataList()) {
498 result.add(new PerformanceDataAirInterface170324Builder(acessor.getNodeId(), lp, pmRecord,
503 LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, result.size());
508 private @NonNull PerformanceDataLtp readEthernetContainerPerformanceData(Lp lp, PerformanceDataLtp result) {
509 final String myName = "MWEthernetContainerPac";
511 String mountpointId = acessor.getNodeId().getValue();
513 LOG.debug("DBRead Get {} : {}", mountpointId, myName, lp.getUuid());
515 UniversalId ethContainerPacuuId = lp.getUuid();
516 // Step 2.2: construct data and the relative iid
517 InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier
518 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId))
519 .child(EthernetContainerHistoricalPerformances.class).build();
521 // Step 2.3: read to the config data store
522 EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = acessor.getTransactionUtils()
523 .readData(acessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID);
525 if (ethContainerHistoricalPerformanceData == null) {
526 LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
528 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList =
529 ethContainerHistoricalPerformanceData.nonnullHistoricalPerformanceDataList();
530 LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
531 for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
532 result.add(new PerformanceDataAirInterface170324Builder(acessor.getNodeId(), lp, pmRecord));
535 LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, result.size());
539 private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType mapSeverity(
540 SeverityType severity) {
542 Optional<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType> res =
543 org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType
544 .forName(severity.name());
546 org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType.NonAlarmed);