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.container.ExtendedAirInterfaceHistoricalPerformanceType1211;
37 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.container.ONFLayerProtocolName;
38 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.util.GenericTransactionUtils;
39 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.AttributeValueChangedNotificationXml;
40 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectCreationNotificationXml;
41 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectDeletionNotificationXml;
42 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ProblemNotificationXml;
43 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
45 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
46 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.OtnHistoryDataG;
47 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
48 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AirInterfaceCurrentProblemTypeG;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AirInterfaceDiversityCurrentProblemTypeG;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AirInterfaceHistoricalPerformanceTypeG;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ContainerCurrentProblemTypeG;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ContainerHistoricalPerformanceTypeG;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MicrowaveModelListener;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfaceDiversityPac;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfaceDiversityPacKey;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfacePac;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfacePacKey;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwEthernetContainerPac;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwEthernetContainerPacKey;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwHybridMwStructurePac;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwHybridMwStructurePacKey;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwPureEthernetStructurePac;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwPureEthernetStructurePacKey;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwTdmContainerPac;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwTdmContainerPacKey;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.StructureCurrentProblemTypeG;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceConfiguration;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceCurrentProblems;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
72 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
73 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
74 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
75 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.tdm.container.pac.TdmContainerCurrentProblems;
76 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AttributeValueChangedNotification;
77 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ObjectCreationNotification;
78 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ObjectDeletionNotification;
79 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ProblemNotification;
82 public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, MicrowaveModelListener {
84 private static final Logger LOG = LoggerFactory.getLogger(WrapperMicrowaveModelRev180907.class);
86 public static final QName QNAME = MwAirInterfacePac.QNAME;
89 private ONFCoreNetworkElementCoreData coreData;
91 private OnfMicrowaveModelNotification microwaveModelListener;
94 /*-----------------------------------------------------------------------------
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 /*-----------------------------------------------------------------------------
123 public void readTheFaultsOfMicrowaveModel(ONFLayerProtocolName lpName, Class<?> lpClass, UniversalId uuid,
124 List<ProblemNotificationXml> resultList) {
128 readTheFaultsOfMwAirInterfacePac(uuid, resultList);
131 case EthernetContainer12:
132 readTheFaultsOfMwEthernetContainerPac(uuid, resultList);
136 readTheFaultsOfMwTdmContainerPac(uuid, resultList);
140 if (lpClass == MwHybridMwStructurePac.class) {
141 readTheFaultsOfMwHybridMwStructurePac(uuid, resultList);
143 } else if (lpClass == MwAirInterfaceDiversityPac.class) {
144 readTheFaultsOfMwAirInterfaceDiversityPac(uuid, resultList);
146 } else if (lpClass == MwPureEthernetStructurePac.class) {
147 readTheFaultsOfMwPureEthernetStructurePac(uuid, resultList);
150 LOG.warn("Unassigned lp model {} class {}", lpName, lpClass);
154 // No alarms supported
156 case EthernetContainer10:
158 LOG.warn("Unassigned or not expected lp in model {}", lpName);
163 public List<? extends OtnHistoryDataG> readTheHistoricalPerformanceData(ONFLayerProtocolName lpName, Lp lp) {
166 return readTheHistoricalPerformanceDataOfMwAirInterfacePac(lp);
168 case EthernetContainer12:
169 return readTheHistoricalPerformanceDataOfEthernetContainer(lp);
171 case EthernetContainer10:
172 case EthernetPhysical:
177 LOG.debug("Do not read HistoricalPM data for {} {}", lpName, lp.getUuid().getValue());
180 return new ArrayList<>();
184 public Class<?> getClassForLtpExtension(QName qName) {
186 if (qName.equals(MwAirInterfacePac.QNAME)) {
187 res = MwAirInterfacePac.class;
188 } else if (qName.equals(MwAirInterfaceDiversityPac.QNAME)) {
189 res = MwAirInterfaceDiversityPac.class;
190 } else if (qName.equals(MwPureEthernetStructurePac.QNAME)) {
191 res = MwPureEthernetStructurePac.class;
192 } else if (qName.equals(MwHybridMwStructurePac.QNAME)) {
193 res = MwHybridMwStructurePac.class;
194 } else if (qName.equals(MwEthernetContainerPac.QNAME)) {
195 res = MwEthernetContainerPac.class;
196 } else if (qName.equals(MwTdmContainerPac.QNAME)) {
197 res = MwTdmContainerPac.class;
199 LOG.info("Found QName {} mapped to {}", String.valueOf(qName), String.valueOf(res));
203 /*-----------------------------------------------------------------------------
204 * Reading problems for specific interface pacs
208 * Read problems of specific interfaces
210 * @param uuId Universal Id String of the interface
211 * @return number of alarms
213 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfacePac(UniversalId interfacePacUuid,
214 List<ProblemNotificationXml> resultList) {
216 final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class;
217 // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class;
218 // final Class<AirInterfaceCurrentProblems> clazzProblems =
219 // AirInterfaceCurrentProblems.class;
220 // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem =
221 // AirInterfaceCurrentProblemTypeG.class;
223 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
224 coreData.getMountpoint(), interfacePacUuid.getValue());
226 // Step 2.2: construct data and the relative iid
227 InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID = InstanceIdentifier
228 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(interfacePacUuid))
229 .child(AirInterfaceCurrentProblems.class).build();
231 // Step 2.3: read to the config data store
232 AirInterfaceCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
233 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID);
235 if (problems == null) {
236 LOG.debug("DBRead Id {} no AirInterfaceCurrentProblems", interfacePacUuid);
237 } else if (problems.getCurrentProblemList() == null) {
238 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
240 for (AirInterfaceCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
241 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
242 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
243 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
250 * Read problems of specific interfaces
252 * @param uuId Universal index of Interfacepac
253 * @return number of alarms
255 private List<ProblemNotificationXml> readTheFaultsOfMwEthernetContainerPac(UniversalId interfacePacUuid,
256 List<ProblemNotificationXml> resultList) {
258 final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class;
259 // final Class<MwEthernetContainerPacKey> clazzPacKey =
260 // MwEthernetContainerPacKey.class;
261 // final Class<EthernetContainerCurrentProblems> clazzProblems =
262 // EthernetContainerCurrentProblems.class;
263 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
264 // ContainerCurrentProblemTypeG.class;
266 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
267 coreData.getMountpoint(), interfacePacUuid.getValue());
269 InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
270 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(interfacePacUuid))
271 .child(EthernetContainerCurrentProblems.class).build();
273 EthernetContainerCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
274 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
275 if (problems == null) {
276 LOG.debug("DBRead Id {} no EthernetContainerCurrentProblems", interfacePacUuid);
277 } else if (problems.getCurrentProblemList() == null) {
278 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
280 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
281 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
282 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
283 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
290 * Read problems of specific interfaces
292 * @param uuId Universal index of Interfacepac
293 * @return number of alarms
295 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfaceDiversityPac(UniversalId interfacePacUuid,
296 List<ProblemNotificationXml> resultList) {
298 final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
299 // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey =
300 // MwAirInterfaceDiversityPacKey.class;
301 final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
302 // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem =
303 // AirInterfaceDiversityCurrentProblemTypeG.class;
305 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
306 coreData.getMountpoint(), interfacePacUuid.getValue());
308 InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
309 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(interfacePacUuid)).child(clazzProblems).build();
311 AirInterfaceDiversityCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
312 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
313 if (problems == null) {
314 LOG.debug("DBRead Id {} no AirInterfaceDiversityCurrentProblems", interfacePacUuid);
315 } else if (problems.getCurrentProblemList() == null) {
316 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
318 for (AirInterfaceDiversityCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
319 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
320 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
321 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
328 * Read problems of specific interfaces
330 * @param uuId Universal index of Interfacepac
331 * @return number of alarms
333 private List<ProblemNotificationXml> readTheFaultsOfMwPureEthernetStructurePac(UniversalId interfacePacUuid,
334 List<ProblemNotificationXml> resultList) {
336 final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
337 // final Class<MwPureEthernetStructurePacKey> clazzPacKey =
338 // MwPureEthernetStructurePacKey.class;
339 final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
340 // final Class<StructureCurrentProblemTypeG> clazzProblem =
341 // StructureCurrentProblemTypeG.class;
343 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
344 coreData.getMountpoint(), interfacePacUuid.getValue());
346 InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
347 .builder(clazzPac, new MwPureEthernetStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
349 PureEthernetStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
350 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
351 if (problems == null) {
352 LOG.debug("DBRead Id {} no PureEthernetStructureCurrentProblems", interfacePacUuid);
353 } else if (problems.getCurrentProblemList() == null) {
354 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
356 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
357 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
358 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
359 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
366 * Read problems of specific interfaces
368 * @param uuId Universal index of Interfacepac
369 * @return number of alarms
371 private List<ProblemNotificationXml> readTheFaultsOfMwHybridMwStructurePac(UniversalId interfacePacUuid,
372 List<ProblemNotificationXml> resultList) {
374 final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
375 // final Class<MwHybridMwStructurePacKey> clazzPacKey =
376 // MwHybridMwStructurePacKey.class;
377 final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
378 // final Class<HybridMwStructureCurrentProblemsG> clazzProblem =
379 // HybridMwStructureCurrentProblemsG.class;
381 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
382 coreData.getMountpoint(), interfacePacUuid.getValue());
384 InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
385 .builder(clazzPac, new MwHybridMwStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
387 HybridMwStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
388 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
389 if (problems == null) {
390 LOG.debug("DBRead Id {} no HybridMwStructureCurrentProblems", interfacePacUuid);
391 } else if (problems.getCurrentProblemList() == null) {
392 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
394 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
395 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
396 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
397 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
404 * Read problems of specific interfaces. TODO Goal for future implementation
405 * without usage of explicit new. Key is generated by newInstance() function
406 * here to verify this approach.
408 * @param uuId Universal index of Interfacepac
409 * @return number of alarms
410 * @throws SecurityException
411 * @throws NoSuchMethodException
412 * @throws InvocationTargetException
413 * @throws IllegalArgumentException
414 * @throws IllegalAccessException
415 * @throws InstantiationException
417 private List<ProblemNotificationXml> readTheFaultsOfMwTdmContainerPac(UniversalId interfacePacUuid,
418 List<ProblemNotificationXml> resultList) {
420 final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
421 final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
422 final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
423 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
424 // ContainerCurrentProblemTypeG.class;
426 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
427 coreData.getMountpoint(), 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(coreData.getDataBroker(),
437 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
438 if (problems == null) {
439 LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
440 } else if (problems.getCurrentProblemList() == null) {
441 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
443 // -- Specific part 3
444 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
445 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
446 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
447 problem.getSequenceNumber().toString(),
448 InternalDateAndTime.valueOf(problem.getTimeStamp())));
451 } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
452 | IllegalArgumentException | InvocationTargetException e) {
453 LOG.warn("Could not reade instance of MwTdmContainerPacKey: ", e);
458 /*-----------------------------------------------------------------------------
459 * Performance related data
463 * PM MwAirInterfacePac
468 private List<ExtendedAirInterfaceHistoricalPerformanceType1211> readTheHistoricalPerformanceDataOfMwAirInterfacePac(
471 String uuId = lp.getUuid().getValue();
473 List<ExtendedAirInterfaceHistoricalPerformanceType1211> resultList = new ArrayList<>();
474 LOG.debug("DBRead Get {} MWAirInterfacePac: {}", coreData.getMountpoint(), uuId);
476 UniversalId mwAirInterfacePacuuId = new UniversalId(uuId);
477 // Step 2.1: construct data and the relative iid
478 InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier
479 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
480 .child(AirInterfaceConfiguration.class).build();
481 AirInterfaceConfiguration airConfiguration = GenericTransactionUtils.readData(coreData.getDataBroker(),
482 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID);
484 if (airConfiguration == null) {
485 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId);
488 // Step 2.2: construct data and the relative iid
489 InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID = InstanceIdentifier
490 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
491 .child(AirInterfaceHistoricalPerformances.class).build();
493 // Step 2.3: read to the config data store
494 AirInterfaceHistoricalPerformances airHistoricalPerformanceData = GenericTransactionUtils.readData(
495 coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID);
497 if (airHistoricalPerformanceData == null) {
498 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances",
499 mwAirInterfacePacuuId);
501 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.air._interface.historical.performances.g.HistoricalPerformanceDataList
502 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = airHistoricalPerformanceData
503 .getHistoricalPerformanceDataList();
504 LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId,
505 airHistPMList.size());
506 if (airHistPMList != null) {
507 for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistoricalPerformanceData
508 .getHistoricalPerformanceDataList()) {
509 resultList.add(new ExtendedAirInterfaceHistoricalPerformanceType1211(pmRecord, airConfiguration));
514 LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, resultList.size());
518 private List<ContainerHistoricalPerformanceTypeG> readTheHistoricalPerformanceDataOfEthernetContainer(Lp lp) {
520 final String myName = "MWEthernetContainerPac";
521 String uuId = lp.getUuid().getValue();
523 List<ContainerHistoricalPerformanceTypeG> resultList = new ArrayList<>();
524 LOG.debug("DBRead Get {} : {}", coreData.getMountpoint(), myName, uuId);
526 UniversalId ethContainerPacuuId = new UniversalId(uuId);
527 // Step 2.2: construct data and the relative iid
528 InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier
529 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId))
530 .child(EthernetContainerHistoricalPerformances.class).build();
532 // Step 2.3: read to the config data store
533 EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = GenericTransactionUtils
534 .readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID);
536 if (ethContainerHistoricalPerformanceData == null) {
537 LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
540 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.ethernet.container.historical.performances.g.HistoricalPerformanceDataList
541 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = ethContainerHistoricalPerformanceData
542 .getHistoricalPerformanceDataList();
543 LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
544 if (airHistPMList != null) {
545 for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
546 resultList.add(pmRecord);
550 LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, resultList.size());
555 public void onObjectCreationNotification(ObjectCreationNotification notification) {
556 LOG.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName());
558 ObjectCreationNotificationXml notificationXml = new ObjectCreationNotificationXml(coreData.getMountpoint(),
559 notification.getCounter().toString(),
560 InternalDateAndTime.valueOf(notification.getTimeStamp()),
561 notification.getObjectIdRef().getValue());
562 microwaveModelListener.onObjectCreationNotification(notificationXml);
566 public void onObjectDeletionNotification(ObjectDeletionNotification notification) {
567 LOG.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName());
569 ObjectDeletionNotificationXml notificationXml = new ObjectDeletionNotificationXml(coreData.getMountpoint(),
570 notification.getCounter().toString(),
571 InternalDateAndTime.valueOf(notification.getTimeStamp()),
572 notification.getObjectIdRef().getValue()
574 microwaveModelListener.onObjectDeletionNotification(notificationXml);
578 public void onProblemNotification(ProblemNotification notification) {
580 LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
582 ProblemNotificationXml notificationXml = new ProblemNotificationXml(coreData.getMountpoint(), notification.getObjectIdRef().getValue(),
583 notification.getProblem(), InternalSeverity.valueOf(notification.getSeverity()),
584 notification.getCounter().toString(), InternalDateAndTime.valueOf(notification.getTimeStamp()));
586 microwaveModelListener.onProblemNotification(notificationXml);
590 public void onAttributeValueChangedNotification(AttributeValueChangedNotification notification) {
591 LOG.debug("Got event of type :: {}", AttributeValueChangedNotification.class.getSimpleName());
593 AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(coreData.getMountpoint(),
594 String.valueOf(notification.getCounter()), InternalDateAndTime.valueOf(notification.getTimeStamp()),
595 notification.getObjectIdRef().getValue(), notification.getAttributeName(), notification.getNewValue());
597 microwaveModelListener.onAttributeValueChangedNotification(notificationXml);