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.ExtendedAirInterfaceHistoricalPerformanceType1211p;
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.rev181010.AirInterfaceCurrentProblemTypeG;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.AirInterfaceDiversityCurrentProblemTypeG;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.AirInterfaceHistoricalPerformanceTypeG;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ContainerCurrentProblemTypeG;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ContainerHistoricalPerformanceTypeG;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MicrowaveModelListener;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfaceDiversityPac;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfaceDiversityPacKey;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfacePac;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfacePacKey;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwEthernetContainerPac;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwEthernetContainerPacKey;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwHybridMwStructurePac;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwHybridMwStructurePacKey;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwPureEthernetStructurePac;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwPureEthernetStructurePacKey;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwTdmContainerPac;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwTdmContainerPacKey;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.StructureCurrentProblemTypeG;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceConfiguration;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceCurrentProblems;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
72 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
73 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
74 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
75 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.tdm.container.pac.TdmContainerCurrentProblems;
76 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.AttributeValueChangedNotification;
77 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ObjectCreationNotification;
78 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ObjectDeletionNotification;
79 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ProblemNotification;
82 public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, MicrowaveModelListener {
84 private static final Logger LOG = LoggerFactory.getLogger(WrapperMicrowaveModelRev181010.class);
86 public static final QName QNAME = MwAirInterfacePac.QNAME;
89 private ONFCOreNetworkElementCoreData coreData;
91 private OnfMicrowaveModelNotification microwaveModelListener;
93 /*-----------------------------------------------------------------------------
98 public void setCoreData(ONFCOreNetworkElementCoreData coreData) {
99 this.coreData = coreData;
102 public ONFCOreNetworkElementCoreData getCoreData() {
107 public void setOnfMicrowaveModelListener(OnfMicrowaveModelNotification microwaveModelListener) {
108 this.microwaveModelListener = microwaveModelListener;
111 @SuppressWarnings("unchecked")
113 public <T extends NotificationListener> T getNotificationListener() {
117 /*-----------------------------------------------------------------------------
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);
162 public List<? extends OtnHistoryDataG> readTheHistoricalPerformanceData(ONFLayerProtocolName lpName, Lp lp) {
165 return readTheHistoricalPerformanceDataOfMwAirInterfacePac(lp);
167 case EthernetContainer12:
168 return readTheHistoricalPerformanceDataOfEthernetContainer(lp);
170 case EthernetContainer10:
171 case EthernetPhysical:
176 LOG.debug("Do not read HistoricalPM data for {} {}", lpName, lp.getUuid().getValue());
179 return new ArrayList<>();
183 public Class<?> getClassForLtpExtension(QName qName) {
185 if (qName.equals(MwAirInterfacePac.QNAME)) {
186 res = MwAirInterfacePac.class;
187 } else if (qName.equals(MwAirInterfaceDiversityPac.QNAME)) {
188 res = MwAirInterfaceDiversityPac.class;
189 } else if (qName.equals(MwPureEthernetStructurePac.QNAME)) {
190 res = MwPureEthernetStructurePac.class;
191 } else if (qName.equals(MwHybridMwStructurePac.QNAME)) {
192 res = MwHybridMwStructurePac.class;
193 } else if (qName.equals(MwEthernetContainerPac.QNAME)) {
194 res = MwEthernetContainerPac.class;
195 } else if (qName.equals(MwTdmContainerPac.QNAME)) {
196 res = MwTdmContainerPac.class;
198 LOG.info("Found QName {} mapped to {}", String.valueOf(qName), String.valueOf(res));
202 /*-----------------------------------------------------------------------------
203 * Reading problems for specific interface pacs
207 * Read problems of specific interfaces
209 * @param uuId Universal Id String of the interface
210 * @return number of alarms
212 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfacePac(UniversalId interfacePacUuid,
213 List<ProblemNotificationXml> resultList) {
215 final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class;
216 // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class;
217 // final Class<AirInterfaceCurrentProblems> clazzProblems =
218 // AirInterfaceCurrentProblems.class;
219 // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem =
220 // AirInterfaceCurrentProblemTypeG.class;
222 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
223 coreData.getMountpoint(), interfacePacUuid.getValue());
225 // Step 2.2: construct data and the relative iid
226 InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID = InstanceIdentifier
227 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(interfacePacUuid))
228 .child(AirInterfaceCurrentProblems.class).build();
230 // Step 2.3: read to the config data store
231 AirInterfaceCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
232 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID);
234 if (problems == null) {
235 LOG.debug("DBRead Id {} no AirInterfaceCurrentProblems", interfacePacUuid);
236 } else if (problems.getCurrentProblemList() == null) {
237 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
239 for (AirInterfaceCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
240 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
241 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
242 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
249 * Read problems of specific interfaces
251 * @param uuId Universal index of Interfacepac
252 * @return number of alarms
254 private List<ProblemNotificationXml> readTheFaultsOfMwEthernetContainerPac(UniversalId interfacePacUuid,
255 List<ProblemNotificationXml> resultList) {
257 final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class;
258 // final Class<MwEthernetContainerPacKey> clazzPacKey =
259 // MwEthernetContainerPacKey.class;
260 // final Class<EthernetContainerCurrentProblems> clazzProblems =
261 // EthernetContainerCurrentProblems.class;
262 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
263 // ContainerCurrentProblemTypeG.class;
265 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
266 coreData.getMountpoint(), interfacePacUuid.getValue());
268 InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
269 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(interfacePacUuid))
270 .child(EthernetContainerCurrentProblems.class).build();
272 EthernetContainerCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
273 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
274 if (problems == null) {
275 LOG.debug("DBRead Id {} no EthernetContainerCurrentProblems", interfacePacUuid);
276 } else if (problems.getCurrentProblemList() == null) {
277 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
279 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
280 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
281 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
282 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
289 * Read problems of specific interfaces
291 * @param uuId Universal index of Interfacepac
292 * @return number of alarms
294 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfaceDiversityPac(UniversalId interfacePacUuid,
295 List<ProblemNotificationXml> resultList) {
297 final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
298 // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey =
299 // MwAirInterfaceDiversityPacKey.class;
300 final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
301 // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem =
302 // AirInterfaceDiversityCurrentProblemTypeG.class;
304 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
305 coreData.getMountpoint(), interfacePacUuid.getValue());
307 InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
308 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(interfacePacUuid)).child(clazzProblems).build();
310 AirInterfaceDiversityCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
311 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
312 if (problems == null) {
313 LOG.debug("DBRead Id {} no AirInterfaceDiversityCurrentProblems", interfacePacUuid);
314 } else if (problems.getCurrentProblemList() == null) {
315 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
317 for (AirInterfaceDiversityCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
318 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
319 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
320 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
327 * Read problems of specific interfaces
329 * @param uuId Universal index of Interfacepac
330 * @return number of alarms
332 private List<ProblemNotificationXml> readTheFaultsOfMwPureEthernetStructurePac(UniversalId interfacePacUuid,
333 List<ProblemNotificationXml> resultList) {
335 final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
336 // final Class<MwPureEthernetStructurePacKey> clazzPacKey =
337 // MwPureEthernetStructurePacKey.class;
338 final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
339 // final Class<StructureCurrentProblemTypeG> clazzProblem =
340 // StructureCurrentProblemTypeG.class;
342 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
343 coreData.getMountpoint(), interfacePacUuid.getValue());
345 InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
346 .builder(clazzPac, new MwPureEthernetStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
348 PureEthernetStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
349 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
350 if (problems == null) {
351 LOG.debug("DBRead Id {} no PureEthernetStructureCurrentProblems", interfacePacUuid);
352 } else if (problems.getCurrentProblemList() == null) {
353 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
355 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
356 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
357 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
358 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
365 * Read problems of specific interfaces
367 * @param uuId Universal index of Interfacepac
368 * @return number of alarms
370 private List<ProblemNotificationXml> readTheFaultsOfMwHybridMwStructurePac(UniversalId interfacePacUuid,
371 List<ProblemNotificationXml> resultList) {
373 final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
374 // final Class<MwHybridMwStructurePacKey> clazzPacKey =
375 // MwHybridMwStructurePacKey.class;
376 final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
377 // final Class<HybridMwStructureCurrentProblemsG> clazzProblem =
378 // HybridMwStructureCurrentProblemsG.class;
380 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
381 coreData.getMountpoint(), interfacePacUuid.getValue());
383 InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
384 .builder(clazzPac, new MwHybridMwStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
386 HybridMwStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
387 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
388 if (problems == null) {
389 LOG.debug("DBRead Id {} no HybridMwStructureCurrentProblems", interfacePacUuid);
390 } else if (problems.getCurrentProblemList() == null) {
391 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
393 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
394 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
395 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
396 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
403 * Read problems of specific interfaces. TODO Goal for future implementation
404 * without usage of explicit new. Key is generated by newInstance() function
405 * here to verify this approach.
407 * @param uuId Universal index of Interfacepac
408 * @return number of alarms
409 * @throws SecurityException
410 * @throws NoSuchMethodException
411 * @throws InvocationTargetException
412 * @throws IllegalArgumentException
413 * @throws IllegalAccessException
414 * @throws InstantiationException
416 private List<ProblemNotificationXml> readTheFaultsOfMwTdmContainerPac(UniversalId interfacePacUuid,
417 List<ProblemNotificationXml> resultList) {
419 final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
420 final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
421 final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
422 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
423 // ContainerCurrentProblemTypeG.class;
425 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
426 coreData.getMountpoint(), interfacePacUuid.getValue());
429 // -- Specific part 1
430 Constructor<MwTdmContainerPacKey> cons = clazzPacKey.getConstructor(UniversalId.class); // Avoid new()
431 InstanceIdentifier<TdmContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
432 .builder(clazzPac, cons.newInstance(interfacePacUuid)).child(clazzProblems).build();
434 // -- Specific part 2
435 TdmContainerCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
436 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
437 if (problems == null) {
438 LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
439 } else if (problems.getCurrentProblemList() == null) {
440 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
442 // -- Specific part 3
443 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
444 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
445 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
446 problem.getSequenceNumber().toString(),
447 InternalDateAndTime.valueOf(problem.getTimeStamp())));
450 } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
451 | IllegalArgumentException | InvocationTargetException e) {
452 LOG.warn("Could not reade instance of MwTdmContainerPacKey: ", e);
457 /*-----------------------------------------------------------------------------
458 * Performance related data
462 * PM MwAirInterfacePac
467 private List<ExtendedAirInterfaceHistoricalPerformanceType1211p> readTheHistoricalPerformanceDataOfMwAirInterfacePac(
470 String uuId = lp.getUuid().getValue();
472 List<ExtendedAirInterfaceHistoricalPerformanceType1211p> resultList = new ArrayList<>();
473 LOG.debug("DBRead Get {} MWAirInterfacePac: {}", coreData.getMountpoint(), uuId);
475 UniversalId mwAirInterfacePacuuId = new UniversalId(uuId);
476 // Step 2.1: construct data and the relative iid
477 InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier
478 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
479 .child(AirInterfaceConfiguration.class).build();
480 AirInterfaceConfiguration airConfiguration = GenericTransactionUtils.readData(coreData.getDataBroker(),
481 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID);
483 if (airConfiguration == null) {
484 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId);
487 // Step 2.2: construct data and the relative iid
488 InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID = InstanceIdentifier
489 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
490 .child(AirInterfaceHistoricalPerformances.class).build();
492 // Step 2.3: read to the config data store
493 AirInterfaceHistoricalPerformances airHistoricalPerformanceData = GenericTransactionUtils.readData(
494 coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID);
496 if (airHistoricalPerformanceData == null) {
497 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances",
498 mwAirInterfacePacuuId);
500 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.air._interface.historical.performances.g.HistoricalPerformanceDataList
501 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = airHistoricalPerformanceData
502 .getHistoricalPerformanceDataList();
503 LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId,
504 airHistPMList.size());
505 if (airHistPMList != null) {
506 for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistoricalPerformanceData
507 .getHistoricalPerformanceDataList()) {
508 resultList.add(new ExtendedAirInterfaceHistoricalPerformanceType1211p(pmRecord, airConfiguration));
513 LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, resultList.size());
517 private List<ContainerHistoricalPerformanceTypeG> readTheHistoricalPerformanceDataOfEthernetContainer(Lp lp) {
519 final String myName = "MWEthernetContainerPac";
520 String uuId = lp.getUuid().getValue();
522 List<ContainerHistoricalPerformanceTypeG> resultList = new ArrayList<>();
523 LOG.debug("DBRead Get {} : {}", coreData.getMountpoint(), myName, uuId);
525 UniversalId ethContainerPacuuId = new UniversalId(uuId);
526 // Step 2.2: construct data and the relative iid
527 InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier
528 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId))
529 .child(EthernetContainerHistoricalPerformances.class).build();
531 // Step 2.3: read to the config data store
532 EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = GenericTransactionUtils
533 .readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID);
535 if (ethContainerHistoricalPerformanceData == null) {
536 LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
539 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.ethernet.container.historical.performances.g.HistoricalPerformanceDataList
540 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = ethContainerHistoricalPerformanceData
541 .getHistoricalPerformanceDataList();
542 LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
543 if (airHistPMList != null) {
544 for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
545 resultList.add(pmRecord);
549 LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, resultList.size());
554 public void onObjectCreationNotification(ObjectCreationNotification notification) {
555 LOG.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName());
557 ObjectCreationNotificationXml notificationXml = new ObjectCreationNotificationXml(coreData.getMountpoint(),
558 notification.getCounter().toString(),
559 InternalDateAndTime.valueOf(notification.getTimeStamp()),
560 notification.getObjectIdRef().getValue());
561 microwaveModelListener.onObjectCreationNotification(notificationXml);
565 public void onObjectDeletionNotification(ObjectDeletionNotification notification) {
566 LOG.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName());
568 ObjectDeletionNotificationXml notificationXml = new ObjectDeletionNotificationXml(coreData.getMountpoint(),
569 notification.getCounter().toString(),
570 InternalDateAndTime.valueOf(notification.getTimeStamp()),
571 notification.getObjectIdRef().getValue()
573 microwaveModelListener.onObjectDeletionNotification(notificationXml);
577 public void onProblemNotification(ProblemNotification notification) {
579 LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
581 ProblemNotificationXml notificationXml = new ProblemNotificationXml(coreData.getMountpoint(), notification.getObjectIdRef().getValue(),
582 notification.getProblem(), InternalSeverity.valueOf(notification.getSeverity()),
583 notification.getCounter().toString(), InternalDateAndTime.valueOf(notification.getTimeStamp()));
585 microwaveModelListener.onProblemNotification(notificationXml);
589 public void onAttributeValueChangedNotification(AttributeValueChangedNotification notification) {
590 LOG.debug("Got event of type :: {}", AttributeValueChangedNotification.class.getSimpleName());
592 AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(coreData.getMountpoint(),
593 String.valueOf(notification.getCounter()), InternalDateAndTime.valueOf(notification.getTimeStamp()),
594 notification.getObjectIdRef().getValue(), notification.getAttributeName(), notification.getNewValue());
596 microwaveModelListener.onAttributeValueChangedNotification(notificationXml);