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.onfcore.wrapperc;
22 import java.lang.reflect.Constructor;
23 import java.lang.reflect.InvocationTargetException;
24 import java.util.ArrayList;
25 import java.util.List;
27 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.NetworkElementCoreData;
28 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.onfcore.container.ExtendedAirInterfaceHistoricalPerformanceType1211p;
29 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.onfcore.container.ONFLayerProtocolName;
30 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.util.InternalDateAndTime;
31 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.util.InternalSeverity;
32 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.AttributeValueChangedNotificationXml;
33 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectCreationNotificationXml;
34 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectDeletionNotificationXml;
35 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ProblemNotificationXml;
36 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.INetconfAcessor;
37 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
38 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
39 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
40 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
41 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.OtnHistoryDataG;
42 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.AirInterfaceCurrentProblemTypeG;
43 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.AirInterfaceDiversityCurrentProblemTypeG;
44 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.AirInterfaceHistoricalPerformanceTypeG;
45 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.AttributeValueChangedNotification;
46 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ContainerCurrentProblemTypeG;
47 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ContainerHistoricalPerformanceTypeG;
48 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MicrowaveModelListener;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfaceDiversityPac;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfaceDiversityPacKey;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfacePac;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfacePacKey;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwEthernetContainerPac;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwEthernetContainerPacKey;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwHybridMwStructurePac;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwHybridMwStructurePacKey;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwPureEthernetStructurePac;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwPureEthernetStructurePacKey;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwTdmContainerPac;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwTdmContainerPacKey;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ObjectCreationNotification;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ObjectDeletionNotification;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ProblemNotification;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.StructureCurrentProblemTypeG;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceConfiguration;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceCurrentProblems;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
72 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
73 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.tdm.container.pac.TdmContainerCurrentProblems;
74 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
75 import org.opendaylight.yangtools.yang.binding.NotificationListener;
76 import org.opendaylight.yangtools.yang.common.QName;
77 import org.slf4j.Logger;
78 import org.slf4j.LoggerFactory;
81 public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, MicrowaveModelListener {
83 private static final Logger LOG = LoggerFactory.getLogger(WrapperMicrowaveModelRev181010.class);
85 public static final QName QNAME = MwAirInterfacePac.QNAME;
88 private NetworkElementCoreData coreData;
90 private OnfMicrowaveModelNotification microwaveModelListener;
91 private final TransactionUtils genericTransactionUtils;
93 /*-----------------------------------------------------------------------------
100 public WrapperMicrowaveModelRev181010(INetconfAcessor acessor) {
101 genericTransactionUtils = acessor.getTransactionUtils();
105 public void setCoreData(NetworkElementCoreData coreData) {
106 this.coreData = coreData;
109 public NetworkElementCoreData getCoreData() {
114 public void setOnfMicrowaveModelListener(OnfMicrowaveModelNotification microwaveModelListener) {
115 this.microwaveModelListener = microwaveModelListener;
118 @SuppressWarnings("unchecked")
120 public <T extends NotificationListener> T getNotificationListener() {
124 /*-----------------------------------------------------------------------------
129 public void readTheFaultsOfMicrowaveModel(ONFLayerProtocolName lpName, Class<?> lpClass, UniversalId uuid,
130 List<ProblemNotificationXml> resultList) {
134 readTheFaultsOfMwAirInterfacePac(uuid, resultList);
137 case EthernetContainer12:
138 readTheFaultsOfMwEthernetContainerPac(uuid, resultList);
142 readTheFaultsOfMwTdmContainerPac(uuid, resultList);
146 if (lpClass == MwHybridMwStructurePac.class) {
147 readTheFaultsOfMwHybridMwStructurePac(uuid, resultList);
149 } else if (lpClass == MwAirInterfaceDiversityPac.class) {
150 readTheFaultsOfMwAirInterfaceDiversityPac(uuid, resultList);
152 } else if (lpClass == MwPureEthernetStructurePac.class) {
153 readTheFaultsOfMwPureEthernetStructurePac(uuid, resultList);
156 LOG.warn("Unassigned lp model {} class {}", lpName, lpClass);
160 // No alarms supported
162 case EthernetContainer10:
164 LOG.warn("Unassigned or not expected lp in model {}", lpName);
169 public List<? extends OtnHistoryDataG> readTheHistoricalPerformanceData(ONFLayerProtocolName lpName, Lp lp) {
172 return readTheHistoricalPerformanceDataOfMwAirInterfacePac(lp);
174 case EthernetContainer12:
175 return readTheHistoricalPerformanceDataOfEthernetContainer(lp);
177 case EthernetContainer10:
178 case EthernetPhysical:
183 LOG.debug("Do not read HistoricalPM data for {} {}", lpName, lp.getUuid().getValue());
186 return new ArrayList<>();
190 public Class<?> getClassForLtpExtension(QName qName) {
192 if (qName.equals(MwAirInterfacePac.QNAME)) {
193 res = MwAirInterfacePac.class;
194 } else if (qName.equals(MwAirInterfaceDiversityPac.QNAME)) {
195 res = MwAirInterfaceDiversityPac.class;
196 } else if (qName.equals(MwPureEthernetStructurePac.QNAME)) {
197 res = MwPureEthernetStructurePac.class;
198 } else if (qName.equals(MwHybridMwStructurePac.QNAME)) {
199 res = MwHybridMwStructurePac.class;
200 } else if (qName.equals(MwEthernetContainerPac.QNAME)) {
201 res = MwEthernetContainerPac.class;
202 } else if (qName.equals(MwTdmContainerPac.QNAME)) {
203 res = MwTdmContainerPac.class;
205 LOG.info("Found QName {} mapped to {}", String.valueOf(qName), String.valueOf(res));
209 /*-----------------------------------------------------------------------------
210 * Reading problems for specific interface pacs
214 * Read problems of specific interfaces
216 * @param uuId Universal Id String of the interface
217 * @return number of alarms
219 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfacePac(UniversalId interfacePacUuid,
220 List<ProblemNotificationXml> resultList) {
222 final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class;
223 // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class;
224 // final Class<AirInterfaceCurrentProblems> clazzProblems =
225 // AirInterfaceCurrentProblems.class;
226 // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem =
227 // AirInterfaceCurrentProblemTypeG.class;
229 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
230 coreData.getMountpoint(), interfacePacUuid.getValue());
232 // Step 2.2: construct data and the relative iid
233 InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID = InstanceIdentifier
234 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(interfacePacUuid))
235 .child(AirInterfaceCurrentProblems.class).build();
237 // Step 2.3: read to the config data store
238 AirInterfaceCurrentProblems problems = genericTransactionUtils.readData(coreData.getDataBroker(),
239 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID);
241 if (problems == null) {
242 LOG.debug("DBRead Id {} no AirInterfaceCurrentProblems", interfacePacUuid);
243 } else if (problems.getCurrentProblemList() == null) {
244 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
246 for (AirInterfaceCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
247 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
248 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
249 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
256 * Read problems of specific interfaces
258 * @param uuId Universal index of Interfacepac
259 * @return number of alarms
261 private List<ProblemNotificationXml> readTheFaultsOfMwEthernetContainerPac(UniversalId interfacePacUuid,
262 List<ProblemNotificationXml> resultList) {
264 final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class;
265 // final Class<MwEthernetContainerPacKey> clazzPacKey =
266 // MwEthernetContainerPacKey.class;
267 // final Class<EthernetContainerCurrentProblems> clazzProblems =
268 // EthernetContainerCurrentProblems.class;
269 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
270 // ContainerCurrentProblemTypeG.class;
272 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
273 coreData.getMountpoint(), interfacePacUuid.getValue());
275 InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
276 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(interfacePacUuid))
277 .child(EthernetContainerCurrentProblems.class).build();
279 EthernetContainerCurrentProblems problems = genericTransactionUtils.readData(coreData.getDataBroker(),
280 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
281 if (problems == null) {
282 LOG.debug("DBRead Id {} no EthernetContainerCurrentProblems", interfacePacUuid);
283 } else if (problems.getCurrentProblemList() == null) {
284 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
286 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
287 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
288 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
289 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
296 * Read problems of specific interfaces
298 * @param uuId Universal index of Interfacepac
299 * @return number of alarms
301 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfaceDiversityPac(UniversalId interfacePacUuid,
302 List<ProblemNotificationXml> resultList) {
304 final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
305 // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey =
306 // MwAirInterfaceDiversityPacKey.class;
307 final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
308 // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem =
309 // AirInterfaceDiversityCurrentProblemTypeG.class;
311 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
312 coreData.getMountpoint(), interfacePacUuid.getValue());
314 InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
315 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(interfacePacUuid)).child(clazzProblems).build();
317 AirInterfaceDiversityCurrentProblems problems = genericTransactionUtils.readData(coreData.getDataBroker(),
318 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
319 if (problems == null) {
320 LOG.debug("DBRead Id {} no AirInterfaceDiversityCurrentProblems", interfacePacUuid);
321 } else if (problems.getCurrentProblemList() == null) {
322 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
324 for (AirInterfaceDiversityCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
325 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
326 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
327 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
334 * Read problems of specific interfaces
336 * @param uuId Universal index of Interfacepac
337 * @return number of alarms
339 private List<ProblemNotificationXml> readTheFaultsOfMwPureEthernetStructurePac(UniversalId interfacePacUuid,
340 List<ProblemNotificationXml> resultList) {
342 final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
343 // final Class<MwPureEthernetStructurePacKey> clazzPacKey =
344 // MwPureEthernetStructurePacKey.class;
345 final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
346 // final Class<StructureCurrentProblemTypeG> clazzProblem =
347 // StructureCurrentProblemTypeG.class;
349 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
350 coreData.getMountpoint(), interfacePacUuid.getValue());
352 InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
353 .builder(clazzPac, new MwPureEthernetStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
355 PureEthernetStructureCurrentProblems problems = genericTransactionUtils.readData(coreData.getDataBroker(),
356 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
357 if (problems == null) {
358 LOG.debug("DBRead Id {} no PureEthernetStructureCurrentProblems", interfacePacUuid);
359 } else if (problems.getCurrentProblemList() == null) {
360 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
362 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
363 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
364 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
365 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
372 * Read problems of specific interfaces
374 * @param uuId Universal index of Interfacepac
375 * @return number of alarms
377 private List<ProblemNotificationXml> readTheFaultsOfMwHybridMwStructurePac(UniversalId interfacePacUuid,
378 List<ProblemNotificationXml> resultList) {
380 final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
381 // final Class<MwHybridMwStructurePacKey> clazzPacKey =
382 // MwHybridMwStructurePacKey.class;
383 final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
384 // final Class<HybridMwStructureCurrentProblemsG> clazzProblem =
385 // HybridMwStructureCurrentProblemsG.class;
387 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
388 coreData.getMountpoint(), interfacePacUuid.getValue());
390 InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
391 .builder(clazzPac, new MwHybridMwStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
393 HybridMwStructureCurrentProblems problems = genericTransactionUtils.readData(coreData.getDataBroker(),
394 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
395 if (problems == null) {
396 LOG.debug("DBRead Id {} no HybridMwStructureCurrentProblems", interfacePacUuid);
397 } else if (problems.getCurrentProblemList() == null) {
398 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
400 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
401 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
402 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
403 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
410 * Read problems of specific interfaces. TODO Goal for future implementation
411 * without usage of explicit new. Key is generated by newInstance() function
412 * here to verify this approach.
414 * @param uuId Universal index of Interfacepac
415 * @return number of alarms
416 * @throws SecurityException
417 * @throws NoSuchMethodException
418 * @throws InvocationTargetException
419 * @throws IllegalArgumentException
420 * @throws IllegalAccessException
421 * @throws InstantiationException
423 private List<ProblemNotificationXml> readTheFaultsOfMwTdmContainerPac(UniversalId interfacePacUuid,
424 List<ProblemNotificationXml> resultList) {
426 final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
427 final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
428 final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
429 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
430 // ContainerCurrentProblemTypeG.class;
432 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
433 coreData.getMountpoint(), interfacePacUuid.getValue());
436 // -- Specific part 1
437 Constructor<MwTdmContainerPacKey> cons = clazzPacKey.getConstructor(UniversalId.class); // Avoid new()
438 InstanceIdentifier<TdmContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
439 .builder(clazzPac, cons.newInstance(interfacePacUuid)).child(clazzProblems).build();
441 // -- Specific part 2
442 TdmContainerCurrentProblems problems = genericTransactionUtils.readData(coreData.getDataBroker(),
443 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
444 if (problems == null) {
445 LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
446 } else if (problems.getCurrentProblemList() == null) {
447 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
449 // -- Specific part 3
450 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
451 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
452 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
453 problem.getSequenceNumber(),
454 InternalDateAndTime.valueOf(problem.getTimeStamp())));
457 } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
458 | IllegalArgumentException | InvocationTargetException e) {
459 LOG.warn("Could not reade instance of MwTdmContainerPacKey: ", e);
464 /*-----------------------------------------------------------------------------
465 * Performance related data
469 * PM MwAirInterfacePac
474 private List<ExtendedAirInterfaceHistoricalPerformanceType1211p> readTheHistoricalPerformanceDataOfMwAirInterfacePac(
477 String uuId = lp.getUuid().getValue();
479 List<ExtendedAirInterfaceHistoricalPerformanceType1211p> resultList = new ArrayList<>();
480 LOG.debug("DBRead Get {} MWAirInterfacePac: {}", coreData.getMountpoint(), uuId);
482 UniversalId mwAirInterfacePacuuId = new UniversalId(uuId);
483 // Step 2.1: construct data and the relative iid
484 InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier
485 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
486 .child(AirInterfaceConfiguration.class).build();
487 AirInterfaceConfiguration airConfiguration = genericTransactionUtils.readData(coreData.getDataBroker(),
488 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID);
490 if (airConfiguration == null) {
491 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId);
494 // Step 2.2: construct data and the relative iid
495 InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID = InstanceIdentifier
496 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
497 .child(AirInterfaceHistoricalPerformances.class).build();
499 // Step 2.3: read to the config data store
500 AirInterfaceHistoricalPerformances airHistoricalPerformanceData = genericTransactionUtils.readData(
501 coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID);
503 if (airHistoricalPerformanceData == null) {
504 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances",
505 mwAirInterfacePacuuId);
507 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.air._interface.historical.performances.g.HistoricalPerformanceDataList
508 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = airHistoricalPerformanceData
509 .getHistoricalPerformanceDataList();
510 LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId,
511 airHistPMList.size());
512 if (airHistPMList != null) {
513 for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistoricalPerformanceData
514 .getHistoricalPerformanceDataList()) {
515 resultList.add(new ExtendedAirInterfaceHistoricalPerformanceType1211p(pmRecord, airConfiguration));
520 LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, resultList.size());
524 private List<ContainerHistoricalPerformanceTypeG> readTheHistoricalPerformanceDataOfEthernetContainer(Lp lp) {
526 final String myName = "MWEthernetContainerPac";
527 String uuId = lp.getUuid().getValue();
529 List<ContainerHistoricalPerformanceTypeG> resultList = new ArrayList<>();
530 LOG.debug("DBRead Get {} : {}", coreData.getMountpoint(), myName, uuId);
532 UniversalId ethContainerPacuuId = new UniversalId(uuId);
533 // Step 2.2: construct data and the relative iid
534 InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier
535 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId))
536 .child(EthernetContainerHistoricalPerformances.class).build();
538 // Step 2.3: read to the config data store
539 EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = genericTransactionUtils
540 .readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID);
542 if (ethContainerHistoricalPerformanceData == null) {
543 LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
546 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.ethernet.container.historical.performances.g.HistoricalPerformanceDataList
547 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = ethContainerHistoricalPerformanceData
548 .getHistoricalPerformanceDataList();
549 LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
550 if (airHistPMList != null) {
551 for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
552 resultList.add(pmRecord);
556 LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, resultList.size());
561 public void onObjectCreationNotification(ObjectCreationNotification notification) {
562 LOG.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName());
564 ObjectCreationNotificationXml notificationXml = new ObjectCreationNotificationXml(coreData.getMountpoint(),
565 notification.getCounter(),
566 InternalDateAndTime.valueOf(notification.getTimeStamp()),
567 notification.getObjectIdRef().getValue());
568 microwaveModelListener.onObjectCreationNotification(notificationXml);
572 public void onObjectDeletionNotification(ObjectDeletionNotification notification) {
573 LOG.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName());
575 ObjectDeletionNotificationXml notificationXml = new ObjectDeletionNotificationXml(coreData.getMountpoint(),
576 notification.getCounter(),
577 InternalDateAndTime.valueOf(notification.getTimeStamp()),
578 notification.getObjectIdRef().getValue()
580 microwaveModelListener.onObjectDeletionNotification(notificationXml);
584 public void onProblemNotification(ProblemNotification notification) {
586 LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
588 ProblemNotificationXml notificationXml = new ProblemNotificationXml(coreData.getMountpoint(), notification.getObjectIdRef().getValue(),
589 notification.getProblem(), InternalSeverity.valueOf(notification.getSeverity()),
590 notification.getCounter(), InternalDateAndTime.valueOf(notification.getTimeStamp()));
592 microwaveModelListener.onProblemNotification(notificationXml);
596 public void onAttributeValueChangedNotification(AttributeValueChangedNotification notification) {
597 LOG.debug("Got event of type :: {}", AttributeValueChangedNotification.class.getSimpleName());
599 AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(coreData.getMountpoint(),
600 notification.getCounter(), InternalDateAndTime.valueOf(notification.getTimeStamp()),
601 notification.getObjectIdRef().getValue(), notification.getAttributeName(), notification.getNewValue());
603 microwaveModelListener.onAttributeValueChangedNotification(notificationXml);