summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-oran/provider/src/main
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2021-02-03 15:43:35 +0100
committerDan Timoney <dtimoney@att.com>2021-02-05 22:57:46 +0000
commit95cae7ce9aa09198bd46eee556da468a57657017 (patch)
treefe95f6851f106cafc19dc396bd1d307840828662 /sdnr/wt/devicemanager-oran/provider/src/main
parentece5215df091114be3bffee073c8d3b0bc1ee1bc (diff)
Migrate devicemanager-oran mountpoint-registrar and mountpoint-state-provider
Migrate devicemanager-oran mountpoint-registrar and mountpoint-state-provider to Aluminium Issue-ID: CCSDK-3135 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Change-Id: I6f9ebcf9b41157e04f6a82cbdc01cd1a32331cf6 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-oran/provider/src/main')
-rw-r--r--sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/DeviceManagerORanImpl.java2
-rw-r--r--sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanChangeNotificationListener.java6
-rw-r--r--sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElement.java49
-rw-r--r--sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElementFactory.java11
-rw-r--r--sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNotifToVESEventAssembly.java6
-rw-r--r--sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanToInternalDataModel.java2
6 files changed, 44 insertions, 32 deletions
diff --git a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/DeviceManagerORanImpl.java b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/DeviceManagerORanImpl.java
index 8d9a215e2..87157e8ce 100644
--- a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/DeviceManagerORanImpl.java
+++ b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/DeviceManagerORanImpl.java
@@ -51,7 +51,7 @@ public class DeviceManagerORanImpl implements AutoCloseable {
LOG.info("Session Initiated start {}", APPLICATION_NAME);
- resORan = netconfNetworkElementService.registerNetworkElementFactory(new ORanNetworkElementFactory());
+ resORan = netconfNetworkElementService.registerBindingNetworkElementFactory(new ORanNetworkElementFactory());
netconfNetworkElementService.writeToEventLog(APPLICATION_NAME, "startup", "done");
diff --git a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanChangeNotificationListener.java b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanChangeNotificationListener.java
index 75b4bf50b..baa86b4c7 100644
--- a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanChangeNotificationListener.java
+++ b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanChangeNotificationListener.java
@@ -22,7 +22,7 @@ import java.util.HashMap;
import java.util.List;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorService;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.IetfNetconfNotificationsListener;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfCapabilityChange;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfConfigChange;
@@ -43,13 +43,13 @@ public class ORanChangeNotificationListener implements IetfNetconfNotificationsL
private static final Logger log = LoggerFactory.getLogger(ORanChangeNotificationListener.class);
- private final NetconfAccessor netconfAccessor;
+ private final NetconfBindingAccessor netconfAccessor;
private final DataProvider databaseService;
private final VESCollectorService vesCollectorService;
private static int sequenceNo = 0;
- public ORanChangeNotificationListener(NetconfAccessor netconfAccessor, DataProvider databaseService, VESCollectorService vesCollectorService) {
+ public ORanChangeNotificationListener(NetconfBindingAccessor netconfAccessor, DataProvider databaseService, VESCollectorService vesCollectorService) {
this.netconfAccessor = netconfAccessor;
this.databaseService = databaseService;
this.vesCollectorService = vesCollectorService;
diff --git a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElement.java b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElement.java
index 3f69e1886..59d51e199 100644
--- a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElement.java
+++ b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElement.java
@@ -26,18 +26,16 @@ 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;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorService;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNotifications;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.Netconf;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.hardware.rev180313.Hardware;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.hardware.rev180313.hardware.Component;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.opendaylight.yang.gen.v1.urn.onap.system.rev201026.System1;
-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.GuicutthroughBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementDeviceType;
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;
@@ -51,10 +49,11 @@ public class ORanNetworkElement implements NetworkElement {
private static final Logger log = LoggerFactory.getLogger(ORanNetworkElement.class);
- private final NetconfAccessor netconfAccessor;
+ private final NetconfBindingAccessor netconfAccessor;
private final DataProvider databaseService;
+ @SuppressWarnings("unused")
private final VESCollectorService vesCollectorService;
private final ORanToInternalDataModel oRanMapper;
@@ -64,7 +63,7 @@ public class ORanNetworkElement implements NetworkElement {
private ListenerRegistration<NotificationListener> oRanFaultListenerRegistrationResult;
private @NonNull final ORanFaultNotificationListener oRanFaultListener;
- ORanNetworkElement(NetconfAccessor netconfAccess, DataProvider databaseService,
+ ORanNetworkElement(NetconfBindingAccessor netconfAccess, DataProvider databaseService,
VESCollectorService vesCollectorService) {
log.info("Create {}", ORanNetworkElement.class.getSimpleName());
this.netconfAccessor = netconfAccess;
@@ -105,17 +104,18 @@ public class ORanNetworkElement implements NetworkElement {
return NetworkElementDeviceType.ORAN;
}
- private System1 getOnapSystemData(NetconfAccessor accessData) {
- InstanceIdentifier<System1> system1IID =
- InstanceIdentifier.builder(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev140806.System.class)
- .augmentation(System1.class).build();
+ private System1 getOnapSystemData(NetconfBindingAccessor accessData) {
+ InstanceIdentifier<System1> system1IID = InstanceIdentifier
+ .builder(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev140806.System.class)
+ .augmentation(System1.class).build();
- System1 res = accessData.getTransactionUtils().readData(accessData.getDataBroker(), LogicalDatastoreType.OPERATIONAL, system1IID);
+ System1 res = accessData.getTransactionUtils().readData(accessData.getDataBroker(),
+ LogicalDatastoreType.OPERATIONAL, system1IID);
log.debug("Result of getOnapSystemData = {}", res);
return res;
}
- private Hardware readHardware(NetconfAccessor accessData) {
+ private Hardware readHardware(NetconfBindingAccessor accessData) {
final Class<Hardware> clazzPac = Hardware.class;
@@ -135,15 +135,20 @@ public class ORanNetworkElement implements NetworkElement {
initialReadFromNetworkElement();
// Register call back class for receiving notifications
- this.oRanListenerRegistrationResult = netconfAccessor.doRegisterNotificationListener(oRanListener);
- this.oRanFaultListenerRegistrationResult = netconfAccessor.doRegisterNotificationListener(oRanFaultListener);
- // Register notifications stream
- if (netconfAccessor.isNCNotificationsSupported()) {
- List<Stream> streamList = netconfAccessor.getNotificationStreams();
- netconfAccessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream); // Always register first to default stream
- netconfAccessor.registerNotificationsStream(streamList);
- } else {
- netconfAccessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream);
+ Optional<NetconfNotifications> oNotifications = netconfAccessor.getNotificationAccessor();
+ if (oNotifications.isPresent()) {
+ NetconfNotifications notifications = oNotifications.get();
+ this.oRanListenerRegistrationResult = netconfAccessor.doRegisterNotificationListener(oRanListener);
+ this.oRanFaultListenerRegistrationResult =
+ netconfAccessor.doRegisterNotificationListener(oRanFaultListener);
+ // Register notifications stream
+ if (notifications.isNCNotificationsSupported()) {
+ List<Stream> streamList = notifications.getNotificationStreams();
+ notifications.registerNotificationsStream(NetconfBindingAccessor.DefaultNotificationsStream); // Always register first to default stream
+ notifications.registerNotificationsStream(streamList);
+ } else {
+ notifications.registerNotificationsStream(NetconfBindingAccessor.DefaultNotificationsStream);
+ }
}
}
diff --git a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElementFactory.java b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElementFactory.java
index 3e5171c0f..55b2eea34 100644
--- a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElementFactory.java
+++ b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNetworkElementFactory.java
@@ -26,6 +26,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.opendaylight.yang.gen.v1.urn.o.ran.hardware._1._0.rev190328.ORANHWCOMPONENT;
import org.opendaylight.yangtools.yang.common.QName;
import org.slf4j.Logger;
@@ -39,12 +40,16 @@ public class ORanNetworkElementFactory implements NetworkElementFactory {
QName.create("urn:onf:otcc:wireless:yang:radio-access:commscope-onecell", "2020-06-22", "onecell").intern();
@Override
- public Optional<NetworkElement> create(NetconfAccessor acessor, DeviceManagerServiceProvider serviceProvider) {
- Capabilities capabilites = acessor.getCapabilites();
+ public Optional<NetworkElement> create(NetconfAccessor accessor, DeviceManagerServiceProvider serviceProvider) {
+ Capabilities capabilites = accessor.getCapabilites();
if (!capabilites.isSupportingNamespace(OneCell)) {
if (capabilites.isSupportingNamespace(ORANHWCOMPONENT.QNAME)) {
log.info("Create device {} ", ORanNetworkElement.class.getName());
- return Optional.of(new ORanNetworkElement(acessor, serviceProvider.getDataProvider(), serviceProvider.getVESCollectorService()));
+ Optional<NetconfBindingAccessor> bindingAccessor = accessor.getNetconfBindingAccessor();
+ if (bindingAccessor.isPresent()) {
+ return Optional.of(new ORanNetworkElement(bindingAccessor.get(), serviceProvider.getDataProvider(),
+ serviceProvider.getVESCollectorService()));
+ }
}
}
return Optional.empty();
diff --git a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNotifToVESEventAssembly.java b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNotifToVESEventAssembly.java
index 2cb15c575..b7506e50c 100644
--- a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNotifToVESEventAssembly.java
+++ b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanNotifToVESEventAssembly.java
@@ -32,7 +32,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorService
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.VESCommonEventHeaderPOJO;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.VESEvent;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.VESNotificationFieldsPOJO;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,10 +43,10 @@ public class ORanNotifToVESEventAssembly {
private static final String VES_EVENT_DOMAIN = "notification";
private static final String VES_EVENTTYPE = "ORAN_notification";
private static final String VES_EVENT_PRIORITY = "Normal";
- private NetconfAccessor netconfAccessor;
+ private NetconfBindingAccessor netconfAccessor;
private VESCollectorService vesProvider;
- public ORanNotifToVESEventAssembly(NetconfAccessor netconfAccessor, VESCollectorService vesProvider) {
+ public ORanNotifToVESEventAssembly(NetconfBindingAccessor netconfAccessor, VESCollectorService vesProvider) {
this.netconfAccessor = netconfAccessor;
this.vesProvider = vesProvider;
}
diff --git a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanToInternalDataModel.java b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanToInternalDataModel.java
index 454cb278b..c563cc491 100644
--- a/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanToInternalDataModel.java
+++ b/sdnr/wt/devicemanager-oran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/ORanToInternalDataModel.java
@@ -23,6 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.hardware.re
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.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
* @author herbert
@@ -39,6 +40,7 @@ public class ORanToInternalDataModel {
inventoryBuilder.setNodeId(nodeId.getValue());
inventoryBuilder.setParentUuid(component.getParent());
inventoryBuilder.setTreeLevel(new Long(component.getParentRelPos()));
+ inventoryBuilder.setTreeLevel(Uint32.valueOf(component.getParentRelPos().intValue()));
inventoryBuilder.setUuid(component.getUuid().getValue());
// -- String list with ids of holders