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 java.lang.reflect.Constructor;
23 import java.lang.reflect.InvocationTargetException;
24 import java.util.ArrayList;
25 import java.util.List;
26 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.internalTypes.InternalDateAndTime;
27 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.internalTypes.InternalSeverity;
28 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.ONFCOreNetworkElementCoreData;
29 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.ONFCoreNetworkElement12;
30 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.container.ExtendedAirInterfaceHistoricalPerformanceType12;
31 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.container.ONFLayerProtocolName;
32 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.util.GenericTransactionUtils;
33 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.AttributeValueChangedNotificationXml;
34 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectCreationNotificationXml;
35 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectDeletionNotificationXml;
36 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ProblemNotificationXml;
37 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
38 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
39 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
40 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.OtnHistoryDataG;
41 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceCurrentProblemTypeG;
42 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceDiversityCurrentProblemTypeG;
43 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceHistoricalPerformanceTypeG;
44 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AttributeValueChangedNotification;
45 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ContainerCurrentProblemTypeG;
46 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ContainerHistoricalPerformanceTypeG;
47 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MicrowaveModelListener;
48 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfaceDiversityPac;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfaceDiversityPacKey;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfacePac;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfacePacKey;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwEthernetContainerPac;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwEthernetContainerPacKey;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwHybridMwStructurePac;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwHybridMwStructurePacKey;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwPureEthernetStructurePac;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwPureEthernetStructurePacKey;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwTdmContainerPac;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwTdmContainerPacKey;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ObjectCreationNotification;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ObjectDeletionNotification;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ProblemNotification;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.StructureCurrentProblemTypeG;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceConfiguration;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceCurrentProblems;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
72 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.tdm.container.pac.TdmContainerCurrentProblems;
73 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
74 import org.opendaylight.yangtools.yang.binding.NotificationListener;
75 import org.opendaylight.yangtools.yang.common.QName;
76 import org.slf4j.Logger;
77 import org.slf4j.LoggerFactory;
80 public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, MicrowaveModelListener {
82 private static final Logger LOG = LoggerFactory.getLogger(ONFCoreNetworkElement12.class);
84 public static final QName QNAME = MwAirInterfacePac.QNAME;
87 private ONFCOreNetworkElementCoreData coreData;
88 private OnfMicrowaveModelNotification microwaveModelListener;
90 /*-----------------------------------------------------------------------------
94 public void setCoreData(ONFCOreNetworkElementCoreData coreData) {
95 this.coreData = coreData;
98 public ONFCOreNetworkElementCoreData getCoreData() {
103 public void setOnfMicrowaveModelListener(OnfMicrowaveModelNotification microwaveModelListener) {
104 this.microwaveModelListener = microwaveModelListener;
107 @SuppressWarnings("unchecked")
109 public <T extends NotificationListener> T getNotificationListener() {
113 /*-----------------------------------------------------------------------------
117 public void readTheFaultsOfMicrowaveModel(ONFLayerProtocolName lpName, Class<?> lpClass, UniversalId uuid,
118 List<ProblemNotificationXml> resultList) {
122 readTheFaultsOfMwAirInterfacePac(uuid, resultList);
125 case EthernetContainer12:
126 readTheFaultsOfMwEthernetContainerPac(uuid, resultList);
130 readTheFaultsOfMwTdmContainerPac(uuid, resultList);
134 if (lpClass == MwHybridMwStructurePac.class) {
135 readTheFaultsOfMwHybridMwStructurePac(uuid, resultList);
137 } else if (lpClass == MwAirInterfaceDiversityPac.class) {
138 readTheFaultsOfMwAirInterfaceDiversityPac(uuid, resultList);
140 } else if (lpClass == MwPureEthernetStructurePac.class) {
141 readTheFaultsOfMwPureEthernetStructurePac(uuid, resultList);
144 LOG.warn("Unassigned lp model {} class {}", lpName, lpClass);
148 // No alarms supported
150 case EthernetContainer10:
152 LOG.warn("Unassigned or not expected lp in model {}", lpName);
156 public List<? extends OtnHistoryDataG> readTheHistoricalPerformanceData(ONFLayerProtocolName lpName, Lp lp) {
159 return readTheHistoricalPerformanceDataOfMwAirInterfacePac(lp);
161 case EthernetContainer12:
162 return readTheHistoricalPerformanceDataOfEthernetContainer(lp);
164 case EthernetContainer10:
165 case EthernetPhysical:
170 LOG.debug("Do not read HistoricalPM data for {} {}", lpName, lp.getUuid().getValue());
173 return new ArrayList<>();
176 public Class<?> getClassForLtpExtension(QName qName) {
178 if (qName.equals(MwAirInterfacePac.QNAME)) {
179 res = MwAirInterfacePac.class;
180 } else if (qName.equals(MwAirInterfaceDiversityPac.QNAME)) {
181 res = MwAirInterfaceDiversityPac.class;
182 } else if (qName.equals(MwPureEthernetStructurePac.QNAME)) {
183 res = MwPureEthernetStructurePac.class;
184 } else if (qName.equals(MwHybridMwStructurePac.QNAME)) {
185 res = MwHybridMwStructurePac.class;
186 } else if (qName.equals(MwEthernetContainerPac.QNAME)) {
187 res = MwEthernetContainerPac.class;
188 } else if (qName.equals(MwTdmContainerPac.QNAME)) {
189 res = MwTdmContainerPac.class;
191 LOG.info("Found QName {} mapped to {}", String.valueOf(qName), String.valueOf(res));
195 /*-----------------------------------------------------------------------------
196 * Reading problems for specific interface pacs
200 * Read problems of specific interfaces
202 * @param uuId Universal Id String of the interface
203 * @return number of alarms
205 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfacePac(UniversalId interfacePacUuid,
206 List<ProblemNotificationXml> resultList) {
208 final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class;
209 // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class;
210 // final Class<AirInterfaceCurrentProblems> clazzProblems =
211 // AirInterfaceCurrentProblems.class;
212 // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem =
213 // AirInterfaceCurrentProblemTypeG.class;
215 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
216 coreData.getMountpoint(), interfacePacUuid.getValue());
218 // Step 2.2: construct data and the relative iid
219 InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID = InstanceIdentifier
220 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(interfacePacUuid))
221 .child(AirInterfaceCurrentProblems.class).build();
223 // Step 2.3: read to the config data store
224 AirInterfaceCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
225 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID);
227 if (problems == null) {
228 LOG.debug("DBRead Id {} no AirInterfaceCurrentProblems", interfacePacUuid);
229 } else if (problems.getCurrentProblemList() == null) {
230 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
232 for (AirInterfaceCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
233 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
234 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
235 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
242 * Read problems of specific interfaces
244 * @param uuId Universal index of Interfacepac
245 * @return number of alarms
247 private List<ProblemNotificationXml> readTheFaultsOfMwEthernetContainerPac(UniversalId interfacePacUuid,
248 List<ProblemNotificationXml> resultList) {
250 final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class;
251 // final Class<MwEthernetContainerPacKey> clazzPacKey =
252 // MwEthernetContainerPacKey.class;
253 // final Class<EthernetContainerCurrentProblems> clazzProblems =
254 // EthernetContainerCurrentProblems.class;
255 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
256 // ContainerCurrentProblemTypeG.class;
258 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
259 coreData.getMountpoint(), interfacePacUuid.getValue());
261 InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
262 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(interfacePacUuid))
263 .child(EthernetContainerCurrentProblems.class).build();
265 EthernetContainerCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
266 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
267 if (problems == null) {
268 LOG.debug("DBRead Id {} no EthernetContainerCurrentProblems", interfacePacUuid);
269 } else if (problems.getCurrentProblemList() == null) {
270 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
272 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
273 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
274 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
275 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
282 * Read problems of specific interfaces
284 * @param uuId Universal index of Interfacepac
285 * @return number of alarms
287 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfaceDiversityPac(UniversalId interfacePacUuid,
288 List<ProblemNotificationXml> resultList) {
290 final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
291 // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey =
292 // MwAirInterfaceDiversityPacKey.class;
293 final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
294 // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem =
295 // AirInterfaceDiversityCurrentProblemTypeG.class;
297 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
298 coreData.getMountpoint(), interfacePacUuid.getValue());
300 InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
301 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(interfacePacUuid)).child(clazzProblems).build();
303 AirInterfaceDiversityCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
304 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
305 if (problems == null) {
306 LOG.debug("DBRead Id {} no AirInterfaceDiversityCurrentProblems", interfacePacUuid);
307 } else if (problems.getCurrentProblemList() == null) {
308 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
310 for (AirInterfaceDiversityCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
311 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
312 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
313 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
320 * Read problems of specific interfaces
322 * @param uuId Universal index of Interfacepac
323 * @return number of alarms
325 private List<ProblemNotificationXml> readTheFaultsOfMwPureEthernetStructurePac(UniversalId interfacePacUuid,
326 List<ProblemNotificationXml> resultList) {
328 final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
329 // final Class<MwPureEthernetStructurePacKey> clazzPacKey =
330 // MwPureEthernetStructurePacKey.class;
331 final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
332 // final Class<StructureCurrentProblemTypeG> clazzProblem =
333 // StructureCurrentProblemTypeG.class;
335 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
336 coreData.getMountpoint(), interfacePacUuid.getValue());
338 InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
339 .builder(clazzPac, new MwPureEthernetStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
341 PureEthernetStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
342 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
343 if (problems == null) {
344 LOG.debug("DBRead Id {} no PureEthernetStructureCurrentProblems", interfacePacUuid);
345 } else if (problems.getCurrentProblemList() == null) {
346 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
348 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
349 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
350 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
351 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
358 * Read problems of specific interfaces
360 * @param uuId Universal index of Interfacepac
361 * @return number of alarms
363 private List<ProblemNotificationXml> readTheFaultsOfMwHybridMwStructurePac(UniversalId interfacePacUuid,
364 List<ProblemNotificationXml> resultList) {
366 final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
367 // final Class<MwHybridMwStructurePacKey> clazzPacKey =
368 // MwHybridMwStructurePacKey.class;
369 final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
370 // final Class<HybridMwStructureCurrentProblemsG> clazzProblem =
371 // HybridMwStructureCurrentProblemsG.class;
373 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
374 coreData.getMountpoint(), interfacePacUuid.getValue());
376 InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
377 .builder(clazzPac, new MwHybridMwStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
379 HybridMwStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
380 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
381 if (problems == null) {
382 LOG.debug("DBRead Id {} no HybridMwStructureCurrentProblems", interfacePacUuid);
383 } else if (problems.getCurrentProblemList() == null) {
384 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
386 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
387 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
388 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
389 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
396 * Read problems of specific interfaces. TODO Goal for future implementation
397 * without usage of explicit new. Key is generated by newInstance() function
398 * here to verify this approach.
400 * @param uuId Universal index of Interfacepac
401 * @return number of alarms
402 * @throws SecurityException
403 * @throws NoSuchMethodException
404 * @throws InvocationTargetException
405 * @throws IllegalArgumentException
406 * @throws IllegalAccessException
407 * @throws InstantiationException
409 private List<ProblemNotificationXml> readTheFaultsOfMwTdmContainerPac(UniversalId interfacePacUuid,
410 List<ProblemNotificationXml> resultList) {
412 final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
413 final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
414 final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
415 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
416 // ContainerCurrentProblemTypeG.class;
418 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
419 coreData.getMountpoint(), interfacePacUuid.getValue());
422 // -- Specific part 1
423 Constructor<MwTdmContainerPacKey> cons = clazzPacKey.getConstructor(UniversalId.class); // Avoid new()
424 InstanceIdentifier<TdmContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
425 .builder(clazzPac, cons.newInstance(interfacePacUuid)).child(clazzProblems).build();
427 // -- Specific part 2
428 TdmContainerCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
429 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
430 if (problems == null) {
431 LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
432 } else if (problems.getCurrentProblemList() == null) {
433 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
435 // -- Specific part 3
436 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
437 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
438 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
439 problem.getSequenceNumber().toString(),
440 InternalDateAndTime.valueOf(problem.getTimeStamp())));
443 } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
444 | IllegalArgumentException | InvocationTargetException e) {
445 LOG.warn("Could not reade instance of MwTdmContainerPacKey: ", e);
450 /*-----------------------------------------------------------------------------
451 * Performance related data
455 * PM MwAirInterfacePac
460 private List<ExtendedAirInterfaceHistoricalPerformanceType12> readTheHistoricalPerformanceDataOfMwAirInterfacePac(
463 String uuId = lp.getUuid().getValue();
465 List<ExtendedAirInterfaceHistoricalPerformanceType12> resultList = new ArrayList<>();
466 LOG.debug("DBRead Get {} MWAirInterfacePac: {}", coreData.getMountpoint(), uuId);
468 UniversalId mwAirInterfacePacuuId = new UniversalId(uuId);
469 // Step 2.1: construct data and the relative iid
470 InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier
471 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
472 .child(AirInterfaceConfiguration.class).build();
473 AirInterfaceConfiguration airConfiguration = GenericTransactionUtils.readData(coreData.getDataBroker(),
474 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID);
476 if (airConfiguration == null) {
477 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId);
480 // Step 2.2: construct data and the relative iid
481 InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID = InstanceIdentifier
482 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
483 .child(AirInterfaceHistoricalPerformances.class).build();
485 // Step 2.3: read to the config data store
486 AirInterfaceHistoricalPerformances airHistoricalPerformanceData = GenericTransactionUtils.readData(
487 coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID);
489 if (airHistoricalPerformanceData == null) {
490 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances",
491 mwAirInterfacePacuuId);
493 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.air._interface.historical.performances.g.HistoricalPerformanceDataList
494 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = airHistoricalPerformanceData
495 .getHistoricalPerformanceDataList();
496 LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId,
497 airHistPMList.size());
498 if (airHistPMList != null) {
499 for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistoricalPerformanceData
500 .getHistoricalPerformanceDataList()) {
501 resultList.add(new ExtendedAirInterfaceHistoricalPerformanceType12(pmRecord, airConfiguration));
506 LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, resultList.size());
510 private List<ContainerHistoricalPerformanceTypeG> readTheHistoricalPerformanceDataOfEthernetContainer(Lp lp) {
512 final String myName = "MWEthernetContainerPac";
513 String uuId = lp.getUuid().getValue();
515 List<ContainerHistoricalPerformanceTypeG> resultList = new ArrayList<>();
516 LOG.debug("DBRead Get {} : {}", coreData.getMountpoint(), myName, uuId);
518 UniversalId ethContainerPacuuId = new UniversalId(uuId);
519 // Step 2.2: construct data and the relative iid
520 InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier
521 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId))
522 .child(EthernetContainerHistoricalPerformances.class).build();
524 // Step 2.3: read to the config data store
525 EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = GenericTransactionUtils
526 .readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID);
528 if (ethContainerHistoricalPerformanceData == null) {
529 LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
532 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.ethernet.container.historical.performances.g.HistoricalPerformanceDataList
533 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ethernet.container.historical.performances.g.HistoricalPerformanceDataList
534 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = ethContainerHistoricalPerformanceData
535 .getHistoricalPerformanceDataList();
536 LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
537 if (airHistPMList != null) {
538 for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
539 resultList.add(pmRecord);
543 LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, resultList.size());
548 public void onObjectCreationNotification(ObjectCreationNotification notification) {
549 LOG.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName());
551 ObjectCreationNotificationXml notificationXml = new ObjectCreationNotificationXml(coreData.getMountpoint(),
552 notification.getCounter().toString(),
553 InternalDateAndTime.valueOf(notification.getTimeStamp()),
554 notification.getObjectIdRef().getValue());
555 microwaveModelListener.onObjectCreationNotification(notificationXml);
559 public void onObjectDeletionNotification(ObjectDeletionNotification notification) {
560 LOG.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName());
562 ObjectDeletionNotificationXml notificationXml = new ObjectDeletionNotificationXml(coreData.getMountpoint(),
563 notification.getCounter().toString(),
564 InternalDateAndTime.valueOf(notification.getTimeStamp()),
565 notification.getObjectIdRef().getValue()
567 microwaveModelListener.onObjectDeletionNotification(notificationXml);
570 public void onProblemNotification(ProblemNotification notification) {
572 LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
574 ProblemNotificationXml notificationXml = new ProblemNotificationXml(coreData.getMountpoint(), notification.getObjectIdRef().getValue(),
575 notification.getProblem(), InternalSeverity.valueOf(notification.getSeverity()),
576 notification.getCounter().toString(), InternalDateAndTime.valueOf(notification.getTimeStamp()));
578 microwaveModelListener.onProblemNotification(notificationXml);
582 public void onAttributeValueChangedNotification(AttributeValueChangedNotification notification) {
583 LOG.debug("Got event of type :: {}", AttributeValueChangedNotification.class.getSimpleName());
585 AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(coreData.getMountpoint(),
586 String.valueOf(notification.getCounter()), InternalDateAndTime.valueOf(notification.getTimeStamp()),
587 notification.getObjectIdRef().getValue(), notification.getAttributeName(), notification.getNewValue());
589 microwaveModelListener.onAttributeValueChangedNotification(notificationXml);