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.ExtendedAirInterfaceHistoricalPerformanceType1211;
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.rev180907.AirInterfaceCurrentProblemTypeG;
43 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AirInterfaceDiversityCurrentProblemTypeG;
44 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AirInterfaceHistoricalPerformanceTypeG;
45 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AttributeValueChangedNotification;
46 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ContainerCurrentProblemTypeG;
47 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ContainerHistoricalPerformanceTypeG;
48 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MicrowaveModelListener;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfaceDiversityPac;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfaceDiversityPacKey;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfacePac;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfacePacKey;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwEthernetContainerPac;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwEthernetContainerPacKey;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwHybridMwStructurePac;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwHybridMwStructurePacKey;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwPureEthernetStructurePac;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwPureEthernetStructurePacKey;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwTdmContainerPac;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwTdmContainerPacKey;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ObjectCreationNotification;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ObjectDeletionNotification;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ProblemNotification;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.StructureCurrentProblemTypeG;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceConfiguration;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceCurrentProblems;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
72 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
73 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.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 WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, MicrowaveModelListener {
83 private static final Logger LOG = LoggerFactory.getLogger(WrapperMicrowaveModelRev180907.class);
85 public static final QName QNAME = MwAirInterfacePac.QNAME;
88 private NetworkElementCoreData coreData;
90 private OnfMicrowaveModelNotification microwaveModelListener;
92 private final TransactionUtils genericTransactionUtil;
95 /*-----------------------------------------------------------------------------
102 public WrapperMicrowaveModelRev180907(INetconfAcessor acessor) {
103 genericTransactionUtil = acessor.getTransactionUtils();
107 public void setCoreData(NetworkElementCoreData coreData) {
108 this.coreData = coreData;
111 public NetworkElementCoreData getCoreData() {
116 public void setOnfMicrowaveModelListener(OnfMicrowaveModelNotification microwaveModelListener) {
117 this.microwaveModelListener = microwaveModelListener;
120 @SuppressWarnings("unchecked")
122 public <T extends NotificationListener> T getNotificationListener() {
126 /*-----------------------------------------------------------------------------
131 public void readTheFaultsOfMicrowaveModel(ONFLayerProtocolName lpName, Class<?> lpClass, UniversalId uuid,
132 List<ProblemNotificationXml> resultList) {
136 readTheFaultsOfMwAirInterfacePac(uuid, resultList);
139 case EthernetContainer12:
140 readTheFaultsOfMwEthernetContainerPac(uuid, resultList);
144 readTheFaultsOfMwTdmContainerPac(uuid, resultList);
148 if (lpClass == MwHybridMwStructurePac.class) {
149 readTheFaultsOfMwHybridMwStructurePac(uuid, resultList);
151 } else if (lpClass == MwAirInterfaceDiversityPac.class) {
152 readTheFaultsOfMwAirInterfaceDiversityPac(uuid, resultList);
154 } else if (lpClass == MwPureEthernetStructurePac.class) {
155 readTheFaultsOfMwPureEthernetStructurePac(uuid, resultList);
158 LOG.warn("Unassigned lp model {} class {}", lpName, lpClass);
162 // No alarms supported
164 case EthernetContainer10:
166 LOG.warn("Unassigned or not expected lp in model {}", lpName);
171 public List<? extends OtnHistoryDataG> readTheHistoricalPerformanceData(ONFLayerProtocolName lpName, Lp lp) {
174 return readTheHistoricalPerformanceDataOfMwAirInterfacePac(lp);
176 case EthernetContainer12:
177 return readTheHistoricalPerformanceDataOfEthernetContainer(lp);
179 case EthernetContainer10:
180 case EthernetPhysical:
185 LOG.debug("Do not read HistoricalPM data for {} {}", lpName, lp.getUuid().getValue());
188 return new ArrayList<>();
192 public Class<?> getClassForLtpExtension(QName qName) {
194 if (qName.equals(MwAirInterfacePac.QNAME)) {
195 res = MwAirInterfacePac.class;
196 } else if (qName.equals(MwAirInterfaceDiversityPac.QNAME)) {
197 res = MwAirInterfaceDiversityPac.class;
198 } else if (qName.equals(MwPureEthernetStructurePac.QNAME)) {
199 res = MwPureEthernetStructurePac.class;
200 } else if (qName.equals(MwHybridMwStructurePac.QNAME)) {
201 res = MwHybridMwStructurePac.class;
202 } else if (qName.equals(MwEthernetContainerPac.QNAME)) {
203 res = MwEthernetContainerPac.class;
204 } else if (qName.equals(MwTdmContainerPac.QNAME)) {
205 res = MwTdmContainerPac.class;
207 LOG.info("Found QName {} mapped to {}", String.valueOf(qName), String.valueOf(res));
211 /*-----------------------------------------------------------------------------
212 * Reading problems for specific interface pacs
216 * Read problems of specific interfaces
218 * @param uuId Universal Id String of the interface
219 * @return number of alarms
221 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfacePac(UniversalId interfacePacUuid,
222 List<ProblemNotificationXml> resultList) {
224 final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class;
225 // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class;
226 // final Class<AirInterfaceCurrentProblems> clazzProblems =
227 // AirInterfaceCurrentProblems.class;
228 // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem =
229 // AirInterfaceCurrentProblemTypeG.class;
231 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
232 coreData.getMountpoint(), interfacePacUuid.getValue());
234 // Step 2.2: construct data and the relative iid
235 InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID = InstanceIdentifier
236 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(interfacePacUuid))
237 .child(AirInterfaceCurrentProblems.class).build();
239 // Step 2.3: read to the config data store
240 AirInterfaceCurrentProblems problems = genericTransactionUtil.readData(coreData.getDataBroker(),
241 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID);
243 if (problems == null) {
244 LOG.debug("DBRead Id {} no AirInterfaceCurrentProblems", interfacePacUuid);
245 } else if (problems.getCurrentProblemList() == null) {
246 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
248 for (AirInterfaceCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
249 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
250 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
251 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
258 * Read problems of specific interfaces
260 * @param uuId Universal index of Interfacepac
261 * @return number of alarms
263 private List<ProblemNotificationXml> readTheFaultsOfMwEthernetContainerPac(UniversalId interfacePacUuid,
264 List<ProblemNotificationXml> resultList) {
266 final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class;
267 // final Class<MwEthernetContainerPacKey> clazzPacKey =
268 // MwEthernetContainerPacKey.class;
269 // final Class<EthernetContainerCurrentProblems> clazzProblems =
270 // EthernetContainerCurrentProblems.class;
271 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
272 // ContainerCurrentProblemTypeG.class;
274 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
275 coreData.getMountpoint(), interfacePacUuid.getValue());
277 InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
278 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(interfacePacUuid))
279 .child(EthernetContainerCurrentProblems.class).build();
281 EthernetContainerCurrentProblems problems = genericTransactionUtil.readData(coreData.getDataBroker(),
282 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
283 if (problems == null) {
284 LOG.debug("DBRead Id {} no EthernetContainerCurrentProblems", interfacePacUuid);
285 } else if (problems.getCurrentProblemList() == null) {
286 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
288 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
289 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
290 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
291 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
298 * Read problems of specific interfaces
300 * @param uuId Universal index of Interfacepac
301 * @return number of alarms
303 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfaceDiversityPac(UniversalId interfacePacUuid,
304 List<ProblemNotificationXml> resultList) {
306 final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
307 // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey =
308 // MwAirInterfaceDiversityPacKey.class;
309 final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
310 // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem =
311 // AirInterfaceDiversityCurrentProblemTypeG.class;
313 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
314 coreData.getMountpoint(), interfacePacUuid.getValue());
316 InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
317 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(interfacePacUuid)).child(clazzProblems).build();
319 AirInterfaceDiversityCurrentProblems problems = genericTransactionUtil.readData(coreData.getDataBroker(),
320 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
321 if (problems == null) {
322 LOG.debug("DBRead Id {} no AirInterfaceDiversityCurrentProblems", interfacePacUuid);
323 } else if (problems.getCurrentProblemList() == null) {
324 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
326 for (AirInterfaceDiversityCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
327 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
328 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
329 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
336 * Read problems of specific interfaces
338 * @param uuId Universal index of Interfacepac
339 * @return number of alarms
341 private List<ProblemNotificationXml> readTheFaultsOfMwPureEthernetStructurePac(UniversalId interfacePacUuid,
342 List<ProblemNotificationXml> resultList) {
344 final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
345 // final Class<MwPureEthernetStructurePacKey> clazzPacKey =
346 // MwPureEthernetStructurePacKey.class;
347 final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
348 // final Class<StructureCurrentProblemTypeG> clazzProblem =
349 // StructureCurrentProblemTypeG.class;
351 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
352 coreData.getMountpoint(), interfacePacUuid.getValue());
354 InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
355 .builder(clazzPac, new MwPureEthernetStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
357 PureEthernetStructureCurrentProblems problems = genericTransactionUtil.readData(coreData.getDataBroker(),
358 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
359 if (problems == null) {
360 LOG.debug("DBRead Id {} no PureEthernetStructureCurrentProblems", interfacePacUuid);
361 } else if (problems.getCurrentProblemList() == null) {
362 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
364 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
365 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
366 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
367 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
374 * Read problems of specific interfaces
376 * @param uuId Universal index of Interfacepac
377 * @return number of alarms
379 private List<ProblemNotificationXml> readTheFaultsOfMwHybridMwStructurePac(UniversalId interfacePacUuid,
380 List<ProblemNotificationXml> resultList) {
382 final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
383 // final Class<MwHybridMwStructurePacKey> clazzPacKey =
384 // MwHybridMwStructurePacKey.class;
385 final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
386 // final Class<HybridMwStructureCurrentProblemsG> clazzProblem =
387 // HybridMwStructureCurrentProblemsG.class;
389 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
390 coreData.getMountpoint(), interfacePacUuid.getValue());
392 InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
393 .builder(clazzPac, new MwHybridMwStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
395 HybridMwStructureCurrentProblems problems = genericTransactionUtil.readData(coreData.getDataBroker(),
396 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
397 if (problems == null) {
398 LOG.debug("DBRead Id {} no HybridMwStructureCurrentProblems", interfacePacUuid);
399 } else if (problems.getCurrentProblemList() == null) {
400 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
402 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
403 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
404 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
405 problem.getSequenceNumber(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
412 * Read problems of specific interfaces. TODO Goal for future implementation
413 * without usage of explicit new. Key is generated by newInstance() function
414 * here to verify this approach.
416 * @param uuId Universal index of Interfacepac
417 * @return number of alarms
418 * @throws SecurityException
419 * @throws NoSuchMethodException
420 * @throws InvocationTargetException
421 * @throws IllegalArgumentException
422 * @throws IllegalAccessException
423 * @throws InstantiationException
425 private List<ProblemNotificationXml> readTheFaultsOfMwTdmContainerPac(UniversalId interfacePacUuid,
426 List<ProblemNotificationXml> resultList) {
428 final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
429 final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
430 final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
431 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
432 // ContainerCurrentProblemTypeG.class;
434 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
435 coreData.getMountpoint(), interfacePacUuid.getValue());
438 // -- Specific part 1
439 Constructor<MwTdmContainerPacKey> cons = clazzPacKey.getConstructor(UniversalId.class); // Avoid new()
440 InstanceIdentifier<TdmContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
441 .builder(clazzPac, cons.newInstance(interfacePacUuid)).child(clazzProblems).build();
443 // -- Specific part 2
444 TdmContainerCurrentProblems problems = genericTransactionUtil.readData(coreData.getDataBroker(),
445 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
446 if (problems == null) {
447 LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
448 } else if (problems.getCurrentProblemList() == null) {
449 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
451 // -- Specific part 3
452 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
453 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
454 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
455 problem.getSequenceNumber(),
456 InternalDateAndTime.valueOf(problem.getTimeStamp())));
459 } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
460 | IllegalArgumentException | InvocationTargetException e) {
461 LOG.warn("Could not reade instance of MwTdmContainerPacKey: ", e);
466 /*-----------------------------------------------------------------------------
467 * Performance related data
471 * PM MwAirInterfacePac
476 private List<ExtendedAirInterfaceHistoricalPerformanceType1211> readTheHistoricalPerformanceDataOfMwAirInterfacePac(
479 String uuId = lp.getUuid().getValue();
481 List<ExtendedAirInterfaceHistoricalPerformanceType1211> resultList = new ArrayList<>();
482 LOG.debug("DBRead Get {} MWAirInterfacePac: {}", coreData.getMountpoint(), uuId);
484 UniversalId mwAirInterfacePacuuId = new UniversalId(uuId);
485 // Step 2.1: construct data and the relative iid
486 InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier
487 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
488 .child(AirInterfaceConfiguration.class).build();
489 AirInterfaceConfiguration airConfiguration = genericTransactionUtil.readData(coreData.getDataBroker(),
490 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID);
492 if (airConfiguration == null) {
493 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId);
496 // Step 2.2: construct data and the relative iid
497 InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID = InstanceIdentifier
498 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
499 .child(AirInterfaceHistoricalPerformances.class).build();
501 // Step 2.3: read to the config data store
502 AirInterfaceHistoricalPerformances airHistoricalPerformanceData = genericTransactionUtil.readData(
503 coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID);
505 if (airHistoricalPerformanceData == null) {
506 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances",
507 mwAirInterfacePacuuId);
509 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.air._interface.historical.performances.g.HistoricalPerformanceDataList
510 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = airHistoricalPerformanceData
511 .getHistoricalPerformanceDataList();
512 LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId,
513 airHistPMList.size());
514 if (airHistPMList != null) {
515 for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistoricalPerformanceData
516 .getHistoricalPerformanceDataList()) {
517 resultList.add(new ExtendedAirInterfaceHistoricalPerformanceType1211(pmRecord, airConfiguration));
522 LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, resultList.size());
526 private List<ContainerHistoricalPerformanceTypeG> readTheHistoricalPerformanceDataOfEthernetContainer(Lp lp) {
528 final String myName = "MWEthernetContainerPac";
529 String uuId = lp.getUuid().getValue();
531 List<ContainerHistoricalPerformanceTypeG> resultList = new ArrayList<>();
532 LOG.debug("DBRead Get {} : {}", coreData.getMountpoint(), myName, uuId);
534 UniversalId ethContainerPacuuId = new UniversalId(uuId);
535 // Step 2.2: construct data and the relative iid
536 InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier
537 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId))
538 .child(EthernetContainerHistoricalPerformances.class).build();
540 // Step 2.3: read to the config data store
541 EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = genericTransactionUtil
542 .readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID);
544 if (ethContainerHistoricalPerformanceData == null) {
545 LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
548 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.ethernet.container.historical.performances.g.HistoricalPerformanceDataList
549 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = ethContainerHistoricalPerformanceData
550 .getHistoricalPerformanceDataList();
551 LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
552 if (airHistPMList != null) {
553 for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
554 resultList.add(pmRecord);
558 LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, resultList.size());
563 public void onObjectCreationNotification(ObjectCreationNotification notification) {
564 LOG.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName());
566 ObjectCreationNotificationXml notificationXml = new ObjectCreationNotificationXml(coreData.getMountpoint(),
567 notification.getCounter(),
568 InternalDateAndTime.valueOf(notification.getTimeStamp()),
569 notification.getObjectIdRef().getValue());
570 microwaveModelListener.onObjectCreationNotification(notificationXml);
574 public void onObjectDeletionNotification(ObjectDeletionNotification notification) {
575 LOG.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName());
577 ObjectDeletionNotificationXml notificationXml = new ObjectDeletionNotificationXml(coreData.getMountpoint(),
578 notification.getCounter(),
579 InternalDateAndTime.valueOf(notification.getTimeStamp()),
580 notification.getObjectIdRef().getValue()
582 microwaveModelListener.onObjectDeletionNotification(notificationXml);
586 public void onProblemNotification(ProblemNotification notification) {
588 LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
590 ProblemNotificationXml notificationXml = new ProblemNotificationXml(coreData.getMountpoint(), notification.getObjectIdRef().getValue(),
591 notification.getProblem(), InternalSeverity.valueOf(notification.getSeverity()),
592 notification.getCounter(), InternalDateAndTime.valueOf(notification.getTimeStamp()));
594 microwaveModelListener.onProblemNotification(notificationXml);
598 public void onAttributeValueChangedNotification(AttributeValueChangedNotification notification) {
599 LOG.debug("Got event of type :: {}", AttributeValueChangedNotification.class.getSimpleName());
601 AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(coreData.getMountpoint(),
602 notification.getCounter(), InternalDateAndTime.valueOf(notification.getTimeStamp()),
603 notification.getObjectIdRef().getValue(), notification.getAttributeName(), notification.getNewValue());
605 microwaveModelListener.onAttributeValueChangedNotification(notificationXml);