From 8016160afd589d269cfcdb09079e329dabd328b8 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Fri, 27 Nov 2020 13:28:35 +0100 Subject: SDN-R Server provide GUI cut through for ODLUX SDN-R Server provide GUI cut through for ODLUX Issue-ID: SDNC-1396 Change-Id: I9f510a03dcc07ab0efb84522611fc17e546da93f Signed-off-by: Ravi Pendurty --- sdnr/wt/devicemanager-openroadm/provider/copyright | 17 +++++++++++++++++ sdnr/wt/devicemanager-openroadm/provider/pom.xml | 4 ++-- .../openroadm/impl/InitialDeviceAlarmReader.java | 8 +++++--- .../impl/OpenroadmChangeNotificationListener.java | 2 +- .../OpenroadmDeviceChangeNotificationListener.java | 4 ++-- .../impl/OpenroadmFaultNotificationListener.java | 6 +++--- .../openroadm/impl/OpenroadmInventoryInput.java | 4 ++-- .../openroadm/impl/OpenroadmNetworkElement.java | 18 ++++++++++-------- .../impl/OpenroadmNetworkElementFactory.java | 3 --- .../openroadm/impl/PmDataBuilderOpenRoadm.java | 21 ++++++++++++--------- .../test/TestChangeNotificationListener.java | 4 ++-- .../openroadm/test/TestOpenRoadmNetworkElement.java | 2 +- 12 files changed, 57 insertions(+), 36 deletions(-) create mode 100644 sdnr/wt/devicemanager-openroadm/provider/copyright (limited to 'sdnr/wt/devicemanager-openroadm') diff --git a/sdnr/wt/devicemanager-openroadm/provider/copyright b/sdnr/wt/devicemanager-openroadm/provider/copyright new file mode 100644 index 000000000..754b6218f --- /dev/null +++ b/sdnr/wt/devicemanager-openroadm/provider/copyright @@ -0,0 +1,17 @@ +/** + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ diff --git a/sdnr/wt/devicemanager-openroadm/provider/pom.xml b/sdnr/wt/devicemanager-openroadm/provider/pom.xml index fed48471d..56f137392 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/pom.xml +++ b/sdnr/wt/devicemanager-openroadm/provider/pom.xml @@ -60,8 +60,8 @@ test - net.bytebuddy byte-buddy + net.bytebuddy 1.9.10 test @@ -74,7 +74,7 @@ provided - org.onap.ccsdk.features.sdnr.wt + ${project.groupId} sdnr-wt-devicemanager-model ${project.version} provided diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/InitialDeviceAlarmReader.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/InitialDeviceAlarmReader.java index 70bbfa5c0..f1b3821b8 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/InitialDeviceAlarmReader.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/InitialDeviceAlarmReader.java @@ -21,8 +21,10 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl; +import java.util.Collection; import java.util.List; import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.common.YangHelper; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; @@ -33,8 +35,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.ActiveAla import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.OrgOpenroadmAlarmListener; import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.Severity; import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.active.alarm.list.ActiveAlarms; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Faultlog; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Faultlog; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -68,7 +70,7 @@ public class InitialDeviceAlarmReader { protected FaultData writeFaultData() { FaultData faultData = new FaultData(); if (this.getActiveAlarmList(this.netConfAccesor).getActiveAlarms() != null) { - List activeAlarms = this.getActiveAlarmList(this.netConfAccesor).getActiveAlarms(); + Collection activeAlarms = YangHelper.getCollection(this.getActiveAlarmList(this.netConfAccesor).getActiveAlarms()); if (!activeAlarms.isEmpty()) { for (ActiveAlarms activeAlarm : activeAlarms) { faultData.add(this.netConfAccesor.getNodeId(), this.count, activeAlarm.getRaiseTime(), diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmChangeNotificationListener.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmChangeNotificationListener.java index 1ba7e990c..539fd4847 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmChangeNotificationListener.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmChangeNotificationListener.java @@ -33,7 +33,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.not import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEnd; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionStart; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.Edit; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; import org.slf4j.Logger; diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmDeviceChangeNotificationListener.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmDeviceChangeNotificationListener.java index f055c598a..924af99c2 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmDeviceChangeNotificationListener.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmDeviceChangeNotificationListener.java @@ -31,8 +31,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.CreateTe import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.OrgOpenroadmDeviceListener; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.OtdrScanResult; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.change.notification.Edit; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SourceType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; import org.slf4j.Logger; diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmFaultNotificationListener.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmFaultNotificationListener.java index 69d0af350..f3ff9f9bd 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmFaultNotificationListener.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmFaultNotificationListener.java @@ -30,9 +30,9 @@ import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.AlarmNotification; import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.OrgOpenroadmAlarmListener; import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.Severity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmInventoryInput.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmInventoryInput.java index d67db8a03..c62bb053f 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmInventoryInput.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmInventoryInput.java @@ -27,8 +27,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit. import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.interfaces.grp.Interface; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.org.openroadm.device.Xponder; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.shelves.Shelves; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.InventoryBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.InventoryBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElement.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElement.java index 5fa438497..bc82cd11d 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElement.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElement.java @@ -22,10 +22,12 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl; import java.util.ArrayList; +import java.util.Collection; import java.util.Hashtable; import java.util.List; import java.util.Optional; import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.common.YangHelper; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement; import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElementService; @@ -39,8 +41,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.org.open import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.shelf.Slots; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.shelves.Shelves; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.xponder.XpdrPort; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementDeviceType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementDeviceType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -176,7 +178,7 @@ public class OpenroadmNetworkElement implements NetworkElement { // private methods private void readShelvesData(OrgOpenroadmDevice device) { - List shelves = device.getShelves(); + Collection shelves = YangHelper.getCollection(device.getShelves()); if (shelves != null) { for (Shelves shelf : shelves) { log.info( @@ -187,7 +189,7 @@ public class OpenroadmNetworkElement implements NetworkElement { shelf.getLifecycleState()); databaseService .writeInventory(this.opnRdmInventoryInput.getShelvesInventory(shelf, equipmentLevel + 1)); - List slotList = shelf.getSlots(); + Collection slotList = YangHelper.getCollection(shelf.getSlots()); if (slotList != null) { for (Slots slot : slotList) { if (!slot.getProvisionedCircuitPack().isEmpty()) { @@ -206,14 +208,14 @@ public class OpenroadmNetworkElement implements NetworkElement { } private void readXpndrData(OrgOpenroadmDevice device) { - List xponderList = device.getXponder(); + Collection xponderList = YangHelper.getCollection(device.getXponder()); if (xponderList != null) { for (Xponder xponder : xponderList) { databaseService .writeInventory(this.opnRdmInventoryInput.getXponderInventory(xponder, equipmentLevel + 1)); log.info("Xponders: No.: {} , \n Port: {} ,\n Type: {}", xponder.getXpdrNumber(), xponder.getXpdrPort(), xponder.getXpdrType()); - List xpdrportlist = xponder.getXpdrPort(); + Collection xpdrportlist = YangHelper.getCollection(xponder.getXpdrPort()); if (xpdrportlist != null) { for (XpdrPort xpdrport : xpdrportlist) if (!xpdrport.getCircuitPackName().isEmpty()) { @@ -229,7 +231,7 @@ public class OpenroadmNetworkElement implements NetworkElement { } private void readCircuitPacketData(OrgOpenroadmDevice device) { - List circuitpacklist = device.getCircuitPacks(); + Collection circuitpacklist = YangHelper.getCollection(device.getCircuitPacks()); if (circuitpacklist != null) { for (CircuitPacks cp : circuitpacklist) { @@ -275,7 +277,7 @@ public class OpenroadmNetworkElement implements NetworkElement { } private void readInterfaceData(OrgOpenroadmDevice device) { - List interfaceList = device.getInterface(); + Collection interfaceList = YangHelper.getCollection(device.getInterface()); if (interfaceList != null) { for (Interface deviceInterface : interfaceList) { diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementFactory.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementFactory.java index f19d2b2f4..5e1640192 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementFactory.java @@ -22,7 +22,6 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl; -import java.util.List; import java.util.Optional; import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.factory.NetworkElementFactory; import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement; @@ -48,9 +47,7 @@ public class OpenroadmNetworkElementFactory implements NetworkElementFactory { // public methods @Override public Optional create(NetconfAccessor acessor, DeviceManagerServiceProvider serviceProvider) { - List capabilities = acessor.getCapabilites().getCapabilities(); - capabilities.forEach(capability -> log.info("Capabilities for element are :{}", capability)); if (acessor.getCapabilites().isSupportingNamespace(OrgOpenroadmDevice.QNAME)) { log.info("Create OpenRoadm device {} ", OpenroadmNetworkElement.class.getName()); log.info("Node Id read by Acessor {}:", acessor.getNodeId().getValue()); diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/PmDataBuilderOpenRoadm.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/PmDataBuilderOpenRoadm.java index 755f8ed9f..b75e4c67e 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/PmDataBuilderOpenRoadm.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/PmDataBuilderOpenRoadm.java @@ -22,7 +22,10 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl; import java.util.ArrayList; +import java.util.Collection; import java.util.List; +import org.onap.ccsdk.features.sdnr.wt.common.YangHelper; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.HistoricalPmList; @@ -30,11 +33,11 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.p import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.list.HistoricalPmEntry; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.val.group.Measurement; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmGranularity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.GranularityPeriodType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntityBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.pmdata.entity.PerformanceData; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.pmdata.entity.PerformanceDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GranularityPeriodType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntityBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.entity.PerformanceData; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.entity.PerformanceDataBuilder; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,10 +74,10 @@ public class PmDataBuilderOpenRoadm { // Build PM entity for writing into the database public List buildPmDataEntity(HistoricalPmList historicalPmEnitityList) { List pmEntitiyList = new ArrayList<>(); - List pmDataEntryList = historicalPmEnitityList.getHistoricalPmEntry(); + Collection pmDataEntryList = YangHelper.getCollection(historicalPmEnitityList.getHistoricalPmEntry()); for (HistoricalPmEntry pmDataEntry : pmDataEntryList) { pmDataBuilder.setUuidInterface(pmDataEntry.getPmResourceType().getName()); - List historicalPmList = pmDataEntry.getHistoricalPm(); + Collection historicalPmList = YangHelper.getCollection(pmDataEntry.getHistoricalPm()); for (HistoricalPm historicalPm : historicalPmList) { log.info("PmName:{}", historicalPm.getType()); this.pmDataBuilder.setScannerId(historicalPm.getType().getName()); @@ -92,7 +95,7 @@ public class PmDataBuilderOpenRoadm { // private methods private void writeperformanceData(HistoricalPm historicalPm) { - List measurementList = historicalPm.getMeasurement(); + Collection measurementList = YangHelper.getCollection(historicalPm.getMeasurement()); for (Measurement measurementData : measurementList) { this.pmDataBuilder.setGranularityPeriod(mapGranularityPeriod(measurementData.getGranularity())) @@ -110,7 +113,7 @@ public class PmDataBuilderOpenRoadm { private PerformanceData getPerformancedata(Measurement measurementData) { PerformanceData performanceData; PerformanceDataBuilder performanceDataBuilder = new PerformanceDataBuilder(); - performanceData = performanceDataBuilder.setCses(measurementData.getBinNumber()) + performanceData = performanceDataBuilder.setCses(YangHelper2.getInteger(measurementData.getBinNumber())) .setSes(measurementData.getPmParameterValue().getUint64().intValue()).build(); return performanceData; } diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java index c79ed698f..caf631416 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java @@ -34,8 +34,8 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.re import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfConfigChange; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.Edit; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.EditBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElement.java b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElement.java index 34d61da12..ce03a9385 100644 --- a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElement.java +++ b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElement.java @@ -72,7 +72,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev191129. import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -- cgit 1.2.3-korg