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.container.ExtendedAirInterfaceHistoricalPerformanceType12;
30 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.container.ONFLayerProtocolName;
31 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.util.GenericTransactionUtils;
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.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
37 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
38 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
39 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.OtnHistoryDataG;
40 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceCurrentProblemTypeG;
41 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceDiversityCurrentProblemTypeG;
42 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceHistoricalPerformanceTypeG;
43 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AttributeValueChangedNotification;
44 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ContainerCurrentProblemTypeG;
45 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ContainerHistoricalPerformanceTypeG;
46 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MicrowaveModelListener;
47 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfaceDiversityPac;
48 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfaceDiversityPacKey;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfacePac;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwAirInterfacePacKey;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwEthernetContainerPac;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwEthernetContainerPacKey;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwHybridMwStructurePac;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwHybridMwStructurePacKey;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwPureEthernetStructurePac;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwPureEthernetStructurePacKey;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwTdmContainerPac;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.MwTdmContainerPacKey;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ObjectCreationNotification;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ObjectDeletionNotification;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ProblemNotification;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.StructureCurrentProblemTypeG;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceConfiguration;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceCurrentProblems;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.tdm.container.pac.TdmContainerCurrentProblems;
72 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
73 import org.opendaylight.yangtools.yang.binding.NotificationListener;
74 import org.opendaylight.yangtools.yang.common.QName;
75 import org.slf4j.Logger;
76 import org.slf4j.LoggerFactory;
79 public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, MicrowaveModelListener {
81 private static final Logger LOG = LoggerFactory.getLogger(WrapperMicrowaveModelRev170324.class);
83 public static final QName QNAME = MwAirInterfacePac.QNAME;
86 private ONFCOreNetworkElementCoreData coreData;
87 private OnfMicrowaveModelNotification microwaveModelListener;
89 /*-----------------------------------------------------------------------------
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 /*-----------------------------------------------------------------------------
118 public void readTheFaultsOfMicrowaveModel(ONFLayerProtocolName lpName, Class<?> lpClass, UniversalId uuid,
119 List<ProblemNotificationXml> resultList) {
123 readTheFaultsOfMwAirInterfacePac(uuid, resultList);
126 case EthernetContainer12:
127 readTheFaultsOfMwEthernetContainerPac(uuid, resultList);
131 readTheFaultsOfMwTdmContainerPac(uuid, resultList);
135 if (lpClass == MwHybridMwStructurePac.class) {
136 readTheFaultsOfMwHybridMwStructurePac(uuid, resultList);
138 } else if (lpClass == MwAirInterfaceDiversityPac.class) {
139 readTheFaultsOfMwAirInterfaceDiversityPac(uuid, resultList);
141 } else if (lpClass == MwPureEthernetStructurePac.class) {
142 readTheFaultsOfMwPureEthernetStructurePac(uuid, resultList);
145 LOG.warn("Unassigned lp model {} class {}", lpName, lpClass);
149 // No alarms supported
151 case EthernetContainer10:
153 LOG.warn("Unassigned or not expected lp in model {}", lpName);
158 public List<? extends OtnHistoryDataG> readTheHistoricalPerformanceData(ONFLayerProtocolName lpName, Lp lp) {
161 return readTheHistoricalPerformanceDataOfMwAirInterfacePac(lp);
163 case EthernetContainer12:
164 return readTheHistoricalPerformanceDataOfEthernetContainer(lp);
166 case EthernetContainer10:
167 case EthernetPhysical:
172 LOG.debug("Do not read HistoricalPM data for {} {}", lpName, lp.getUuid().getValue());
175 return new ArrayList<>();
179 public Class<?> getClassForLtpExtension(QName qName) {
181 if (qName.equals(MwAirInterfacePac.QNAME)) {
182 res = MwAirInterfacePac.class;
183 } else if (qName.equals(MwAirInterfaceDiversityPac.QNAME)) {
184 res = MwAirInterfaceDiversityPac.class;
185 } else if (qName.equals(MwPureEthernetStructurePac.QNAME)) {
186 res = MwPureEthernetStructurePac.class;
187 } else if (qName.equals(MwHybridMwStructurePac.QNAME)) {
188 res = MwHybridMwStructurePac.class;
189 } else if (qName.equals(MwEthernetContainerPac.QNAME)) {
190 res = MwEthernetContainerPac.class;
191 } else if (qName.equals(MwTdmContainerPac.QNAME)) {
192 res = MwTdmContainerPac.class;
194 LOG.info("Found QName {} mapped to {}", String.valueOf(qName), String.valueOf(res));
198 /*-----------------------------------------------------------------------------
199 * Reading problems for specific interface pacs
203 * Read problems of specific interfaces
205 * @param uuId Universal Id String of the interface
206 * @return number of alarms
208 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfacePac(UniversalId interfacePacUuid,
209 List<ProblemNotificationXml> resultList) {
211 final Class<MwAirInterfacePac> clazzPac = MwAirInterfacePac.class;
212 // final Class<MwAirInterfacePacKey> clazzPacKey = MwAirInterfacePacKey.class;
213 // final Class<AirInterfaceCurrentProblems> clazzProblems =
214 // AirInterfaceCurrentProblems.class;
215 // final Class<AirInterfaceCurrentProblemTypeG> clazzProblem =
216 // AirInterfaceCurrentProblemTypeG.class;
218 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
219 coreData.getMountpoint(), interfacePacUuid.getValue());
221 // Step 2.2: construct data and the relative iid
222 InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID = InstanceIdentifier
223 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(interfacePacUuid))
224 .child(AirInterfaceCurrentProblems.class).build();
226 // Step 2.3: read to the config data store
227 AirInterfaceCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
228 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceIID);
230 if (problems == null) {
231 LOG.debug("DBRead Id {} no AirInterfaceCurrentProblems", interfacePacUuid);
232 } else if (problems.getCurrentProblemList() == null) {
233 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
235 for (AirInterfaceCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
236 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
237 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
238 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
245 * Read problems of specific interfaces
247 * @param uuId Universal index of Interfacepac
248 * @return number of alarms
250 private List<ProblemNotificationXml> readTheFaultsOfMwEthernetContainerPac(UniversalId interfacePacUuid,
251 List<ProblemNotificationXml> resultList) {
253 final Class<MwEthernetContainerPac> clazzPac = MwEthernetContainerPac.class;
254 // final Class<MwEthernetContainerPacKey> clazzPacKey =
255 // MwEthernetContainerPacKey.class;
256 // final Class<EthernetContainerCurrentProblems> clazzProblems =
257 // EthernetContainerCurrentProblems.class;
258 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
259 // ContainerCurrentProblemTypeG.class;
261 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
262 coreData.getMountpoint(), interfacePacUuid.getValue());
264 InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
265 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(interfacePacUuid))
266 .child(EthernetContainerCurrentProblems.class).build();
268 EthernetContainerCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
269 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
270 if (problems == null) {
271 LOG.debug("DBRead Id {} no EthernetContainerCurrentProblems", interfacePacUuid);
272 } else if (problems.getCurrentProblemList() == null) {
273 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
275 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
276 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
277 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
278 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
285 * Read problems of specific interfaces
287 * @param uuId Universal index of Interfacepac
288 * @return number of alarms
290 private List<ProblemNotificationXml> readTheFaultsOfMwAirInterfaceDiversityPac(UniversalId interfacePacUuid,
291 List<ProblemNotificationXml> resultList) {
293 final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
294 // final Class<MwAirInterfaceDiversityPacKey> clazzPacKey =
295 // MwAirInterfaceDiversityPacKey.class;
296 final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
297 // final Class<AirInterfaceDiversityCurrentProblemTypeG> clazzProblem =
298 // AirInterfaceDiversityCurrentProblemTypeG.class;
300 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
301 coreData.getMountpoint(), interfacePacUuid.getValue());
303 InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
304 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(interfacePacUuid)).child(clazzProblems).build();
306 AirInterfaceDiversityCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
307 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
308 if (problems == null) {
309 LOG.debug("DBRead Id {} no AirInterfaceDiversityCurrentProblems", interfacePacUuid);
310 } else if (problems.getCurrentProblemList() == null) {
311 LOG.debug("DBRead Id {} empty CurrentProblemList", interfacePacUuid);
313 for (AirInterfaceDiversityCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
314 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
315 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
316 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
323 * Read problems of specific interfaces
325 * @param uuId Universal index of Interfacepac
326 * @return number of alarms
328 private List<ProblemNotificationXml> readTheFaultsOfMwPureEthernetStructurePac(UniversalId interfacePacUuid,
329 List<ProblemNotificationXml> resultList) {
331 final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
332 // final Class<MwPureEthernetStructurePacKey> clazzPacKey =
333 // MwPureEthernetStructurePacKey.class;
334 final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
335 // final Class<StructureCurrentProblemTypeG> clazzProblem =
336 // StructureCurrentProblemTypeG.class;
338 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
339 coreData.getMountpoint(), interfacePacUuid.getValue());
341 InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
342 .builder(clazzPac, new MwPureEthernetStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
344 PureEthernetStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
345 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
346 if (problems == null) {
347 LOG.debug("DBRead Id {} no PureEthernetStructureCurrentProblems", interfacePacUuid);
348 } else if (problems.getCurrentProblemList() == null) {
349 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
351 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
352 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
353 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
354 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
361 * Read problems of specific interfaces
363 * @param uuId Universal index of Interfacepac
364 * @return number of alarms
366 private List<ProblemNotificationXml> readTheFaultsOfMwHybridMwStructurePac(UniversalId interfacePacUuid,
367 List<ProblemNotificationXml> resultList) {
369 final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
370 // final Class<MwHybridMwStructurePacKey> clazzPacKey =
371 // MwHybridMwStructurePacKey.class;
372 final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
373 // final Class<HybridMwStructureCurrentProblemsG> clazzProblem =
374 // HybridMwStructureCurrentProblemsG.class;
376 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
377 coreData.getMountpoint(), interfacePacUuid.getValue());
379 InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
380 .builder(clazzPac, new MwHybridMwStructurePacKey(interfacePacUuid)).child(clazzProblems).build();
382 HybridMwStructureCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
383 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
384 if (problems == null) {
385 LOG.debug("DBRead Id {} no HybridMwStructureCurrentProblems", interfacePacUuid);
386 } else if (problems.getCurrentProblemList() == null) {
387 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
389 for (StructureCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
390 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
391 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
392 problem.getSequenceNumber().toString(), InternalDateAndTime.valueOf(problem.getTimeStamp())));
399 * Read problems of specific interfaces. TODO Goal for future implementation
400 * without usage of explicit new. Key is generated by newInstance() function
401 * here to verify this approach.
403 * @param uuId Universal index of Interfacepac
404 * @return number of alarms
405 * @throws SecurityException
406 * @throws NoSuchMethodException
407 * @throws InvocationTargetException
408 * @throws IllegalArgumentException
409 * @throws IllegalAccessException
410 * @throws InstantiationException
412 private List<ProblemNotificationXml> readTheFaultsOfMwTdmContainerPac(UniversalId interfacePacUuid,
413 List<ProblemNotificationXml> resultList) {
415 final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
416 final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
417 final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
418 // final Class<ContainerCurrentProblemTypeG> clazzProblem =
419 // ContainerCurrentProblemTypeG.class;
421 LOG.info("DBRead Get problems for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
422 coreData.getMountpoint(), interfacePacUuid.getValue());
425 // -- Specific part 1
426 Constructor<MwTdmContainerPacKey> cons = clazzPacKey.getConstructor(UniversalId.class); // Avoid new()
427 InstanceIdentifier<TdmContainerCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
428 .builder(clazzPac, cons.newInstance(interfacePacUuid)).child(clazzProblems).build();
430 // -- Specific part 2
431 TdmContainerCurrentProblems problems = GenericTransactionUtils.readData(coreData.getDataBroker(),
432 LogicalDatastoreType.OPERATIONAL, mwEthInterfaceIID);
433 if (problems == null) {
434 LOG.debug("DBRead Id {} no TdmContainerCurrentProblems", interfacePacUuid);
435 } else if (problems.getCurrentProblemList() == null) {
436 LOG.debug("DBRead Id {} empty CurrentProblemsList", interfacePacUuid);
438 // -- Specific part 3
439 for (ContainerCurrentProblemTypeG problem : problems.getCurrentProblemList()) {
440 resultList.add(new ProblemNotificationXml(coreData.getMountpoint(), interfacePacUuid.getValue(),
441 problem.getProblemName(), InternalSeverity.valueOf(problem.getProblemSeverity()),
442 problem.getSequenceNumber().toString(),
443 InternalDateAndTime.valueOf(problem.getTimeStamp())));
446 } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
447 | IllegalArgumentException | InvocationTargetException e) {
448 LOG.warn("Could not reade instance of MwTdmContainerPacKey: ", e);
453 /*-----------------------------------------------------------------------------
454 * Performance related data
458 * PM MwAirInterfacePac
463 private List<ExtendedAirInterfaceHistoricalPerformanceType12> readTheHistoricalPerformanceDataOfMwAirInterfacePac(
466 String uuId = lp.getUuid().getValue();
468 List<ExtendedAirInterfaceHistoricalPerformanceType12> resultList = new ArrayList<>();
469 LOG.debug("DBRead Get {} MWAirInterfacePac: {}", coreData.getMountpoint(), uuId);
471 UniversalId mwAirInterfacePacuuId = new UniversalId(uuId);
472 // Step 2.1: construct data and the relative iid
473 InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier
474 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
475 .child(AirInterfaceConfiguration.class).build();
476 AirInterfaceConfiguration airConfiguration = GenericTransactionUtils.readData(coreData.getDataBroker(),
477 LogicalDatastoreType.OPERATIONAL, mwAirInterfaceConfigurationIID);
479 if (airConfiguration == null) {
480 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceConfiguration", mwAirInterfacePacuuId);
483 // Step 2.2: construct data and the relative iid
484 InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID = InstanceIdentifier
485 .builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(mwAirInterfacePacuuId))
486 .child(AirInterfaceHistoricalPerformances.class).build();
488 // Step 2.3: read to the config data store
489 AirInterfaceHistoricalPerformances airHistoricalPerformanceData = GenericTransactionUtils.readData(
490 coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, mwAirInterfaceHistoricalPerformanceIID);
492 if (airHistoricalPerformanceData == null) {
493 LOG.debug("DBRead MWAirInterfacePac Id {} no AirInterfaceHistoricalPerformances",
494 mwAirInterfacePacuuId);
496 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.air._interface.historical.performances.g.HistoricalPerformanceDataList
497 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = airHistoricalPerformanceData
498 .getHistoricalPerformanceDataList();
499 LOG.debug("DBRead MWAirInterfacePac Id {} Records intermediate: {}", mwAirInterfacePacuuId,
500 airHistPMList.size());
501 if (airHistPMList != null) {
502 for (AirInterfaceHistoricalPerformanceTypeG pmRecord : airHistoricalPerformanceData
503 .getHistoricalPerformanceDataList()) {
504 resultList.add(new ExtendedAirInterfaceHistoricalPerformanceType12(pmRecord, airConfiguration));
509 LOG.debug("DBRead MWAirInterfacePac Id {} Records result: {}", mwAirInterfacePacuuId, resultList.size());
513 private List<ContainerHistoricalPerformanceTypeG> readTheHistoricalPerformanceDataOfEthernetContainer(Lp lp) {
515 final String myName = "MWEthernetContainerPac";
516 String uuId = lp.getUuid().getValue();
518 List<ContainerHistoricalPerformanceTypeG> resultList = new ArrayList<>();
519 LOG.debug("DBRead Get {} : {}", coreData.getMountpoint(), myName, uuId);
521 UniversalId ethContainerPacuuId = new UniversalId(uuId);
522 // Step 2.2: construct data and the relative iid
523 InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID = InstanceIdentifier
524 .builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(ethContainerPacuuId))
525 .child(EthernetContainerHistoricalPerformances.class).build();
527 // Step 2.3: read to the config data store
528 EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData = GenericTransactionUtils
529 .readData(coreData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, ethContainerIID);
531 if (ethContainerHistoricalPerformanceData == null) {
532 LOG.debug("DBRead {} Id {} no HistoricalPerformances", myName, ethContainerPacuuId);
535 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170320.ethernet.container.historical.performances.g.HistoricalPerformanceDataList
536 // org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ethernet.container.historical.performances.g.HistoricalPerformanceDataList
537 List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> airHistPMList = ethContainerHistoricalPerformanceData
538 .getHistoricalPerformanceDataList();
539 LOG.debug("DBRead {} Id {} Records intermediate: {}", myName, ethContainerPacuuId, airHistPMList.size());
540 if (airHistPMList != null) {
541 for (ContainerHistoricalPerformanceTypeG pmRecord : airHistPMList) {
542 resultList.add(pmRecord);
546 LOG.debug("DBRead {} Id {} Records result: {}", myName, ethContainerPacuuId, resultList.size());
551 public void onObjectCreationNotification(ObjectCreationNotification notification) {
552 LOG.debug("Got event of type :: {}", ObjectCreationNotification.class.getSimpleName());
554 ObjectCreationNotificationXml notificationXml = new ObjectCreationNotificationXml(coreData.getMountpoint(),
555 notification.getCounter().toString(),
556 InternalDateAndTime.valueOf(notification.getTimeStamp()),
557 notification.getObjectIdRef().getValue());
558 microwaveModelListener.onObjectCreationNotification(notificationXml);
562 public void onObjectDeletionNotification(ObjectDeletionNotification notification) {
563 LOG.debug("Got event of type :: {}", ObjectDeletionNotification.class.getSimpleName());
565 ObjectDeletionNotificationXml notificationXml = new ObjectDeletionNotificationXml(coreData.getMountpoint(),
566 notification.getCounter().toString(),
567 InternalDateAndTime.valueOf(notification.getTimeStamp()),
568 notification.getObjectIdRef().getValue()
570 microwaveModelListener.onObjectDeletionNotification(notificationXml);
574 public void onProblemNotification(ProblemNotification notification) {
576 LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
578 ProblemNotificationXml notificationXml = new ProblemNotificationXml(coreData.getMountpoint(), notification.getObjectIdRef().getValue(),
579 notification.getProblem(), InternalSeverity.valueOf(notification.getSeverity()),
580 notification.getCounter().toString(), InternalDateAndTime.valueOf(notification.getTimeStamp()));
582 microwaveModelListener.onProblemNotification(notificationXml);
586 public void onAttributeValueChangedNotification(AttributeValueChangedNotification notification) {
587 LOG.debug("Got event of type :: {}", AttributeValueChangedNotification.class.getSimpleName());
589 AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(coreData.getMountpoint(),
590 String.valueOf(notification.getCounter()), InternalDateAndTime.valueOf(notification.getTimeStamp()),
591 notification.getObjectIdRef().getValue(), notification.getAttributeName(), notification.getNewValue());
593 microwaveModelListener.onAttributeValueChangedNotification(notificationXml);