1 /*******************************************************************************
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==========================================================================
17 ******************************************************************************/
18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.wrapperc;
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
25 import java.lang.reflect.Constructor;
26 import java.lang.reflect.InvocationTargetException;
27 import java.util.ArrayList;
28 import java.util.List;
30 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
31 import org.opendaylight.yangtools.yang.binding.NotificationListener;
32 import org.opendaylight.yangtools.yang.common.QName;
33 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.internalTypes.InternalDateAndTime;
34 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.internalTypes.InternalSeverity;
35 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.ONFCOreNetworkElementCoreData;
36 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.ONFCoreNetworkElement12;
37 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.container.ExtendedAirInterfaceHistoricalPerformanceType1211;
38 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.container.ONFLayerProtocolName;
39 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.util.GenericTransactionUtils;
40 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.AttributeValueChangedNotificationXml;
41 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectCreationNotificationXml;
42 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectDeletionNotificationXml;
43 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ProblemNotificationXml;
44 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
46 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
47 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.OtnHistoryDataG;
48 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AirInterfaceCurrentProblemTypeG;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AirInterfaceDiversityCurrentProblemTypeG;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AirInterfaceHistoricalPerformanceTypeG;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ContainerCurrentProblemTypeG;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ContainerHistoricalPerformanceTypeG;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MicrowaveModelListener;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfaceDiversityPac;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfaceDiversityPacKey;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfacePac;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfacePacKey;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwEthernetContainerPac;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwEthernetContainerPacKey;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwHybridMwStructurePac;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwHybridMwStructurePacKey;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwPureEthernetStructurePac;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwPureEthernetStructurePacKey;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwTdmContainerPac;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwTdmContainerPacKey;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.StructureCurrentProblemTypeG;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceConfiguration;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceCurrentProblems;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
72 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
73 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
74 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
75 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
76 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.tdm.container.pac.TdmContainerCurrentProblems;
77 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AttributeValueChangedNotification;
78 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ObjectCreationNotification;
79 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ObjectDeletionNotification;
80 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ProblemNotification;
83 public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, MicrowaveModelListener {
85 private static final Logger LOG = LoggerFactory.getLogger(ONFCoreNetworkElement12.class);
87 public static final QName QNAME = MwAirInterfacePac.QNAME;
90 private ONFCOreNetworkElementCoreData coreData;
92 private OnfMicrowaveModelNotification microwaveModelListener;
95 /*-----------------------------------------------------------------------------
99 public void setCoreData(ONFCOreNetworkElementCoreData coreData) {
100 this.coreData = coreData;
103 public ONFCOreNetworkElementCoreData getCoreData() {
108 public void setOnfMicrowaveModelListener(OnfMicrowaveModelNotification microwaveModelListener) {
109 this.microwaveModelListener = microwaveModelListener;
112 @SuppressWarnings("unchecked")
114 public <T extends NotificationListener> T getNotificationListener() {
118 /*-----------------------------------------------------------------------------
122 public void readTheFaultsOfMicrowaveModel(ONFLayerProtocolName lpName, Class<?> lpClass, UniversalId uuid,
123 List<ProblemNotificationXml> resultList) {
127 readTheFaultsOfMwAirInterfacePac(uuid, resultList);
130 case EthernetContainer12:
131 readTheFaultsOfMwEthernetContainerPac(uuid, resultList);
135 readTheFaultsOfMwTdmContainerPac(uuid, resultList);
139 if (lpClass == MwHybridMwStructurePac.class) {
140 readTheFaultsOfMwHybridMwStructurePac(uuid, resultList);
142 } else if (lpClass == MwAirInterfaceDiversityPac.class) {
143 readTheFaultsOfMwAirInterfaceDiversityPac(uuid, resultList);
145 } else if (lpClass == MwPureEthernetStructurePac.class) {
146 readTheFaultsOfMwPureEthernetStructurePac(uuid, resultList);
149 LOG.warn("Unassigned lp model {} class {}", lpName, lpClass);
153 // No alarms supported
155 case EthernetContainer10:
157 LOG.warn("Unassigned or not expected lp in model {}", lpName);
161 public List<? extends OtnHistoryDataG> readTheHistoricalPerformanceData(ONFLayerProtocolName lpName, Lp lp) {
164 return readTheHistoricalPerformanceDataOfMwAirInterfacePac(lp);
166 case EthernetContainer12:
167 return readTheHistoricalPerformanceDataOfEthernetContainer(lp);
169 case EthernetContainer10:
170 case EthernetPhysical:
175 LOG.debug("Do not read HistoricalPM data for {} {}", lpName, lp.getUuid().getValue());
178 return new ArrayList<>();
181 public Class<?> getClassForLtpExtension(QName qName) {
183 if (qName.equals(MwAirInterfacePac.QNAME)) {
184 res = MwAirInterfacePac.class;
185 } else if (qName.equals(MwAirInterfaceDiversityPac.QNAME)) {
186 res = MwAirInterfaceDiversityPac.class;
187 } else if (qName.equals(MwPureEthernetStructurePac.QNAME)) {
188 res = MwPureEthernetStructurePac.class;
189 } else if (qName.equals(MwHybridMwStructurePac.QNAME)) {
190 res = MwHybridMwStructurePac.class;
191 } else if (qName.equals(MwEthernetContainerPac.QNAME)) {
192 res = MwEthernetContainerPac.class;
193 } else if (qName.equals(MwTdmContainerPac.QNAME)) {
194 res = MwTdmContainerPac.class;
196 LOG.info("Found QName {} mapped to {}", String.valueOf(qName), String.valueOf(res));
200 /*-----------------------------------------------------------------------------
201 * Reading problems for specific interface pacs
205 * Read problems of specific interfaces
207 * @param uuId Universal Id String of the interface
208 * @return number of alarms
210 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfacePac(UniversalId interfacePacUuid,
211 List<ProblemNotificationXml> resultList) {
213 final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class;
214 // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class;
215 // final Class<AirInterfaceCurrentProblems> clazzProblems =
216 // AirInterfaceCurrentProblems.class;
217 // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem =
218 // AirInterfaceCurrentProblemTypeG.class;
220 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
221 coreData.getMountpoint(), interfacePacUuid.getValue());
223 // Step 2.2: construct data and the relative iid
224 InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID = InstanceIdentifier
225 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(interfacePacUuid))
226 .child(AirInterfaceCurrentProblems.class).build();
228 // Step 2.3: read to the config data store
229 AirInterfaceCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
230 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID);
232 if (problems == null) {
233 LOG.debug("DBRead Id {} no AirInterfaceCurrentProblems", interfacePacUuid);
234 } else if (problems.getCurrentProblemList() == null) {
235 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
237 for (AirInterfaceCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
238 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
239 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
240 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
247 * Read problems of specific interfaces
249 * @param uuId Universal index of Interfacepac
250 * @return number of alarms
252 private List<ProblemNotificationXml> readTheFaultsOfMwEthernetContainerPac(UniversalId interfacePacUuid,
253 List<ProblemNotificationXml> resultList) {
255 final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class;
256 // final Class<MwEthernetContainerPacKey> clazzPacKey =
257 // MwEthernetContainerPacKey.class;
258 // final Class<EthernetContainerCurrentProblems> clazzProblems =
259 // EthernetContainerCurrentProblems.class;
260 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
261 // ContainerCurrentProblemTypeG.class;
263 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
264 coreData.getMountpoint(), interfacePacUuid.getValue());
266 InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
267 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(interfacePacUuid))
268 .child(EthernetContainerCurrentProblems.class).build();
270 EthernetContainerCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
271 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
272 if (problems == null) {
273 LOG.debug("DBRead Id {} no EthernetContainerCurrentProblems", interfacePacUuid);
274 } else if (problems.getCurrentProblemList() == null) {
275 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
277 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
278 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
279 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
280 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
287 * Read problems of specific interfaces
289 * @param uuId Universal index of Interfacepac
290 * @return number of alarms
292 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfaceDiversityPac(UniversalId interfacePacUuid,
293 List<ProblemNotificationXml> resultList) {
295 final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
296 // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey =
297 // MwAirInterfaceDiversityPacKey.class;
298 final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
299 // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem =
300 // AirInterfaceDiversityCurrentProblemTypeG.class;
302 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
303 coreData.getMountpoint(), interfacePacUuid.getValue());
305 InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
306 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(interfacePacUuid)).child(clazzProblems).build();
308 AirInterfaceDiversityCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
309 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
310 if (problems == null) {
311 LOG.debug("DBRead Id {} no AirInterfaceDiversityCurrentProblems", interfacePacUuid);
312 } else if (problems.getCurrentProblemList() == null) {
313 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
315 for (AirInterfaceDiversityCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
316 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
317 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
318 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
325 * Read problems of specific interfaces
327 * @param uuId Universal index of Interfacepac
328 * @return number of alarms
330 private List<ProblemNotificationXml> readTheFaultsOfMwPureEthernetStructurePac(UniversalId interfacePacUuid,
331 List<ProblemNotificationXml> resultList) {
333 final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
334 // final Class<MwPureEthernetStructurePacKey> clazzPacKey =
335 // MwPureEthernetStructurePacKey.class;
336 final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
337 // final Class<StructureCurrentProblemTypeG> clazzProblem =
338 // StructureCurrentProblemTypeG.class;
340 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
341 coreData.getMountpoint(), interfacePacUuid.getValue());
343 InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
344 .builder(clazzPac, new MwPureEthernetStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
346 PureEthernetStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
347 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
348 if (problems == null) {
349 LOG.debug("DBRead Id {} no PureEthernetStructureCurrentProblems", interfacePacUuid);
350 } else if (problems.getCurrentProblemList() == null) {
351 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
353 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
354 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
355 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
356 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
363 * Read problems of specific interfaces
365 * @param uuId Universal index of Interfacepac
366 * @return number of alarms
368 private List<ProblemNotificationXml> readTheFaultsOfMwHybridMwStructurePac(UniversalId interfacePacUuid,
369 List<ProblemNotificationXml> resultList) {
371 final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
372 // final Class<MwHybridMwStructurePacKey> clazzPacKey =
373 // MwHybridMwStructurePacKey.class;
374 final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
375 // final Class<HybridMwStructureCurrentProblemsG> clazzProblem =
376 // HybridMwStructureCurrentProblemsG.class;
378 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
379 coreData.getMountpoint(), interfacePacUuid.getValue());
381 InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
382 .builder(clazzPac, new MwHybridMwStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
384 HybridMwStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
385 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
386 if (problems == null) {
387 LOG.debug("DBRead Id {} no HybridMwStructureCurrentProblems", interfacePacUuid);
388 } else if (problems.getCurrentProblemList() == null) {
389 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
391 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
392 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
393 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
394 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
401 * Read problems of specific interfaces. TODO Goal for future implementation
402 * without usage of explicit new. Key is generated by newInstance() function
403 * here to verify this approach.
405 * @param uuId Universal index of Interfacepac
406 * @return number of alarms
407 * @throws SecurityException
408 * @throws NoSuchMethodException
409 * @throws InvocationTargetException
410 * @throws IllegalArgumentException
411 * @throws IllegalAccessException
412 * @throws InstantiationException
414 private List<ProblemNotificationXml> readTheFaultsOfMwTdmContainerPac(UniversalId interfacePacUuid,
415 List<ProblemNotificationXml> resultList) {
417 final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
418 final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
419 final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
420 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
421 // ContainerCurrentProblemTypeG.class;
423 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
424 coreData.getMountpoint(), interfacePacUuid.getValue());
427 // -- Specific part 1
428 Constructor<MwTdmContainerPacKey> cons = clazzPacKey.getConstructor(UniversalId.class); // Avoid new()
429 InstanceIdentifier<TdmContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
430 .builder(clazzPac, cons.newInstance(interfacePacUuid)).child(clazzProblems).build();
432 // -- Specific part 2
433 TdmContainerCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
434 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
435 if (problems == null) {
436 LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
437 } else if (problems.getCurrentProblemList() == null) {
438 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
440 // -- Specific part 3
441 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
442 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
443 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
444 problem.getSequenceNumber().toString(),
445 InternalDateAndTime.valueOf(problem.getTimeStamp())));
448 } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
449 | IllegalArgumentException | InvocationTargetException e) {
450 LOG.warn("Could not reade instance of MwTdmContainerPacKey: ", e);
455 /*-----------------------------------------------------------------------------
456 * Performance related data
460 * PM MwAirInterfacePac
465 private List<ExtendedAirInterfaceHistoricalPerformanceType1211> readTheHistoricalPerformanceDataOfMwAirInterfacePac(
468 String uuId = lp.getUuid().getValue();
470 List<ExtendedAirInterfaceHistoricalPerformanceType1211> resultList = new ArrayList<>();
471 LOG.debug("DBRead Get {} MWAirInterfacePac: {}", coreData.getMountpoint(), uuId);
473 UniversalId mwAirInterfacePacuuId = new UniversalId(uuId);
474 // Step 2.1: construct data and the relative iid
475 InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier
476 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
477 .child(AirInterfaceConfiguration.class).build();
478 AirInterfaceConfiguration airConfiguration = GenericTransactionUtils.readData(coreData.getDataBroker(),
479 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID);
481 if (airConfiguration == null) {
482 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId);
485 // Step 2.2: construct data and the relative iid
486 InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID = InstanceIdentifier
487 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
488 .child(AirInterfaceHistoricalPerformances.class).build();
490 // Step 2.3: read to the config data store
491 AirInterfaceHistoricalPerformances airHistoricalPerformanceData = GenericTransactionUtils.readData(
492 coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID);
494 if (airHistoricalPerformanceData == null) {
495 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances",
496 mwAirInterfacePacuuId);
498 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.air._interface.historical.performances.g.HistoricalPerformanceDataList
499 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = airHistoricalPerformanceData
500 .getHistoricalPerformanceDataList();
501 LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId,
502 airHistPMList.size());
503 if (airHistPMList != null) {
504 for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistoricalPerformanceData
505 .getHistoricalPerformanceDataList()) {
506 resultList.add(new ExtendedAirInterfaceHistoricalPerformanceType1211(pmRecord, airConfiguration));
511 LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, resultList.size());
515 private List<ContainerHistoricalPerformanceTypeG> readTheHistoricalPerformanceDataOfEthernetContainer(Lp lp) {
517 final String myName = "MWEthernetContainerPac";
518 String uuId = lp.getUuid().getValue();
520 List<ContainerHistoricalPerformanceTypeG> resultList = new ArrayList<>();
521 LOG.debug("DBRead Get {} : {}", coreData.getMountpoint(), myName, uuId);
523 UniversalId ethContainerPacuuId = new UniversalId(uuId);
524 // Step 2.2: construct data and the relative iid
525 InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier
526 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId))
527 .child(EthernetContainerHistoricalPerformances.class).build();
529 // Step 2.3: read to the config data store
530 EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = GenericTransactionUtils
531 .readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID);
533 if (ethContainerHistoricalPerformanceData == null) {
534 LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
537 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.ethernet.container.historical.performances.g.HistoricalPerformanceDataList
538 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = ethContainerHistoricalPerformanceData
539 .getHistoricalPerformanceDataList();
540 LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
541 if (airHistPMList != null) {
542 for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
543 resultList.add(pmRecord);
547 LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, resultList.size());
552 public void onObjectCreationNotification(ObjectCreationNotification notification) {
553 LOG.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName());
555 ObjectCreationNotificationXml notificationXml = new ObjectCreationNotificationXml(coreData.getMountpoint(),
556 notification.getCounter().toString(),
557 InternalDateAndTime.valueOf(notification.getTimeStamp()),
558 notification.getObjectIdRef().getValue());
559 microwaveModelListener.onObjectCreationNotification(notificationXml);
563 public void onObjectDeletionNotification(ObjectDeletionNotification notification) {
564 LOG.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName());
566 ObjectDeletionNotificationXml notificationXml = new ObjectDeletionNotificationXml(coreData.getMountpoint(),
567 notification.getCounter().toString(),
568 InternalDateAndTime.valueOf(notification.getTimeStamp()),
569 notification.getObjectIdRef().getValue()
571 microwaveModelListener.onObjectDeletionNotification(notificationXml);
574 public void onProblemNotification(ProblemNotification notification) {
576 LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
578 ProblemNotificationXml notificationXml = new ProblemNotificationXml(coreData.getMountpoint(), notification.getObjectIdRef().getValue(),
579 notification.getProblem(), InternalSeverity.valueOf(notification.getSeverity()),
580 notification.getCounter().toString(), InternalDateAndTime.valueOf(notification.getTimeStamp()));
582 microwaveModelListener.onProblemNotification(notificationXml);
586 public void onAttributeValueChangedNotification(AttributeValueChangedNotification notification) {
587 LOG.debug("Got event of type :: {}", AttributeValueChangedNotification.class.getSimpleName());
589 AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(coreData.getMountpoint(),
590 String.valueOf(notification.getCounter()), InternalDateAndTime.valueOf(notification.getTimeStamp()),
591 notification.getObjectIdRef().getValue(), notification.getAttributeName(), notification.getNewValue());
593 microwaveModelListener.onAttributeValueChangedNotification(notificationXml);