diff --git a/sdnr/wt/devicemanager-onf14/feature/pom.xml b/sdnr/wt/devicemanager-onf14/feature/pom.xml
index c826fe9..0a75a6e 100644
--- a/sdnr/wt/devicemanager-onf14/feature/pom.xml
+++ b/sdnr/wt/devicemanager-onf14/feature/pom.xml
@@ -29,7 +29,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
diff --git a/sdnr/wt/devicemanager-onf14/installer/pom.xml b/sdnr/wt/devicemanager-onf14/installer/pom.xml
index a199f8d..ad906ab 100755
--- a/sdnr/wt/devicemanager-onf14/installer/pom.xml
+++ b/sdnr/wt/devicemanager-onf14/installer/pom.xml
@@ -29,7 +29,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
diff --git a/sdnr/wt/devicemanager-onf14/model/pom.xml b/sdnr/wt/devicemanager-onf14/model/pom.xml
index 4a9cba8..7a0593d 100644
--- a/sdnr/wt/devicemanager-onf14/model/pom.xml
+++ b/sdnr/wt/devicemanager-onf14/model/pom.xml
@@ -29,7 +29,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
diff --git a/sdnr/wt/devicemanager-onf14/pom.xml b/sdnr/wt/devicemanager-onf14/pom.xml
index 7b2801a..7dbffe3 100755
--- a/sdnr/wt/devicemanager-onf14/pom.xml
+++ b/sdnr/wt/devicemanager-onf14/pom.xml
@@ -29,7 +29,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
diff --git a/sdnr/wt/devicemanager-onf14/provider/pom.xml b/sdnr/wt/devicemanager-onf14/provider/pom.xml
index 749011b..c79dccf 100644
--- a/sdnr/wt/devicemanager-onf14/provider/pom.xml
+++ b/sdnr/wt/devicemanager-onf14/provider/pom.xml
@@ -29,7 +29,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -47,7 +47,6 @@
     </licenses>
 
     <properties>
-        <checkstyle.skip>true</checkstyle.skip> <!-- POM configuration -->
         <maven.javadoc.skip>true</maven.javadoc.skip>
         <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
         <buildtime>${maven.build.timestamp} UTC</buildtime>
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/DeviceManagerOnf14Impl.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/DeviceManagerOnf14Impl.java
index df34ce5..5c57054 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/DeviceManagerOnf14Impl.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/DeviceManagerOnf14Impl.java
@@ -51,7 +51,7 @@
 
         LOG.info("Session Initiated start {}", APPLICATION_NAME);
 
-        resOnf = netconfNetworkElementService.registerNetworkElementFactory(new Onf14NetworkElementFactory());
+        resOnf = netconfNetworkElementService.registerBindingNetworkElementFactory(new Onf14NetworkElementFactory());
 
 
         netconfNetworkElementService.writeToEventLog(APPLICATION_NAME, "startup", "done");
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14AirInterface.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14AirInterface.java
deleted file mode 100644
index ca00ae8..0000000
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14AirInterface.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2020 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==========================================================================
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
-
-import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPE;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPECRITICAL;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPEMAJOR;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPEMINOR;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPENONALARMED;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPEWARNING;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author alexs
- *
- */
-public class Onf14AirInterface {
-
-    private static final Logger log = LoggerFactory.getLogger(Onf14AirInterface.class);
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType mapSeverity(
-            Class<? extends SEVERITYTYPE> severity) {
-
-        if (severity != null) {
-            if (severity.getTypeName() == SEVERITYTYPECRITICAL.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Critical;
-            } else if (severity.getTypeName() == SEVERITYTYPEMAJOR.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Major;
-            } else if (severity.getTypeName() == SEVERITYTYPEMINOR.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Minor;
-            } else if (severity.getTypeName() == SEVERITYTYPEWARNING.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Warning;
-            } else if (severity.getTypeName() == SEVERITYTYPENONALARMED.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.NonAlarmed;
-            }
-        }
-
-        return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.NonAlarmed;
-    }
-
-
-}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14DomNetworkElement.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14DomNetworkElement.java
new file mode 100644
index 0000000..0a63b74
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14DomNetworkElement.java
@@ -0,0 +1,209 @@
+/*
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 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==========================================================================
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
+
+import java.util.Optional;
+import org.eclipse.jdt.annotation.NonNull;
+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.onf14.impl.dataprovider.Onf14ToInternalDataModel;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.equipment.Onf14DomEquipmentManager;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14DomInterfacePacManager;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
+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.NetconfDomAccessor;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.ControlConstruct;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.UniversalId;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.control.construct.Equipment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionBuilder;
+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.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Representation of ONF Core model 1.4 device Top level element is "ControlConstruct" (replaces "NetworkElement" of
+ * older ONF Version)
+ * NOTE: This class is still under development due to unmet dependencies (especially the ones related to DOM notifications) in ODL. Once the dependencies are complete, this class will replace the ONF14NetworkElement   
+ */
+public class Onf14DomNetworkElement implements NetworkElement {
+
+    private static final Logger log = LoggerFactory.getLogger(Onf14DomNetworkElement.class);
+
+    //    protected static final InstanceIdentifier<ControlConstruct> CONTROLCONSTRUCT_IID =
+    //            InstanceIdentifier.builder(ControlConstruct.class).build();
+    protected static final YangInstanceIdentifier CONTROLCONSTRUCT_IID =
+            YangInstanceIdentifier.builder().node(ControlConstruct.QNAME).build();
+
+    private final NetconfDomAccessor netconfDomAccessor;
+    private final DataProvider databaseService;
+    private final @NonNull FaultService faultService;
+    private final @NonNull NotificationService notificationService;
+
+    private final Onf14ToInternalDataModel onf14Mapper;
+
+    private final @NonNull Onf14DomEquipmentManager equipmentManager;
+    private final @NonNull Onf14DomInterfacePacManager interfacePacManager;
+
+
+    public Onf14DomNetworkElement(NetconfDomAccessor netconfDomAccessor, DeviceManagerServiceProvider serviceProvider) {
+        log.info("Create {}", Onf14DomNetworkElement.class.getSimpleName());
+        this.netconfDomAccessor = netconfDomAccessor;
+        this.databaseService = serviceProvider.getDataProvider();
+        this.notificationService = serviceProvider.getNotificationService();
+        this.faultService = serviceProvider.getFaultService();
+        this.onf14Mapper = new Onf14ToInternalDataModel();
+        this.equipmentManager = new Onf14DomEquipmentManager(netconfDomAccessor, databaseService, onf14Mapper);
+        this.interfacePacManager = new Onf14DomInterfacePacManager(netconfDomAccessor, serviceProvider);
+    }
+
+    /**
+     * reading the inventory (CoreModel 1.4 Equipment Model) and adding it to the DB
+     */
+    public void initialReadFromNetworkElement() {
+
+        //Read complete device tree
+        Optional<ControlConstruct> oControlConstruct = readControlConstruct(netconfDomAccessor);
+
+        if (oControlConstruct.isPresent()) {
+            ControlConstruct controlConstruct = oControlConstruct.get();
+
+            equipmentManager.setEquipmentData(controlConstruct);
+
+            //-- Start For test purpose
+            for (UniversalId uuid : equipmentManager.getEquipmentUuidList()) {
+                log.info("Read data with id {}", uuid);
+                Optional<Equipment> res1 = equipmentManager.readEquipmentInstance(netconfDomAccessor, uuid);
+                log.info("Res1: {}", res1.isPresent() ? res1.get() : "No data1");
+
+                Optional<ControlConstruct> res2 = equipmentManager.readEquipmentList(netconfDomAccessor, uuid);
+                log.info("Res2: {}", res2.isPresent() ? res2.get() : "No data2");
+
+                equipmentManager.readTopLevelEquipment(netconfDomAccessor);
+                //Do it only once for test purpose
+                break;
+            }
+            //-- End For test purpose
+
+            // storing all the LTP UUIDs internally, for later usage, for air-interface and ethernet-container
+            interfacePacManager.readKeys(controlConstruct);
+
+            // Read all fault data
+            FaultData resultList = new FaultData();
+
+            int problems = faultService.removeAllCurrentProblemsOfNode(netconfDomAccessor.getNodeId());
+            log.debug("Removed all {} problems from database at registration", problems);
+
+            interfacePacManager.readAllAirInterfaceCurrentProblems(netconfDomAccessor, controlConstruct, resultList);
+            problems = resultList.size();
+            log.debug("NETCONF read air interface current problems completed. Got back {} problems.", problems);
+            /*
+            readAllEhernetContainerCurrentProblems(resultList);
+            problems = resultList.size() - problems;
+            log.debug("NETCONF read current problems completed. Got back {} problems.", resultList.size());
+
+            readAllWireInterfaceCurrentProblems(resultList);
+            problems = resultList.size();
+            log.debug("NETCONF read wire interface current problems completed. Got back {} problems.", problems);
+            */
+            faultService.initCurrentProblemStatus(netconfDomAccessor.getNodeId(), resultList);
+            log.debug("DB write current problems completed");
+        }
+    }
+
+    /**
+     * @param nNode set core-model-capability
+     */
+    public void setCoreModel(@NonNull NetconfNode nNode) {
+        NetworkElementConnectionBuilder eb = new NetworkElementConnectionBuilder();
+        String namespaceRevision;
+        QName QNAME_COREMODEL14 = QName.create("urn:onf:yang:core-model-1-4", "2019-11-27", "core-model-1-4").intern();
+
+        Capabilities availableCapabilities = Capabilities.getAvailableCapabilities(nNode);
+        namespaceRevision = availableCapabilities.getRevisionForNamespace(QNAME_COREMODEL14);
+
+        if (Capabilities.isNamespaceSupported(namespaceRevision)) {
+            eb.setCoreModelCapability(namespaceRevision);
+        } else {
+            eb.setCoreModelCapability("Unsupported");
+        }
+        databaseService.updateNetworkConnection22(eb.build(), netconfDomAccessor.getNodeId().getValue());
+    }
+
+    @Override
+    public void register() {
+        // Set core-model revision value in "core-model-capability" field
+        setCoreModel(netconfDomAccessor.getNetconfNode());
+        initialReadFromNetworkElement();
+
+        // Register netconf stream
+        //        airInterfaceNotificationListenerHandler =
+        //                netconfDomAccessor.doRegisterNotificationListener(airInterfaceNotificationListener);
+        //        etherneContainerNotificationListenerHandler =
+        //                netconfDomAccessor.doRegisterNotificationListener(ethernetContainerNotificationListener);
+        //        wireInterfaceNotificationListenerHandler =
+        //                netconfDomAccessor.doRegisterNotificationListener(wireInterfaceNotificationListener);
+        //        Optional<NetconfNotifications> notificationsSupport = netconfDomAccessor.getNotificationAccessor();
+        //        if (notificationsSupport.isPresent()) {
+        //            notificationsSupport.get().registerNotificationsStream(NetconfBindingAccessor.DefaultNotificationsStream);
+        //        }
+    }
+
+    @Override
+    public void deregister() {}
+
+
+    @Override
+    public NodeId getNodeId() {
+        return netconfDomAccessor.getNodeId();
+    }
+
+    @Override
+    public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) {
+        return Optional.empty();
+    }
+
+    @Override
+    public void warmstart() {}
+
+    @Override
+    public Optional<NetconfAccessor> getAcessor() {
+        return Optional.of(netconfDomAccessor);
+    }
+
+    @Override
+    public NetworkElementDeviceType getDeviceType() {
+        return NetworkElementDeviceType.Wireless;
+    }
+
+    private static Optional<ControlConstruct> readControlConstruct(NetconfDomAccessor netconfDomAccessor) {
+        return netconfDomAccessor.readData(LogicalDatastoreType.CONFIGURATION, CONTROLCONSTRUCT_IID, ControlConstruct.class);
+    }
+
+
+
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14EthernetContainer.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14EthernetContainer.java
deleted file mode 100644
index 27d61be..0000000
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14EthernetContainer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2020 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==========================================================================
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
-
-import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.SEVERITYTYPE;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.SEVERITYTYPECRITICAL;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.SEVERITYTYPEMAJOR;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.SEVERITYTYPEMINOR;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.SEVERITYTYPENONALARMED;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.SEVERITYTYPEWARNING;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author alexs
- *
- */
-public class Onf14EthernetContainer {
-
-    private static final Logger log = LoggerFactory.getLogger(Onf14EthernetContainer.class);
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType mapSeverity(
-            Class<? extends SEVERITYTYPE> severity) {
-
-        if (severity != null) {
-            if (severity.getTypeName() == SEVERITYTYPECRITICAL.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Critical;
-            } else if (severity.getTypeName() == SEVERITYTYPEMAJOR.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Major;
-            } else if (severity.getTypeName() == SEVERITYTYPEMINOR.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Minor;
-            } else if (severity.getTypeName() == SEVERITYTYPEWARNING.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Warning;
-            } else if (severity.getTypeName() == SEVERITYTYPENONALARMED.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.NonAlarmed;
-            }
-        }
-
-        return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.NonAlarmed;
-    }
-
-
-}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElement.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElement.java
index d2db231..a5599be 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElement.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElement.java
@@ -27,11 +27,20 @@
 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.onf14.impl.dataprovider.Onf14ToInternalDataModel;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14AirInterface;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14AirInterfaceNotificationListener;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14EthernetContainer;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14EthernetContainerNotificationListener;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14WireInterface;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14WireInterfaceNotificationListener;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
 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.onf.yang.air._interface._2._0.rev200121.LAYERPROTOCOLNAMETYPEAIRLAYER;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.air._interface.lp.spec.AirInterfacePac;
@@ -76,7 +85,7 @@
 
     private static final int EQUIPMENTROOTLEVEL = 0;
 
-    private final NetconfAccessor netconfAccessor;
+    private final NetconfBindingAccessor netconfAccessor;
     private final DataProvider databaseService;
     private final Onf14ToInternalDataModel onf14Mapper;
     private final @NonNull FaultService faultService;
@@ -86,27 +95,30 @@
 
     // air interface related members
     private final List<TechnologySpecificPacKeys> airInterfaceList = new ArrayList<TechnologySpecificPacKeys>();
+    @SuppressWarnings("unused")
     private ListenerRegistration<NotificationListener> airInterfaceNotificationListenerHandler;
     private @NonNull final Onf14AirInterfaceNotificationListener airInterfaceNotificationListener;
 
     // ethernet container related members
     private final List<TechnologySpecificPacKeys> ethernetContainerList = new ArrayList<TechnologySpecificPacKeys>();
+    @SuppressWarnings("unused")
     private ListenerRegistration<NotificationListener> etherneContainerNotificationListenerHandler;
     private @NonNull final Onf14EthernetContainerNotificationListener ethernetContainerNotificationListener;
 
     // wire interface related members
     private final List<TechnologySpecificPacKeys> wireInterfaceList = new ArrayList<TechnologySpecificPacKeys>();
+    @SuppressWarnings("unused")
     private ListenerRegistration<NotificationListener> wireInterfaceNotificationListenerHandler;
     private @NonNull final Onf14WireInterfaceNotificationListener wireInterfaceNotificationListener;
 
-    Onf14NetworkElement(NetconfAccessor netconfAccess, DeviceManagerServiceProvider serviceProvider) {
+    Onf14NetworkElement(NetconfBindingAccessor netconfAccess, DeviceManagerServiceProvider serviceProvider) {
         log.info("Create {}", Onf14NetworkElement.class.getSimpleName());
         this.netconfAccessor = netconfAccess;
         this.databaseService = serviceProvider.getDataProvider();
         this.faultService = serviceProvider.getFaultService();
         this.onf14Mapper = new Onf14ToInternalDataModel();
         this.airInterfaceNotificationListenerHandler = null;
-        airInterfaceNotificationListener = new Onf14AirInterfaceNotificationListener(netconfAccess, serviceProvider);
+        this.airInterfaceNotificationListener = new Onf14AirInterfaceNotificationListener(netconfAccess, serviceProvider);
         this.etherneContainerNotificationListenerHandler = null;
         ethernetContainerNotificationListener =
                 new Onf14EthernetContainerNotificationListener(netconfAccess, serviceProvider);
@@ -211,7 +223,10 @@
                 netconfAccessor.doRegisterNotificationListener(ethernetContainerNotificationListener);
         wireInterfaceNotificationListenerHandler =
                 netconfAccessor.doRegisterNotificationListener(wireInterfaceNotificationListener);
-        netconfAccessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream);
+        Optional<NetconfNotifications> notificationsSupport = netconfAccessor.getNotificationAccessor();
+        if (notificationsSupport.isPresent()) {
+            notificationsSupport.get().registerNotificationsStream(NetconfBindingAccessor.DefaultNotificationsStream);
+        }
     }
 
     @Override
@@ -459,12 +474,12 @@
         }
     }
 
-    private Optional<ControlConstruct> readControlConstruct(NetconfAccessor netconfAccessor) {
+    private Optional<ControlConstruct> readControlConstruct(NetconfBindingAccessor netconfAccessor) {
         return Optional.ofNullable(netconfAccessor.getTransactionUtils().readData(netconfAccessor.getDataBroker(),
                 LogicalDatastoreType.CONFIGURATION, CONTROLCONSTRUCT_IID));
     }
 
-    private @Nullable Equipment readEquipmentInstance(NetconfAccessor accessData, UniversalId equipmentUuid) {
+    private @Nullable Equipment readEquipmentInstance(NetconfBindingAccessor accessData, UniversalId equipmentUuid) {
 
         final Class<?> clazzPac = Equipment.class;
 
@@ -497,10 +512,12 @@
             return localId;
         }
 
+        @SuppressWarnings("unused")
         public void setLtpUuid(UniversalId uuid) {
             this.ltpUuid = uuid;
         }
 
+        @SuppressWarnings("unused")
         public void setLocalId(String lId) {
             this.localId = lId;
         }
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElementFactory.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElementFactory.java
index 5505cec..5141002 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElementFactory.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElementFactory.java
@@ -23,21 +23,25 @@
 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.NetconfAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.ControlConstruct;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class Onf14NetworkElementFactory implements NetworkElementFactory {
 
-    private static final Logger log = LoggerFactory.getLogger(Onf14NetworkElementFactory.class);
+	private static final Logger log = LoggerFactory.getLogger(Onf14NetworkElementFactory.class);
 
-    @Override
-    public Optional<NetworkElement> create(NetconfAccessor acessor, DeviceManagerServiceProvider serviceProvider) {
-        if (acessor.getCapabilites().isSupportingNamespace(ControlConstruct.QNAME)) {
-            log.info("Create device {} ", Onf14NetworkElement.class.getName());
-            return Optional.of(new Onf14NetworkElement(acessor, serviceProvider));
-        } else {
-            return Optional.empty();
-        }
-    }
+	@Override
+	public Optional<NetworkElement> create(NetconfAccessor accessor, DeviceManagerServiceProvider serviceProvider) {
+		if (accessor.getCapabilites().isSupportingNamespace(ControlConstruct.QNAME)) {
+			log.info("Create device {} ", Onf14NetworkElement.class.getName());
+			Optional<NetconfBindingAccessor> bindingAccessor = accessor.getNetconfBindingAccessor();
+			if (bindingAccessor.isPresent()) {
+				return Optional.of(new Onf14NetworkElement(bindingAccessor.get(), serviceProvider));
+			}
+		}
+		return Optional.empty();
+
+	}
 }
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14WireInterface.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14WireInterface.java
deleted file mode 100644
index 4446c20..0000000
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14WireInterface.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2020 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==========================================================================
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
-
-import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPE;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPECRITICAL;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEMAJOR;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEMINOR;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPENONALARMED;
-import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEWARNING;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author alexs
- *
- */
-public class Onf14WireInterface {
-
-    private static final Logger log = LoggerFactory.getLogger(Onf14WireInterface.class);
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType mapSeverity(
-            Class<? extends SEVERITYTYPE> severity) {
-
-        if (severity != null) {
-            if (severity.getTypeName() == SEVERITYTYPECRITICAL.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Critical;
-            } else if (severity.getTypeName() == SEVERITYTYPEMAJOR.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Major;
-            } else if (severity.getTypeName() == SEVERITYTYPEMINOR.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Minor;
-            } else if (severity.getTypeName() == SEVERITYTYPEWARNING.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.Warning;
-            } else if (severity.getTypeName() == SEVERITYTYPENONALARMED.class.getName()) {
-                return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.NonAlarmed;
-            }
-        }
-
-        return org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType.NonAlarmed;
-    }
-
-
-}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/dataprovider/InternalDataModelSeverity.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/dataprovider/InternalDataModelSeverity.java
new file mode 100644
index 0000000..97395f4
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/dataprovider/InternalDataModelSeverity.java
@@ -0,0 +1,55 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.dataprovider;
+
+import java.util.Map;
+import org.eclipse.jdt.annotation.Nullable;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPECRITICAL;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEMAJOR;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEMINOR;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEWARNING;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
+import org.opendaylight.yangtools.yang.binding.BaseIdentity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class InternalDataModelSeverity {
+
+    @SuppressWarnings("unused")
+    private static final Logger LOG = LoggerFactory.getLogger(InternalDataModelSeverity.class);
+
+    private static final Map<String, SeverityType> SEVERITYMAP = Map.of(
+            SEVERITYTYPEMAJOR.class.getSimpleName(), SeverityType.Major,
+            SEVERITYTYPECRITICAL.class.getSimpleName(), SeverityType.Critical,
+            SEVERITYTYPEMINOR.class.getSimpleName(), SeverityType.Minor,
+            SEVERITYTYPEWARNING.class.getSimpleName(), SeverityType.Warning);
+
+    public static SeverityType mapSeverity(@Nullable Class<? extends BaseIdentity> severity) {
+        SeverityType res = null;
+        if (severity != null) {
+            String severityName = severity.getSimpleName();
+            res = severityName != null ? SEVERITYMAP.get(severity.getSimpleName()) : null;
+        }
+        return res == null ? SeverityType.NonAlarmed : res;
+    }
+
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14ToInternalDataModel.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/dataprovider/Onf14ToInternalDataModel.java
similarity index 91%
rename from sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14ToInternalDataModel.java
rename to sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/dataprovider/Onf14ToInternalDataModel.java
index 52b159c..36eaf2f 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14ToInternalDataModel.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/dataprovider/Onf14ToInternalDataModel.java
@@ -15,7 +15,7 @@
  * the License.
  * ============LICENSE_END==========================================================================
  */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.dataprovider;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -34,6 +34,7 @@
 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;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,7 +44,7 @@
  */
 public class Onf14ToInternalDataModel {
 
-    private static final Logger log = LoggerFactory.getLogger(Onf14ToInternalDataModel.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Onf14ToInternalDataModel.class);
 
     public Inventory getInternalEquipment(NodeId nodeId, Equipment currentEq, Equipment parentEq, long treeLevel) {
 
@@ -56,7 +57,7 @@
             // General
             inventoryBuilder.setNodeId(nodeId.getValue());
 
-            inventoryBuilder.setTreeLevel(treeLevel);
+            inventoryBuilder.setTreeLevel(Uint32.valueOf(treeLevel));
             inventoryBuilder.setUuid(currentEq.getUuid().getValue());
 
             if (parentEq != null) {
@@ -88,7 +89,7 @@
                     inventoryBuilder.setManufacturerName(manProp.getManufacturerName());
                     inventoryBuilder.setManufacturerIdentifier(manProp.getManufacturerIdentifier());
                 } else {
-                    log.debug("manufacturer-properties is not present in Equipment with uuid={}",
+                    LOG.debug("manufacturer-properties is not present in Equipment with uuid={}",
                             currentEq.getUuid().getValue());
                 }
 
@@ -99,7 +100,7 @@
                     inventoryBuilder.setSerial(eqInstance.getSerialNumber());
                     inventoryBuilder.setDate(eqInstance.getManufactureDate().getValue());
                 } else {
-                    log.debug("equipment-instance is not present in Equipment with uuid={}",
+                    LOG.debug("equipment-instance is not present in Equipment with uuid={}",
                             currentEq.getUuid().getValue());
                 }
 
@@ -113,15 +114,15 @@
                     inventoryBuilder.setModelIdentifier(eqType.getModelIdentifier());
                     inventoryBuilder.setTypeName(eqType.getTypeName());
                 } else {
-                    log.debug("equipment-type is not present in Equipment with uuid={}",
+                    LOG.debug("equipment-type is not present in Equipment with uuid={}",
                             currentEq.getUuid().getValue());
                 }
             } else {
-                log.debug("manufactured-thing is not present in Equipment with uuid={}",
+                LOG.debug("manufactured-thing is not present in Equipment with uuid={}",
                         currentEq.getUuid().getValue());
             }
         } else {
-            log.debug("actual-equipment is not present in Equipment with uuid={}", currentEq.getUuid().getValue());
+            LOG.debug("actual-equipment is not present in Equipment with uuid={}", currentEq.getUuid().getValue());
         }
 
         return inventoryBuilder.build();
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/equipment/Onf14DomEquipmentManager.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/equipment/Onf14DomEquipmentManager.java
new file mode 100644
index 0000000..72ffdf6
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/equipment/Onf14DomEquipmentManager.java
@@ -0,0 +1,231 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.equipment;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+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.onf14.impl.dataprovider.Onf14ToInternalDataModel;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.ControlConstruct;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.UniversalId;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.control.construct.Equipment;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.control.construct.EquipmentKey;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.equipment.ContainedHolder;
+import org.opendaylight.yangtools.util.UnmodifiableCollection;
+import org.opendaylight.yangtools.yang.binding.CodeHelpers;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
+import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Onf14DomEquipmentManager {
+
+
+    // constants
+    private static final Logger log = LoggerFactory.getLogger(Onf14DomEquipmentManager.class);
+    private static final int EQUIPMENTROOTLEVEL = 0;
+    // end of constants
+
+    // variables
+    private final NetconfDomAccessor netconfDomAccessor;
+    private final DataProvider databaseService;
+    private final Onf14ToInternalDataModel onf14Mapper;
+    // for storing the Equipment UUIDs that are inserted in the DB
+    private final List<UniversalId> equipmentUuidList = new ArrayList<>();
+    // end of variables
+
+    // constructors
+    public Onf14DomEquipmentManager(NetconfDomAccessor netconfDomAccessor, DataProvider databaseService,
+            Onf14ToInternalDataModel onf14Mapper) {
+        super();
+        this.netconfDomAccessor = Objects.requireNonNull(netconfDomAccessor);
+        this.databaseService = Objects.requireNonNull(databaseService);
+        this.onf14Mapper = Objects.requireNonNull(onf14Mapper);
+    }
+    // end of constructors
+
+    // getters and setters
+    public List<UniversalId> getEquipmentUuidList() {
+        return equipmentUuidList;
+    }
+    // end of getters and setters
+
+    // private methods
+    private void addEquipmentToDb(Equipment currentEq, Equipment parentEq, long treeLevel,
+            Map<EquipmentKey, Equipment> equipmentMap, EquipmentKey equipmentKey) {
+        if (currentEq == null) {
+            log.info("Ignore empty equipment with key {}", equipmentKey);
+            return;
+        }
+
+        // if the Equipment UUID is already in the list, it was already processed
+        // needed for solving possible circular dependencies
+        if (equipmentUuidList.contains(currentEq.getUuid())) {
+            log.debug("Not adding equipment with uuid {} because it was aleady added...",
+                    currentEq.getUuid().getValue());
+            return;
+        }
+
+        // we add this to our internal list, such that we avoid circular dependencies
+        equipmentUuidList.add(currentEq.getUuid());
+        log.debug("Adding equipment with uuid {} to the database...", currentEq.getUuid().getValue());
+
+        // we add our current equipment to the database
+        databaseService.writeInventory(
+                onf14Mapper.getInternalEquipment(netconfDomAccessor.getNodeId(), currentEq, parentEq, treeLevel));
+
+        // we iterate the kids of our current equipment and add them to the database recursively
+        // the actual reference is here: /core-model:control-construct/equipment/contained-holder/occupying-fru
+        for (ContainedHolder holder : YangHelper.getCollection(currentEq.nonnullContainedHolder())) {
+            @Nullable
+            UniversalId occupyingFru = holder.getOccupyingFru();
+            if (occupyingFru != null) {
+                equipmentKey = new EquipmentKey(occupyingFru);
+                addEquipmentToDb(equipmentMap.get(equipmentKey), currentEq, treeLevel + 1, equipmentMap, equipmentKey);
+            }
+        }
+    }
+    // end of private methods
+
+    // public methods
+    /**
+     * Set all equipment data from controlConstruct into database and into this manager.
+     *
+     * @param controlConstruct with complete device data
+     */
+    public void setEquipmentData(ControlConstruct controlConstruct) {
+        Objects.requireNonNull(controlConstruct);
+
+        // the top-level-equipment list contains the root objects of the Equipment Model
+        log.debug("Getting list of topLevelEquipment for mountpoint {}", netconfDomAccessor.getNodeId());
+        // adding all root Equipment objects to the DB
+        for (UniversalId uuid : CodeHelpers.nonnull(controlConstruct.getTopLevelEquipment())) {
+            log.debug("Got back topLevelEquipment with uuid {}", uuid.getValue());
+            EquipmentKey equipmentKey = new EquipmentKey(uuid);
+
+            // adding all root Equipment objects to the DB
+            Map<EquipmentKey, Equipment> equipmentMap = controlConstruct.nonnullEquipment();
+            // recursively adding the root equipment and all its children into the DB
+            addEquipmentToDb(equipmentMap.get(equipmentKey), null, EQUIPMENTROOTLEVEL, equipmentMap, equipmentKey);
+        }
+    }
+
+    /**
+     * Read one equipment from device
+     *
+     * @param accessData to access device
+     * @param equipmentUuid uuid of equipment to be read
+     * @return Optional Equipment
+     */
+    public Optional<Equipment> readEquipmentInstance(NetconfDomAccessor accessData, UniversalId equipmentUuid) {
+
+        final Class<?> clazzPac = Equipment.class;
+
+        log.info("DBRead Get equipment for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
+                accessData.getNodeId().getValue(), equipmentUuid.getValue());
+
+        InstanceIdentifierBuilder equipmentIIDBuilder =
+                YangInstanceIdentifier.builder().node(ControlConstruct.QNAME).node(Equipment.QNAME).nodeWithKey(
+                        Equipment.QNAME, QName.create(Equipment.QNAME, "uuid").intern(), equipmentUuid.getValue());
+
+        return accessData.readData(LogicalDatastoreType.CONFIGURATION, equipmentIIDBuilder.build(), Equipment.class);
+    }
+
+    /**
+     * Read one equipment list from device
+     *
+     * @param accessData to access device
+     * @param equipmentUuid uuid of equipment to be read
+     * @return Optional Equipment
+     */
+    public Optional<ControlConstruct> readEquipmentList(NetconfDomAccessor accessData, UniversalId equipmentUuid) {
+
+        log.info("DBRead Get equipment-list for mountpoint {} for uuid {}", accessData.getNodeId().getValue(),
+                equipmentUuid.getValue());
+
+        YangInstanceIdentifier equipmentIIDBuilder = YangInstanceIdentifier.builder()
+        		.node(ControlConstruct.QNAME)
+        		.node(Equipment.QNAME)
+        		.node(NodeIdentifierWithPredicates.of(Equipment.QNAME))
+        		.build();
+
+        return accessData.readData(LogicalDatastoreType.CONFIGURATION, equipmentIIDBuilder,
+                ControlConstruct.class);
+    }
+
+    /**
+     * Read one equipment list from device
+     *
+     * @param accessData to access device
+     * @param equipmentUuid uuid of equipment to be read
+     * @return Optional Equipment
+     */
+    public void readTopLevelEquipment(NetconfDomAccessor accessData) {
+
+        log.info("DBRead Get top-level-equipment for mountpoint {}", accessData.getNodeId().getValue());
+
+        InstanceIdentifierBuilder equipmentIIDBuilder = YangInstanceIdentifier.builder().node(ControlConstruct.QNAME)
+                .node(QName.create(ControlConstruct.QNAME, "top-level-equipment"));
+
+        Optional<NormalizedNode<?, ?>> oData =
+                accessData.readDataNode(LogicalDatastoreType.CONFIGURATION, equipmentIIDBuilder.build());
+        NormalizedNode<?, ?> data = oData.get();
+        Object value = data.getValue();
+        log.info("DataNode: {} {}", data.getNodeType(), data.getIdentifier());
+        if (value != null) {
+            log.info("DataNode value: {} {}", value.getClass().getName(), value);
+            if (value instanceof UnmodifiableCollection) {
+                @SuppressWarnings("unchecked")
+                UnmodifiableCollection<LeafSetEntryNode<String>> topLevelEquipmentCollection = (UnmodifiableCollection<LeafSetEntryNode<String>>) value;
+                @NonNull
+                Iterator<LeafSetEntryNode<String>> it = topLevelEquipmentCollection.iterator();
+                while (it.hasNext()) {
+                    LeafSetEntryNode<String> topLevelEquipmentUuid = it.next();
+                    if (topLevelEquipmentUuid != null) {
+                        log.info("LeafSetEntryNode: {} {} {}", topLevelEquipmentUuid.getValue(), topLevelEquipmentUuid.getNodeType() ,topLevelEquipmentUuid.getValue().getClass().getName());
+                    }
+                }
+            }
+        }
+    }
+    // end of public methods
+
+    // static methods
+    // end of static methods
+
+    // private classes
+    // end of private classes
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14AirInterface.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14AirInterface.java
new file mode 100644
index 0000000..2d0d3c5
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14AirInterface.java
@@ -0,0 +1,39 @@
+/*
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 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==========================================================================
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces;
+
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.dataprovider.InternalDataModelSeverity;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPE;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author alexs
+ *
+ */
+public class Onf14AirInterface {
+
+    @SuppressWarnings("unused")
+    private static final Logger LOG = LoggerFactory.getLogger(Onf14AirInterface.class);
+
+    public static SeverityType mapSeverity(
+            Class<? extends SEVERITYTYPE> severity) {
+        return InternalDataModelSeverity.mapSeverity(severity);
+    }
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14AirInterfaceNotificationListener.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14AirInterfaceNotificationListener.java
similarity index 99%
rename from sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14AirInterfaceNotificationListener.java
rename to sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14AirInterfaceNotificationListener.java
index dc37949..c729767 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14AirInterfaceNotificationListener.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14AirInterfaceNotificationListener.java
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  *
  */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces;
 
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14DomInterfacePacManager.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14DomInterfacePacManager.java
new file mode 100644
index 0000000..f4e697a
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14DomInterfacePacManager.java
@@ -0,0 +1,356 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.onap.ccsdk.features.sdnr.wt.common.YangHelper;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.equipment.Onf14DomEquipmentManager;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.util.Debug;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.LAYERPROTOCOLNAMETYPEAIRLAYER;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.LayerProtocol1;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.air._interface.lp.spec.AirInterfacePac;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.air._interface.pac.AirInterfaceCurrentProblems;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.ControlConstruct;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.LAYERPROTOCOLNAMETYPE;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.UniversalId;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.control.construct.LogicalTerminationPoint;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.control.construct.LogicalTerminationPointKey;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.logical.termination.point.LayerProtocol;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.logical.termination.point.LayerProtocolKey;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.LAYERPROTOCOLNAMETYPEETHERNETCONTAINERLAYER;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.LAYERPROTOCOLNAMETYPEWIRELAYER;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.NotificationListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Onf14DomInterfacePacManager {
+
+    // constants
+    private static final Logger log = LoggerFactory.getLogger(Onf14DomEquipmentManager.class);
+    // end of constants
+
+    // variables
+    private final NetconfDomAccessor netconfDomAccessor;
+    private final @NonNull DeviceManagerServiceProvider serviceProvider;
+
+    // air interface related members
+    private final List<TechnologySpecificPacKeys> airInterfaceList = new ArrayList<TechnologySpecificPacKeys>();
+    @SuppressWarnings("unused")
+    private ListenerRegistration<NotificationListener> airInterfaceNotificationListenerHandler;
+    private @NonNull final Onf14AirInterfaceNotificationListener airInterfaceNotificationListener;
+
+    // ethernet container related members
+    private final List<TechnologySpecificPacKeys> ethernetContainerList = new ArrayList<TechnologySpecificPacKeys>();
+    @SuppressWarnings("unused")
+    private ListenerRegistration<NotificationListener> etherneContainerNotificationListenerHandler;
+    private @NonNull final Onf14EthernetContainerNotificationListener ethernetContainerNotificationListener;
+
+    // wire interface related members
+    private final List<TechnologySpecificPacKeys> wireInterfaceList = new ArrayList<TechnologySpecificPacKeys>();
+    @SuppressWarnings("unused")
+    private ListenerRegistration<NotificationListener> wireInterfaceNotificationListenerHandler;
+    private @NonNull final Onf14WireInterfaceNotificationListener wireInterfaceNotificationListener;
+    // end of variables
+
+    // constructors
+    public Onf14DomInterfacePacManager(@NonNull NetconfDomAccessor netconfDomAccessor,
+            @NonNull DeviceManagerServiceProvider serviceProvider) {
+
+        this.netconfDomAccessor = Objects.requireNonNull(netconfDomAccessor);
+        this.serviceProvider = Objects.requireNonNull(serviceProvider);
+
+        this.airInterfaceNotificationListenerHandler = null;
+        this.airInterfaceNotificationListener =
+                new Onf14AirInterfaceNotificationListener(netconfDomAccessor, serviceProvider);
+        this.etherneContainerNotificationListenerHandler = null;
+        ethernetContainerNotificationListener =
+                new Onf14EthernetContainerNotificationListener(netconfDomAccessor, serviceProvider);
+        this.wireInterfaceNotificationListenerHandler = null;
+        wireInterfaceNotificationListener =
+                new Onf14WireInterfaceNotificationListener(netconfDomAccessor, serviceProvider);
+    }
+    // end of constructors
+
+    // getters and setters
+    // end of getters and setters
+
+    // private methods
+    // end of private methods
+
+    // public methods
+    public void readAllAirInterfaceCurrentProblems(NetconfDomAccessor netconfDomAccessor,
+            ControlConstruct controlConstruct, FaultData resultList) {
+
+        int idxStart; // Start index for debug messages
+
+        for (TechnologySpecificPacKeys key : airInterfaceList) {
+            idxStart = resultList.size();
+
+            readAirInterfaceCurrentProblemForLtp(netconfDomAccessor, controlConstruct, key.getLtpUuid(),
+                    key.getLocalId(), resultList);
+            Debug.debugResultList(key.getLtpUuid().getValue(), resultList, idxStart);
+        }
+    }
+
+    /*
+    public void readAllEhernetContainerCurrentProblems(FaultData resultList) {
+
+        int idxStart; // Start index for debug messages
+
+        for (TechnologySpecificPacKeys key : ethernetContainerList) {
+            idxStart = resultList.size();
+
+            readEthernetConainerCurrentProblemForLtp(key.getLtpUuid(), key.getLocalId(), resultList);
+            debugResultList(key.getLtpUuid().getValue(), resultList, idxStart);
+        }
+    }
+
+    public void readAllWireInterfaceCurrentProblems(FaultData resultList) {
+
+        int idxStart; // Start index for debug messages
+
+        for (TechnologySpecificPacKeys key : wireInterfaceList) {
+            idxStart = resultList.size();
+
+            readWireInterfaceCurrentProblemForLtp(key.getLtpUuid(), key.getLocalId(), resultList);
+            debugResultList(key.getLtpUuid().getValue(), resultList, idxStart);
+        }
+    }*/
+    public void readKeys(ControlConstruct controlConstruct) {
+
+        @NonNull
+        Collection<LogicalTerminationPoint> ltpList =
+                YangHelper.getCollection(controlConstruct.nonnullLogicalTerminationPoint());
+        log.debug("Iterating the LTP list for node {}", netconfDomAccessor.getNodeId().getValue());
+
+        // iterating all the Logical Termination Point list
+        for (LogicalTerminationPoint ltp : ltpList) {
+            @NonNull
+            List<LayerProtocol> lpList = YangHelper.getList(ltp.nonnullLayerProtocol());
+            // the Layer Protocol list should contain only one item, since we have an 1:1 relationship between the LTP and the LP
+            if (lpList.size() != 1) {
+                log.debug("Layer protocol has no 1:1 relationship with the LTP.");
+                return;
+            }
+            // accessing the LP, which should be only 1
+            LayerProtocol lp = lpList.get(0);
+            @Nullable
+            Class<? extends LAYERPROTOCOLNAMETYPE> layerProtocolName = lp.getLayerProtocolName();
+            if (layerProtocolName != null) {
+                // if the LTP has an airInterface technology extension, the layer protocol name is air-layer
+                if (layerProtocolName.getTypeName() == LAYERPROTOCOLNAMETYPEAIRLAYER.class.getName()) {
+                    TechnologySpecificPacKeys airInterfaceKey =
+                            new TechnologySpecificPacKeys(ltp.getUuid(), lp.getLocalId());
+                    airInterfaceList.add(airInterfaceKey);
+                    log.debug("Adding Ltp with uuid {} and local-id {} to the air-interface list",
+                            ltp.getUuid().getValue(), lp.getLocalId());
+                }
+                // if the LTP has an ethernetContainier technology extension, the layer protocol name is ethernet-container-layer
+                else if (layerProtocolName.getTypeName() == LAYERPROTOCOLNAMETYPEETHERNETCONTAINERLAYER.class
+                        .getName()) {
+                    TechnologySpecificPacKeys ethernetContainerKey =
+                            new TechnologySpecificPacKeys(ltp.getUuid(), lp.getLocalId());
+                    ethernetContainerList.add(ethernetContainerKey);
+                    log.debug("Adding Ltp with uuid {} and local-id {} to the ethernet-contatinier list",
+                            ltp.getUuid().getValue(), lp.getLocalId());
+                } else if (layerProtocolName.getTypeName() == LAYERPROTOCOLNAMETYPEWIRELAYER.class.getName()) {
+                    TechnologySpecificPacKeys wireInterfaceKey =
+                            new TechnologySpecificPacKeys(ltp.getUuid(), lp.getLocalId());
+                    wireInterfaceList.add(wireInterfaceKey);
+                    log.debug("Adding Ltp with uuid {} and local-id {} to the wire-interface list",
+                            ltp.getUuid().getValue(), lp.getLocalId());
+                }
+            }
+        }
+    }
+
+    private static void readAirInterfaceCurrentProblemForLtp(NetconfDomAccessor netconfDomAccessor,
+            ControlConstruct controlConstruct, UniversalId ltpUuid, String localId, FaultData resultList) {
+
+        final Class<AirInterfacePac> clazzPac = AirInterfacePac.class;
+
+        log.info("DBRead Get current problems for class {} from mountpoint {} for LTP uuid {} and local-id {}",
+                clazzPac.getSimpleName(), netconfDomAccessor.getNodeId().getValue(), ltpUuid.getValue(), localId);
+
+        // constructing the IID needs the augmentation exposed byy the air-interface-2-0 model
+        //        InstanceIdentifier<AirInterfaceCurrentProblems> airInterfaceCurrentProblem_IID = InstanceIdentifier
+        //                .builder(ControlConstruct.class)
+        //                .child(LogicalTerminationPoint.class, new LogicalTerminationPointKey(ltpUuid))
+        //                .child(LayerProtocol.class, new LayerProtocolKey(localId))
+        //                .augmentation(
+        //                        org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.LayerProtocol1.class)
+        //                .child(AirInterfacePac.class)
+        //                .child(AirInterfaceCurrentProblems.class).build();
+        /*
+        final YangInstanceIdentifier airInterfaceCurrentProblem_IID =
+                YangInstanceIdentifier.builder().node(ControlConstruct.QNAME)
+                        .nodeWithKey(LogicalTerminationPoint.QNAME,
+                                QName.create(LogicalTerminationPoint.QNAME, "logical-termination-point-key").intern(),
+                                ltpUuid.getValue())
+                        .nodeWithKey(LayerProtocol.QNAME,
+                                QName.create(LayerProtocol.QNAME, "layer-protocol-key").intern(), localId)
+                        //.node(org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.LayerProtocol1.QNAME)
+                        .node(AirInterfacePac.QNAME).node(AirInterfaceCurrentProblems.QNAME).build();
+
+        // reading all the current-problems list for this specific LTP and LP
+        AirInterfaceCurrentProblems problems =
+                 netconfDomAccessor.readData(LogicalDatastoreType.OPERATIONAL, airInterfaceCurrentProblem_IID);
+         */
+
+        @NonNull
+        Map<LogicalTerminationPointKey, LogicalTerminationPoint> ltpMap =
+                controlConstruct.nonnullLogicalTerminationPoint();
+        LogicalTerminationPoint ltp = ltpMap.get(new LogicalTerminationPointKey(ltpUuid));
+        if (ltp != null) {
+            @NonNull
+            Map<LayerProtocolKey, LayerProtocol> lpMap = ltp.nonnullLayerProtocol();
+            LayerProtocol lp = lpMap.get(new LayerProtocolKey(localId));
+            @Nullable
+            LayerProtocol1 lp1 = lp.augmentation(
+                    org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.LayerProtocol1.class);
+            if (lp1 != null) {
+                @Nullable
+                AirInterfacePac airInterfacePack = lp1.getAirInterfacePac();
+                if (airInterfacePack != null) {
+                    @Nullable
+                    AirInterfaceCurrentProblems cp = airInterfacePack.getAirInterfaceCurrentProblems();
+                    if (cp == null) {
+                        log.debug("DBRead Id {} no AirInterfaceCurrentProblems", ltpUuid);
+                    } else {
+                        for (org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.air._interface.current.problems.CurrentProblemList problem : YangHelper
+                                .getCollection(cp.nonnullCurrentProblemList())) {
+                            resultList.add(netconfDomAccessor.getNodeId(), (int) problem.getSequenceNumber(),
+                                    problem.getTimestamp(), ltpUuid.getValue(), problem.getProblemName(),
+                                    Onf14AirInterface.mapSeverity(problem.getProblemSeverity()));
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /*
+    private void readEthernetConainerCurrentProblemForLtp(UniversalId ltpUuid, String localId, FaultData resultList) {
+
+        final Class<EthernetContainerPac> clazzPac = EthernetContainerPac.class;
+
+        log.info("DBRead Get current problems for class {} from mountpoint {} for LTP uuid {} and local-id {}",
+                clazzPac.getSimpleName(), netconfDomAccessor.getNodeId().getValue(), ltpUuid.getValue(), localId);
+
+        // constructing the IID needs the augmentation exposed by the ethernet-container-2-0 model
+        //        InstanceIdentifier<EthernetContainerCurrentProblems> etherneContainerCurrentProblem_IID = InstanceIdentifier
+        //                .builder(ControlConstruct.class)
+        //                .child(LogicalTerminationPoint.class, new LogicalTerminationPointKey(ltpUuid))
+        //                .child(LayerProtocol.class, new LayerProtocolKey(localId))
+        //                .augmentation(
+        //                        org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.LayerProtocol1.class)
+        //                .child(EthernetContainerPac.class).child(EthernetContainerCurrentProblems.class).build();
+        final YangInstanceIdentifier etherneContainerCurrentProblem_IID =
+                YangInstanceIdentifier.builder().node(ControlConstruct.QNAME)
+                        .nodeWithKey(LogicalTerminationPoint.QNAME,
+                                QName.create(LogicalTerminationPoint.QNAME, "logical-termination-point-key").intern(),
+                                ltpUuid.getValue())
+                        .nodeWithKey(LayerProtocol.QNAME,
+                                QName.create(LayerProtocol.QNAME, "layer-protocol-key").intern(), localId)
+                        //.node(org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.LayerProtocol1.QNAME)
+                        .node(EthernetContainerPac.QNAME).node(EthernetContainerCurrentProblems.QNAME).build();
+
+        // reading all the current-problems list for this specific LTP and LP
+        EthernetContainerCurrentProblems problems =
+                netconfDomAccessor.readData(LogicalDatastoreType.OPERATIONAL, etherneContainerCurrentProblem_IID);
+
+        if (problems == null) {
+            log.debug("DBRead Id {} no EthernetContainerCurrentProblems", ltpUuid);
+        } else if (problems.getCurrentProblemList() == null) {
+            log.debug("DBRead Id {} empty CurrentProblemList", ltpUuid);
+        } else {
+            for (org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.ethernet.container.current.problems.CurrentProblemList problem : YangHelper
+                    .getCollection(problems.nonnullCurrentProblemList())) {
+                resultList.add(netconfDomAccessor.getNodeId(), (int) problem.getSequenceNumber(),
+                        problem.getTimestamp(), ltpUuid.getValue(), problem.getProblemName(),
+                        Onf14EthernetContainer.mapSeverity(problem.getProblemSeverity()));
+            }
+        }
+    }
+
+    private void readWireInterfaceCurrentProblemForLtp(UniversalId ltpUuid, String localId, FaultData resultList) {
+
+        final Class<WireInterfacePac> clazzPac = WireInterfacePac.class;
+
+        log.info("DBRead Get current problems for class {} from mountpoint {} for LTP uuid {} and local-id {}",
+                clazzPac.getSimpleName(), netconfDomAccessor.getNodeId().getValue(), ltpUuid.getValue(), localId);
+
+        // constructing the IID needs the augmentation exposed by the wire-interface-2-0 model
+        //        InstanceIdentifier<WireInterfaceCurrentProblems> wireInterfaceCurrentProblem_IID = InstanceIdentifier
+        //                .builder(ControlConstruct.class)
+        //                .child(LogicalTerminationPoint.class, new LogicalTerminationPointKey(ltpUuid))
+        //                .child(LayerProtocol.class, new LayerProtocolKey(localId))
+        //                .augmentation(
+        //                        org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.LayerProtocol1.class)
+        //                .child(WireInterfacePac.class).child(WireInterfaceCurrentProblems.class).build();
+        final YangInstanceIdentifier wireInterfaceCurrentProblem_IID =
+                YangInstanceIdentifier.builder().node(ControlConstruct.QNAME)
+                        .nodeWithKey(LogicalTerminationPoint.QNAME,
+                                QName.create(LogicalTerminationPoint.QNAME, "logical-termination-point-key").intern(),
+                                ltpUuid.getValue())
+                        .nodeWithKey(LayerProtocol.QNAME,
+                                QName.create(LayerProtocol.QNAME, "layer-protocol-key").intern(), localId)
+                        //.node(org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.LayerProtocol1.QNAME)
+                        .node(WireInterfacePac.QNAME).node(WireInterfaceCurrentProblems.QNAME).build();
+
+        // reading all the current-problems list for this specific LTP and LP
+        WireInterfaceCurrentProblems problems =
+                netconfDomAccessor.readData(LogicalDatastoreType.OPERATIONAL, wireInterfaceCurrentProblem_IID);
+
+        if (problems == null) {
+            log.debug("DBRead Id {} no WireInterfaceCurrentProblems", ltpUuid);
+        } else if (problems.getCurrentProblemList() == null) {
+            log.debug("DBRead Id {} empty CurrentProblemList", ltpUuid);
+        } else {
+            for (org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.wire._interface.current.problems.CurrentProblemList problem : YangHelper
+                    .getCollection(problems.nonnullCurrentProblemList())) {
+                resultList.add(netconfDomAccessor.getNodeId(), (int) problem.getSequenceNumber(),
+                        problem.getTimestamp(), ltpUuid.getValue(), problem.getProblemName(),
+                        Onf14WireInterface.mapSeverity(problem.getProblemSeverity()));
+            }
+        }
+    }
+    */
+
+    // end of public methods
+
+    // static methods
+    // end of static methods
+
+    // private classes
+    // end of private classes
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14EthernetContainer.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14EthernetContainer.java
new file mode 100644
index 0000000..f976995
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14EthernetContainer.java
@@ -0,0 +1,40 @@
+/*
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 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==========================================================================
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces;
+
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.dataprovider.InternalDataModelSeverity;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.SEVERITYTYPE;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author alexs
+ *
+ */
+public class Onf14EthernetContainer {
+
+    @SuppressWarnings("unused")
+    private static final Logger LOG = LoggerFactory.getLogger(Onf14EthernetContainer.class);
+
+    public static SeverityType mapSeverity(
+            Class<? extends SEVERITYTYPE> severity) {
+        return InternalDataModelSeverity.mapSeverity(severity);
+    }
+
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14EthernetContainerNotificationListener.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14EthernetContainerNotificationListener.java
similarity index 99%
rename from sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14EthernetContainerNotificationListener.java
rename to sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14EthernetContainerNotificationListener.java
index f68d6f3..7cc3c9b 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14EthernetContainerNotificationListener.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14EthernetContainerNotificationListener.java
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  *
  */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces;
 
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14WireInterface.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14WireInterface.java
new file mode 100644
index 0000000..acb262f
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14WireInterface.java
@@ -0,0 +1,40 @@
+/*
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 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==========================================================================
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces;
+
+import org.eclipse.jdt.annotation.Nullable;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.dataprovider.InternalDataModelSeverity;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPE;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author alexs
+ *
+ */
+public class Onf14WireInterface {
+
+    @SuppressWarnings("unused")
+    private static final Logger LOG = LoggerFactory.getLogger(Onf14WireInterface.class);
+
+    public static SeverityType mapSeverity(@Nullable Class<? extends SEVERITYTYPE> severity) {
+        return InternalDataModelSeverity.mapSeverity(severity);
+    }
+
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14WireInterfaceNotificationListener.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14WireInterfaceNotificationListener.java
similarity index 99%
rename from sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14WireInterfaceNotificationListener.java
rename to sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14WireInterfaceNotificationListener.java
index 1d4d5d8..0db482a 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14WireInterfaceNotificationListener.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/Onf14WireInterfaceNotificationListener.java
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  *
  */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces;
 
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/TechnologySpecificPacKeys.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/TechnologySpecificPacKeys.java
new file mode 100644
index 0000000..552ba66
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/interfaces/TechnologySpecificPacKeys.java
@@ -0,0 +1,54 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces;
+
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.UniversalId;
+
+/**
+ * Defining a structure that can map the LP local-id and its corresponding LTP uuid
+ */
+class TechnologySpecificPacKeys {
+
+    private UniversalId ltpUuid;
+    private String localId;
+
+    public TechnologySpecificPacKeys(UniversalId uuid, String lId) {
+        this.ltpUuid = uuid;
+        this.localId = lId;
+    }
+
+    public UniversalId getLtpUuid() {
+        return ltpUuid;
+    }
+
+    public String getLocalId() {
+        return localId;
+    }
+
+    public void setLtpUuid(UniversalId uuid) {
+        this.ltpUuid = uuid;
+    }
+
+    public void setLocalId(String lId) {
+        this.localId = lId;
+    }
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/util/Debug.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/util/Debug.java
new file mode 100644
index 0000000..efa3cf1
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/util/Debug.java
@@ -0,0 +1,72 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.util;
+
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Debug {
+
+    // constants
+    private static final Logger log = LoggerFactory.getLogger(Debug.class);
+    // end of constants
+
+    // variables
+    // end of variables
+
+    // constructors
+    // end of constructors
+
+    // getters and setters
+    // end of getters and setters
+
+    // private methods
+    // end of private methods
+
+    // public methods
+    /**
+     * LOG the newly added problems of the interface pac
+     *
+     * @param idxStart
+     * @param uuid
+     * @param resultList
+     */
+    public static void debugResultList(String uuid, FaultData resultList, int idxStart) {
+        StringBuilder sb = new StringBuilder();
+        int idx = 0;
+        for (int t = idxStart; t < resultList.size(); t++) {
+            sb.append(idx++);
+            sb.append(":{");
+            sb.append(resultList.get(t));
+            sb.append('}');
+        }
+        log.debug("Found problems {} {}", uuid, sb);
+    }
+    // end of public methods
+
+    // static methods
+    // end of static methods
+
+    // private classes
+    // end of private classes
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestDeviceManagerOnf14Impl.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestDeviceManagerOnf14Impl.java
index 8dbfa2f..4b69e42 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestDeviceManagerOnf14Impl.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestDeviceManagerOnf14Impl.java
@@ -43,7 +43,6 @@
             devMgrOnf14.setNetconfNetworkElementService(netconfElemService);
             devMgrOnf14.init();
         } catch (Exception e) {
-            // TODO Auto-generated catch block
             e.printStackTrace();
         }
     }
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14AirInterfaceNotificationListener.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14AirInterfaceNotificationListener.java
index 7dbbc22..d03d50c 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14AirInterfaceNotificationListener.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14AirInterfaceNotificationListener.java
@@ -23,12 +23,11 @@
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.Onf14AirInterfaceNotificationListener;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.test.mock.NetconfAccessorMock;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14AirInterfaceNotificationListener;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
-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.yang.types.rev130715.DateAndTime;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.AttributeValueChangedNotification;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.ObjectCreationNotification;
@@ -44,7 +43,7 @@
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 
 public class TestOnf14AirInterfaceNotificationListener extends Mockito {
-    private NetconfAccessor accessor;
+    private NetconfBindingAccessor accessor;
     private NodeId nodeId;
     private DeviceManagerServiceProvider serviceProvider;
     private FaultService faultService;
@@ -58,7 +57,7 @@
 
     @Before
     public void init() {
-        accessor = mock(NetconfAccessorMock.class);
+        accessor = mock(NetconfBindingAccessor.class);
         nodeId = mock(NodeId.class);
         serviceProvider = mock(DeviceManagerServiceProvider.class);
         faultService = mock(FaultService.class);
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14EthernetContainerNotificationListener.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14EthernetContainerNotificationListener.java
index dedcf79..f6f7d90 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14EthernetContainerNotificationListener.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14EthernetContainerNotificationListener.java
@@ -23,12 +23,11 @@
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.Onf14EthernetContainerNotificationListener;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.test.mock.NetconfAccessorMock;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14EthernetContainerNotificationListener;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
-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.yang.types.rev130715.DateAndTime;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.UniversalId;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.AttributeValueChangedNotification;
@@ -44,7 +43,7 @@
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 
 public class TestOnf14EthernetContainerNotificationListener extends Mockito {
-    private NetconfAccessor accessor;
+    private NetconfBindingAccessor accessor;
     private NodeId nodeId;
     private DeviceManagerServiceProvider serviceProvider;
     private FaultService faultService;
@@ -58,7 +57,7 @@
 
     @Before
     public void init() {
-        accessor = mock(NetconfAccessorMock.class);
+        accessor = mock(NetconfBindingAccessor.class);
         nodeId = mock(NodeId.class);
         serviceProvider = mock(DeviceManagerServiceProvider.class);
         faultService = mock(FaultService.class);
@@ -71,23 +70,23 @@
         attrValChangedNotif = mock(AttributeValueChangedNotification.class);
 
         when(accessor.getNodeId()).thenReturn(nodeId);
-        when(problemNotif.getCounter()).thenReturn(new Long(10));
+        when(problemNotif.getCounter()).thenReturn(10L);
         when(problemNotif.getTimestamp()).thenReturn(new DateAndTime("2020-02-05T12:30:45.283Z"));
         when(problemNotif.getObjectIdRef()).thenReturn(new UniversalId("12345678-0123-0abc-abcd-0123456789AB"));
         when(problemNotif.getProblem()).thenReturn("modulationIsDownShifted");
 
         when(attrValChangedNotif.getAttributeName()).thenReturn("12345678-0123-2345-abcd-0123456789AB");
-        when(attrValChangedNotif.getCounter()).thenReturn(new Long(20));
+        when(attrValChangedNotif.getCounter()).thenReturn(20L);
         when(attrValChangedNotif.getNewValue()).thenReturn("new-value");
         when(attrValChangedNotif.getObjectIdRef()).thenReturn(new UniversalId("12345678-0123-1234-abcd-0123456789AB"));
         when(attrValChangedNotif.getTimestamp()).thenReturn(new DateAndTime("2020-02-05T12:30:45.283Z"));
 
         when(creationNotif.getObjectType()).thenReturn("air-interface-name");
-        when(creationNotif.getCounter()).thenReturn(new Long(20));
+        when(creationNotif.getCounter()).thenReturn(20L);
         when(creationNotif.getObjectIdRef()).thenReturn(new UniversalId("12345678-0123-1234-abcd-0123456789AB"));
         when(creationNotif.getTimestamp()).thenReturn(new DateAndTime("2020-02-05T12:30:45.283Z"));
 
-        when(deletionNotif.getCounter()).thenReturn(new Long(20));
+        when(deletionNotif.getCounter()).thenReturn(20L);
         when(deletionNotif.getObjectIdRef()).thenReturn(new UniversalId("12345678-0123-1234-abcd-0123456789AB"));
         when(deletionNotif.getTimestamp()).thenReturn(new DateAndTime("2020-02-05T12:30:45.283Z"));
 
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14NetworkElement.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14NetworkElement.java
index d87e6d2..7a5658a 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14NetworkElement.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14NetworkElement.java
@@ -28,35 +28,36 @@
 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.onf14.impl.Onf14NetworkElementFactory;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.test.mock.NetconfAccessorMock;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
-import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.ControlConstruct;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.UniversalId;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class TestOnf14NetworkElement extends Mockito {
 
-    static NetconfAccessorMock accessor;
+    private static String NODEIDSTRING = "nSky";
+
+    static NetconfDomAccessor accessor;
     static DeviceManagerServiceProvider serviceProvider;
     static Capabilities capabilities;
-    QName qCapability;
     static DataProvider dataProvider;
     static FaultService faultService;
-    static DataBroker dataBroker;
+    static DOMDataBroker dataBroker;
     static TransactionUtils transactionUtils;
     static ControlConstruct controlConstruct;
 
     @Before
     public void init() {
         capabilities = mock(Capabilities.class);
-        accessor = mock(NetconfAccessorMock.class);
+        accessor = mock(NetconfDomAccessor.class);
         serviceProvider = mock(DeviceManagerServiceProvider.class);
 
         NodeId nNodeId = new NodeId("nSky");
@@ -69,17 +70,16 @@
         faultService = mock(FaultService.class);
         when(serviceProvider.getFaultService()).thenReturn(faultService);
 
-        dataBroker = mock(DataBroker.class);
+        dataBroker = mock(DOMDataBroker.class);
         when(accessor.getDataBroker()).thenReturn(dataBroker);
 
         controlConstruct = mock(ControlConstruct.class);
-        transactionUtils = mock(TransactionUtils.class);
-        when(accessor.getTransactionUtils()).thenReturn(transactionUtils);
 
-        InstanceIdentifier<ControlConstruct> CONTROLCONSTRUCT_IID =
-                InstanceIdentifier.builder(ControlConstruct.class).build();
-        when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.CONFIGURATION,
-                CONTROLCONSTRUCT_IID)).thenReturn(controlConstruct);
+        YangInstanceIdentifier CONTROLCONSTRUCT_IID =
+                YangInstanceIdentifier.builder().node(ControlConstruct.QNAME).build();
+
+        when(accessor.readData(LogicalDatastoreType.CONFIGURATION, CONTROLCONSTRUCT_IID, ControlConstruct.class))
+                .thenReturn(Optional.of(controlConstruct));
 
         List<UniversalId> topLevelEqList = null;
         UniversalId uuid = new UniversalId("0Aabcdef-0abc-0cfD-0abC-0123456789AB");
@@ -91,10 +91,21 @@
     @Test
     public void testGeneric() {
         Optional<NetworkElement> onfNe;
+        NodeId nodeId = new NodeId(NODEIDSTRING);
+        NetconfBindingAccessor bindingAccessor = mock(NetconfBindingAccessor.class);
+        when(bindingAccessor.getTransactionUtils()).thenReturn(mock(TransactionUtils.class));
+        when(bindingAccessor.getNodeId()).thenReturn(nodeId);
+
+        NetconfDomAccessor domAccessor = mock(NetconfDomAccessor.class);
+        when(domAccessor.getNodeId()).thenReturn(nodeId);
+
         when(accessor.getCapabilites().isSupportingNamespace(ControlConstruct.QNAME)).thenReturn(true);
+        when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(bindingAccessor));
+        when(accessor.getNetconfDomAccessor()).thenReturn(Optional.of(domAccessor));
+
         Onf14NetworkElementFactory factory = new Onf14NetworkElementFactory();
         onfNe = factory.create(accessor, serviceProvider);
-        assertTrue(factory.create(accessor, serviceProvider).isPresent());
+        assertTrue(onfNe.isPresent());
 
         onfNe.get().register();
         onfNe.get().deregister();
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14NetworkElementFactory.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14NetworkElementFactory.java
index 59e57da..4087607 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14NetworkElementFactory.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14NetworkElementFactory.java
@@ -19,20 +19,22 @@
 
 import static org.junit.Assert.assertTrue;
 import java.io.IOException;
+import java.util.Optional;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.Onf14NetworkElementFactory;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.test.mock.NetconfAccessorMock;
 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.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.ControlConstruct;
 import org.opendaylight.yangtools.yang.common.QName;
 
 public class TestOnf14NetworkElementFactory extends Mockito {
 
-    static NetconfAccessor accessor;
+    static NetconfBindingAccessor accessor;
     static DeviceManagerServiceProvider serviceProvider;
     static Capabilities capabilities;
     QName qCapability;
@@ -40,16 +42,18 @@
     @BeforeClass
     public static void init() throws InterruptedException, IOException {
         capabilities = mock(Capabilities.class);
-        accessor = mock(NetconfAccessorMock.class);
+        accessor = mock(NetconfBindingAccessor.class);
         serviceProvider = mock(DeviceManagerServiceProvider.class);
 
         when(accessor.getCapabilites()).thenReturn(capabilities);
-        when(serviceProvider.getDataProvider()).thenReturn(null);
+        when(serviceProvider.getDataProvider()).thenReturn(mock(DataProvider.class));
     }
 
     @Test
     public void testCreateOnf14Component() throws Exception {
         when(accessor.getCapabilites().isSupportingNamespace(ControlConstruct.QNAME)).thenReturn(true);
+        when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(mock(NetconfBindingAccessor.class)));
+        when(accessor.getNetconfDomAccessor()).thenReturn(Optional.of(mock(NetconfDomAccessor.class)));
         Onf14NetworkElementFactory factory = new Onf14NetworkElementFactory();
         assertTrue((factory.create(accessor, serviceProvider)).isPresent());
     }
@@ -58,7 +62,7 @@
     public void testCreateNone() throws Exception {
         when(accessor.getCapabilites().isSupportingNamespace(ControlConstruct.QNAME)).thenReturn(false);
         Onf14NetworkElementFactory factory = new Onf14NetworkElementFactory();
-        assertTrue(!(factory.create(accessor, serviceProvider).isPresent()));
+        assertTrue(factory.create(accessor, serviceProvider).isEmpty());
     }
 }
 
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14ToInternalDataModel2.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14ToInternalDataModel2.java
index ca36f79..b0b00d9 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14ToInternalDataModel2.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14ToInternalDataModel2.java
@@ -18,17 +18,19 @@
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14;
 
 import static org.junit.Assert.assertEquals;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.jdt.annotation.NonNull;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.Onf14ToInternalDataModel;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.dataprovider.Onf14ToInternalDataModel;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.Equipment;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.UniversalId;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.equipment.ActualEquipment;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.equipment.ContainedHolder;
+import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.equipment.ContainedHolderKey;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.equipment.detail.ManufacturedThing;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.manufactured.thing.EquipmentInstance;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.manufactured.thing.EquipmentType;
@@ -65,8 +67,8 @@
         when(currentEq.getUuid()).thenReturn(new UniversalId("0Aabcdef-0abc-0cfD-0abC-0123456789AB"));
         when(parentEq.getUuid()).thenReturn(new UniversalId("0Aabcdef-0123-0abc-abcd-0123456789AB"));
 
-        List<ContainedHolder> containedHolderList = new ArrayList<ContainedHolder>();
-        containedHolderList.add(holder);
+        @NonNull Map<ContainedHolderKey, ContainedHolder> containedHolderList = new HashMap<>();
+        containedHolderList.put(holder.key(),holder);
         when(currentEq.nonnullContainedHolder()).thenReturn(containedHolderList);
 
     }
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14WireInterfaceNotificationListener.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14WireInterfaceNotificationListener.java
index 267e9a8..e1b13f1 100644
--- a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14WireInterfaceNotificationListener.java
+++ b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestOnf14WireInterfaceNotificationListener.java
@@ -23,12 +23,11 @@
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.Onf14WireInterfaceNotificationListener;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.test.mock.NetconfAccessorMock;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14WireInterfaceNotificationListener;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
-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.yang.types.rev130715.DateAndTime;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.UniversalId;
 import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.AttributeValueChangedNotification;
@@ -44,7 +43,7 @@
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 
 public class TestOnf14WireInterfaceNotificationListener extends Mockito {
-    private NetconfAccessor accessor;
+    private NetconfBindingAccessor accessor;
     private NodeId nodeId;
     private DeviceManagerServiceProvider serviceProvider;
     private FaultService faultService;
@@ -58,7 +57,7 @@
 
     @Before
     public void init() {
-        accessor = mock(NetconfAccessorMock.class);
+        accessor = mock(NetconfBindingAccessor.class);
         nodeId = mock(NodeId.class);
         serviceProvider = mock(DeviceManagerServiceProvider.class);
         faultService = mock(FaultService.class);
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestSeverity.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestSeverity.java
new file mode 100644
index 0000000..686942a
--- /dev/null
+++ b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/TestSeverity.java
@@ -0,0 +1,80 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14;
+
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14AirInterface;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl.interfaces.Onf14WireInterface;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
+
+public class TestSeverity extends Mockito {
+
+    @Test
+    public void test1_1() {
+        assertTrue(Onf14WireInterface.mapSeverity(
+                org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPECRITICAL.class)
+                .equals(SeverityType.Critical));
+    }
+
+    @Test
+    public void test1_2() {
+        assertTrue(Onf14WireInterface.mapSeverity(
+                org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEWARNING.class)
+                .equals(SeverityType.Warning));
+    }
+
+    @Test
+    public void test1_3() {
+        assertTrue(Onf14WireInterface.mapSeverity(
+                org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEMINOR.class)
+                .equals(SeverityType.Minor));
+    }
+
+    @Test
+    public void test1_4() {
+        assertTrue(Onf14WireInterface.mapSeverity(
+                org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.SEVERITYTYPEMAJOR.class)
+                .equals(SeverityType.Major));
+    }
+
+    public void test2_1() {
+        assertTrue(Onf14AirInterface.mapSeverity(
+                org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPECRITICAL.class)
+                .equals(SeverityType.Critical));
+    }
+
+    @Test
+    public void test2_2() {
+        assertTrue(Onf14AirInterface.mapSeverity(
+                org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.SEVERITYTYPEMINOR.class)
+                .equals(SeverityType.Minor));
+    }
+
+    @Test
+    public void test2_3() {
+        assertTrue(Onf14AirInterface.mapSeverity(null).equals(SeverityType.NonAlarmed));
+    }
+
+
+}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/test/mock/NetconfAccessorMock.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/test/mock/NetconfAccessorMock.java
deleted file mode 100644
index 8324854..0000000
--- a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/test/mock/NetconfAccessorMock.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2020 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==========================================================================
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.test.mock;
-
-import com.google.common.util.concurrent.ListenableFuture;
-import java.util.List;
-import org.eclipse.jdt.annotation.NonNull;
-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.TransactionUtils;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.MountPoint;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionOutput;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
-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.NotificationListener;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-/**
- */
-public class NetconfAccessorMock implements NetconfAccessor {
-
-    private final NodeId nNodeId;
-    private final NetconfNode netconfNode;
-    private final MountPoint mountpoint;
-    private final DataBroker netconfNodeDataBroker;
-
-    public NetconfAccessorMock(NodeId nNodeId, NetconfNode netconfNode, MountPoint mountpoint,
-            DataBroker netconfNodeDataBroker) {
-        this.nNodeId = nNodeId;
-        this.netconfNode = netconfNode;
-        this.mountpoint = mountpoint;
-        this.netconfNodeDataBroker = netconfNodeDataBroker;
-    }
-
-    @Override
-    public NodeId getNodeId() {
-        return nNodeId;
-    }
-
-    @Override
-    public NetconfNode getNetconfNode() {
-        return netconfNode;
-    }
-
-    @Override
-    public Capabilities getCapabilites() {
-        return null;
-    }
-
-    @Override
-    public DataBroker getDataBroker() {
-        return netconfNodeDataBroker;
-    }
-
-    @Override
-    public MountPoint getMountpoint() {
-        return mountpoint;
-    }
-
-    @Override
-    public TransactionUtils getTransactionUtils() {
-        return null;
-    }
-
-    @Override
-    public <T extends NotificationListener> ListenerRegistration<NotificationListener> doRegisterNotificationListener(
-            @NonNull T listener) {
-        return null;
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<CreateSubscriptionOutput>> registerNotificationsStream(String streamName) {
-        return null;
-    }
-
-    @Override
-    public void registerNotificationsStream(List<Stream> streamList) {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public boolean isNCNotificationsSupported() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public List<Stream> getNotificationStreams() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/test/mock/TransactionUtilsMock.java b/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/test/mock/TransactionUtilsMock.java
deleted file mode 100644
index 9546ae9..0000000
--- a/sdnr/wt/devicemanager-onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/test/mock/TransactionUtilsMock.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2020 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==========================================================================
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.test.mock;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-import org.eclipse.jdt.annotation.Nullable;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class TransactionUtilsMock implements TransactionUtils {
-
-    @Override
-    public <T extends DataObject> @Nullable T readData(DataBroker dataBroker, LogicalDatastoreType dataStoreType,
-            InstanceIdentifier<T> iid) {
-        return null;
-    }
-
-    @Override
-    public <T extends DataObject> @Nullable T readDataOptionalWithStatus(DataBroker dataBroker,
-            LogicalDatastoreType dataStoreType, InstanceIdentifier<T> iid, AtomicBoolean noErrorIndication,
-            AtomicReference<String> statusIndicator) {
-        return null;
-    }
-
-}
diff --git a/sdnr/wt/devicemanager-openroadm/feature/pom.xml b/sdnr/wt/devicemanager-openroadm/feature/pom.xml
index ba21bbc..0ef0c08 100644
--- a/sdnr/wt/devicemanager-openroadm/feature/pom.xml
+++ b/sdnr/wt/devicemanager-openroadm/feature/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
diff --git a/sdnr/wt/devicemanager-openroadm/installer/pom.xml b/sdnr/wt/devicemanager-openroadm/installer/pom.xml
index 8f647d1..1aa53e4 100755
--- a/sdnr/wt/devicemanager-openroadm/installer/pom.xml
+++ b/sdnr/wt/devicemanager-openroadm/installer/pom.xml
@@ -20,14 +20,13 @@
   ~ ============LICENSE_END=======================================================
   ~
   -->
-
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
diff --git a/sdnr/wt/devicemanager-openroadm/model/pom.xml b/sdnr/wt/devicemanager-openroadm/model/pom.xml
index 9fd87c1..d40aafd 100644
--- a/sdnr/wt/devicemanager-openroadm/model/pom.xml
+++ b/sdnr/wt/devicemanager-openroadm/model/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
diff --git a/sdnr/wt/devicemanager-openroadm/pom.xml b/sdnr/wt/devicemanager-openroadm/pom.xml
index 7dc90ff..95b75ca 100755
--- a/sdnr/wt/devicemanager-openroadm/pom.xml
+++ b/sdnr/wt/devicemanager-openroadm/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -49,12 +49,12 @@
         <feature-name>sdnr-wt-devicemanager-openroadm</feature-name>
     </properties>
     <!--          <reporting>
-        <plugins>
+        <plugins>           
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-project-info-reports-plugin</artifactId>
                 <version>2.9</version>
-            </plugin>
-        </plugins>
+            </plugin>           
+        </plugins>    
     </reporting> -->
 </project>
diff --git a/sdnr/wt/devicemanager-openroadm/provider/pom.xml b/sdnr/wt/devicemanager-openroadm/provider/pom.xml
index 555ef9a..f5cfc6c 100644
--- a/sdnr/wt/devicemanager-openroadm/provider/pom.xml
+++ b/sdnr/wt/devicemanager-openroadm/provider/pom.xml
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
@@ -45,7 +45,6 @@
     </licenses>
 
     <properties>
-        <checkstyle.skip>true</checkstyle.skip> <!-- POM configuration -->
         <maven.javadoc.skip>true</maven.javadoc.skip>
         <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
         <buildtime>${maven.build.timestamp} UTC</buildtime>
@@ -60,8 +59,8 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>net.bytebuddy</groupId>
             <artifactId>byte-buddy</artifactId>
+            <groupId>net.bytebuddy</groupId>
             <version>1.9.10</version>
             <scope>test</scope>
         </dependency>
@@ -90,6 +89,11 @@
             <artifactId>sal-netconf-connector</artifactId>
             <scope>provided</scope>
         </dependency>
+                <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/DeviceManagerOpenroadmImpl.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/DeviceManagerOpenroadmImpl.java
index fc5aaba..e522f4b 100644
--- a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/DeviceManagerOpenroadmImpl.java
+++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/DeviceManagerOpenroadmImpl.java
@@ -62,7 +62,7 @@
 
         LOG.info("Session Initiated start {}", APPLICATION_NAME);
 
-        resOpenRoadm = netconfNetworkElementService.registerNetworkElementFactory(new OpenroadmNetworkElementFactory());
+        resOpenRoadm = netconfNetworkElementService.registerBindingNetworkElementFactory(new OpenroadmNetworkElementFactory());
 
 
         netconfNetworkElementService.writeToEventLog(APPLICATION_NAME, "startup", "done");
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 f1b3821..ccada31 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
@@ -29,7 +29,7 @@
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.ActiveAlarmList;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.OrgOpenroadmAlarmListener;
@@ -52,13 +52,13 @@
     // variables
     private Integer count = 1;
     private static final Logger log = LoggerFactory.getLogger(OrgOpenroadmAlarmListener.class);
-    private final NetconfAccessor netConfAccesor;
+    private final NetconfBindingAccessor netConfAccesor;
     private final @NonNull FaultService faultEventListener;
     private final DataProvider dataProvider;
     // end of variables
 
     // constructors
-    public InitialDeviceAlarmReader(NetconfAccessor accessor, DeviceManagerServiceProvider serviceProvider) {
+    public InitialDeviceAlarmReader(NetconfBindingAccessor accessor, DeviceManagerServiceProvider serviceProvider) {
         this.netConfAccesor = accessor;
         this.faultEventListener = serviceProvider.getFaultService();
         this.dataProvider = serviceProvider.getDataProvider();
@@ -105,7 +105,7 @@
     // private methods
 
     // Read Alarm Data
-    private ActiveAlarmList getActiveAlarmList(NetconfAccessor accessor) {
+    private ActiveAlarmList getActiveAlarmList(NetconfBindingAccessor accessor) {
         final Class<ActiveAlarmList> classAlarm = ActiveAlarmList.class;
         log.info("Get Alarm data for element {}", accessor.getNodeId().getValue());
         InstanceIdentifier<ActiveAlarmList> alarmDataIid = InstanceIdentifier.builder(classAlarm).build();
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 924af99..a79bed7 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
@@ -24,6 +24,8 @@
 import java.util.List;
 import org.eclipse.jdt.annotation.NonNull;
 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl;
 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.OrgOpenroadmAlarmListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.ChangeNotification;
@@ -31,6 +33,7 @@
 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.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
 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;
@@ -50,6 +53,7 @@
     private Integer counter = 1;
     private final NetconfAccessor netconfAccessor;
     private final DataProvider databaseProvider;
+    private static final NetconfTimeStamp ncTimeConverter = NetconfTimeStampImpl.getConverter();
     // end of variables
 
     // constructors
@@ -106,7 +110,8 @@
         EventlogBuilder eventlogBuilder = new EventlogBuilder();
         eventlogBuilder.setId(notification.getShelfId()).setAttributeName(notification.getShelfId())
                 .setObjectId(notification.getShelfId()).setNodeId(this.netconfAccessor.getNodeId().getValue())
-                .setCounter(counter).setNewValue(notification.getStatus().getName()).setSourceType(SourceType.Netconf);
+                .setCounter(counter).setNewValue(notification.getStatus().getName()).setSourceType(SourceType.Netconf)
+                .setTimestamp(new DateAndTime(ncTimeConverter.getTimeStamp()));
         databaseProvider.writeEventLog(eventlogBuilder.build());
         log.info("Create-techInfo Notification written ");
         counter++;
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 c62bb05..9618ce2 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
@@ -29,6 +29,7 @@
 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.rev201110.Inventory;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.InventoryBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,10 +54,11 @@
     // end of constructors
 
     // public methods
-    public Inventory getInventoryData(long treeLevel) {
+    public Inventory getInventoryData(Uint32 treeLevel) {
         InventoryBuilder inventoryBuilder = new InventoryBuilder();
         inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue())
-                .setUuid(this.openRoadmDevice.getInfo().getNodeId().getValue())
+                .setUuid(this.openRoadmDevice.getInfo().getNodeId() == null ? "N/A"
+                        : this.openRoadmDevice.getInfo().getNodeId().getValue())
                 .setDate(this.openRoadmDevice.getInfo().getCurrentDatetime().getValue())
                 .setId(this.openRoadmDevice.getInfo().getNodeId().getValue())
                 .setManufacturerIdentifier(this.openRoadmDevice.getInfo().getVendor())
@@ -69,7 +71,7 @@
         return inventoryBuilder.build();
     }
 
-    public Inventory getShelvesInventory(Shelves shelf, long treeLevel) {
+    public Inventory getShelvesInventory(Shelves shelf, Uint32 treeLevel) {
         InventoryBuilder inventoryBuilder = new InventoryBuilder();
         inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue()).setId(shelf.getShelfName())
                 .setDescription((shelf.getUserDescription() == null)
@@ -85,12 +87,16 @@
         return inventoryBuilder.build();
     }
 
-    public Inventory getInterfacesInventory(Interface deviceInterface, long treeLevel) {
+    public Inventory getInterfacesInventory(Interface deviceInterface, Uint32 treeLevel) {
         InventoryBuilder inventoryBuilder = new InventoryBuilder();
         inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue()).setId(deviceInterface.getName())
                 .setDescription((deviceInterface.getDescription() == null) ? "N/A" : deviceInterface.getDescription())
                 .setUuid(deviceInterface.getName()).setSerial(deviceInterface.getName())
-                .setParentUuid(deviceInterface.getSupportingCircuitPackName()).setTreeLevel(treeLevel)
+                .setParentUuid((deviceInterface.getSupportingCircuitPackName() != null)
+                        ? deviceInterface.getSupportingCircuitPackName()
+                        : ((deviceInterface.getSupportingInterface() != null) ? deviceInterface.getSupportingInterface()
+                                : this.openRoadmDevice.getInfo().getNodeId().getValue()))
+                .setTreeLevel(treeLevel)
                 .setTypeName((deviceInterface.getType() == null) ? "Interface"
                         : deviceInterface.getType().getName().substring(69,
                                 deviceInterface.getType().getName().length()))
@@ -102,7 +108,7 @@
         return inventoryBuilder.build();
     }
 
-    public Inventory getCircuitPackInventory(CircuitPacks circuitPack, long treeLevel) {
+    public Inventory getCircuitPackInventory(CircuitPacks circuitPack, Uint32 treeLevel) {
         InventoryBuilder inventoryBuilder = new InventoryBuilder();
         inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue()).setUuid(circuitPack.getCircuitPackName())
                 .setDate((circuitPack.getManufactureDate() == null) ? "N/A"
@@ -116,14 +122,14 @@
                 .setPartTypeId((circuitPack.getClei() == null) ? circuitPack.getType() : circuitPack.getClei())
                 .setParentUuid((circuitPack.getParentCircuitPack() != null)
                         ? circuitPack.getParentCircuitPack().getCircuitPackName()
-                        : (circuitPack.getShelf() != null) ? circuitPack.getShelf()
-                                : this.openRoadmDevice.getInfo().getNodeId().getValue());
+                        : ((circuitPack.getShelf() != null) ? circuitPack.getShelf()
+                                : this.openRoadmDevice.getInfo().getNodeId().getValue()));
         log.info("Inventory data written for CircuitPack {}", circuitPack.getCircuitPackName());
 
         return inventoryBuilder.build();
     }
 
-    public Inventory getXponderInventory(Xponder xpdr, long treeLevel) {
+    public Inventory getXponderInventory(Xponder xpdr, Uint32 treeLevel) {
         InventoryBuilder inventoryBuilder = new InventoryBuilder();
         inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue()).setId(xpdr.getXpdrNumber().toString())
                 .setDescription("Xponder\nLifecycleState: " + xpdr.getLifecycleState().getName())
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 bc82cd1..7b45c3e 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
@@ -26,13 +26,15 @@
 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;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
 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.http.org.openroadm.device.rev191129.OrgOpenroadmDevice;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.packs.CircuitPacks;
@@ -41,12 +43,14 @@
 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.rev201110.NetworkElementDeviceType;
+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.rev201110.EventlogBuilder;
 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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.NotificationListener;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -57,13 +61,11 @@
  *         search db
  *
  **/
-public class OpenroadmNetworkElement implements NetworkElement {
+public class OpenroadmNetworkElement extends OpenroadmNetworkElementBase {
 
     // variables
-    private final long equipmentLevel = 0;
+    private final long equipmentLevel = 1;
     private static final Logger log = LoggerFactory.getLogger(OpenroadmNetworkElement.class);
-    private final NetconfAccessor netconfAccessor;
-    private final DataProvider databaseService;
     private Hashtable<String, Long> circuitPacksRecord;
     private Hashtable<String, Long> shelfProvisionedcircuitPacks;
     private ListenerRegistration<NotificationListener> openRdmListenerRegistrationResult;
@@ -76,35 +78,42 @@
     private PmDataBuilderOpenRoadm openRoadmPmData;
     private InitialDeviceAlarmReader initialAlarmReader;
     private List<PmdataEntity> pmDataEntity = new ArrayList<PmdataEntity>();
+    private Optional<NetconfNotifications> notifications;
+    private static final NetconfTimeStamp ncTimeConverter = NetconfTimeStampImpl.getConverter();
+    private int counter = 1;
     // end of variables
 
     // constructors
-    public OpenroadmNetworkElement(NetconfAccessor netconfAccess, DeviceManagerServiceProvider serviceProvider) {
+    public OpenroadmNetworkElement(NetconfBindingAccessor netconfAccess, DeviceManagerServiceProvider serviceProvider) {
+
+        super(netconfAccess, serviceProvider);
+        
+        this.notifications = netconfAccess.getNotificationAccessor();
 
         log.info("Create {}", OpenroadmNetworkElement.class.getSimpleName());
-        this.netconfAccessor = netconfAccess;
-        this.databaseService = serviceProvider.getDataProvider();
         this.openRdmListenerRegistrationResult = null;
         this.openRdmListener = new OpenroadmChangeNotificationListener(netconfAccessor, databaseService);
         this.opnRdmFaultListenerRegistrationResult = null;
         this.opnRdmFaultListener = new OpenroadmFaultNotificationListener(netconfAccessor, serviceProvider);
         this.opnRdmDeviceListenerRegistrationResult = null;
         this.opnRdmDeviceListener = new OpenroadmDeviceChangeNotificationListener(netconfAccessor, databaseService);
-        this.opnRdmInventoryInput = new OpenroadmInventoryInput(netconfAccess, readDevice(netconfAccess));
         this.circuitPacksRecord = new Hashtable<String, Long>();
         this.shelfProvisionedcircuitPacks = new Hashtable<String, Long>();
         this.openRoadmPmData = new PmDataBuilderOpenRoadm(this.netconfAccessor);
         this.initialAlarmReader = new InitialDeviceAlarmReader(this.netconfAccessor, serviceProvider);
         log.info("NodeId {}", this.netconfAccessor.getNodeId().getValue());
-        log.info("oScaMapper details{}", this.opnRdmInventoryInput.getClass().getName());
+
 
     }
     // end of constructors
 
     // public methods
     public void initialReadFromNetworkElement() {
+
         OrgOpenroadmDevice device = readDevice(this.netconfAccessor);
-        databaseService.writeInventory(this.opnRdmInventoryInput.getInventoryData(equipmentLevel));
+        this.opnRdmInventoryInput = new OpenroadmInventoryInput(this.netconfAccessor, device);
+        log.info("oScaMapper details{}", this.opnRdmInventoryInput.getClass().getName());
+        databaseService.writeInventory(this.opnRdmInventoryInput.getInventoryData(Uint32.valueOf(equipmentLevel)));
 
         readShelvesData(device);
         readXpndrData(device);
@@ -122,13 +131,8 @@
         } else {
             log.info("PmDatEntity is empty");
         }
-
     }
 
-    @Override
-    public NetworkElementDeviceType getDeviceType() {
-        return NetworkElementDeviceType.OROADM;
-    }
 
     @Override
     public void register() {
@@ -140,8 +144,7 @@
         this.opnRdmDeviceListenerRegistrationResult =
                 netconfAccessor.doRegisterNotificationListener(opnRdmDeviceListener);
         // Register netconf stream
-        netconfAccessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream);
-
+        notifications.get().registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream);
     }
 
     @Override
@@ -157,23 +160,6 @@
         }
     }
 
-    @Override
-    public NodeId getNodeId() {
-        return netconfAccessor.getNodeId();
-    }
-
-    @Override
-    public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) {
-        return Optional.empty();
-    }
-
-    @Override
-    public void warmstart() {}
-
-    @Override
-    public Optional<NetconfAccessor> getAcessor() {
-        return Optional.of(netconfAccessor);
-    }
     // end of public methods
 
     // private methods
@@ -187,12 +173,12 @@
                         shelf.getShelfName(), shelf.getSerialId(), shelf.getProductCode(), shelf.getShelfPosition(),
                         shelf.getEquipmentState(), shelf.getHardwareVersion(), shelf.getShelfType(), shelf.getVendor(),
                         shelf.getLifecycleState());
-                databaseService
-                        .writeInventory(this.opnRdmInventoryInput.getShelvesInventory(shelf, equipmentLevel + 1));
+                databaseService.writeInventory(
+                        this.opnRdmInventoryInput.getShelvesInventory(shelf, Uint32.valueOf(equipmentLevel + 1)));
                 Collection<Slots> slotList = YangHelper.getCollection(shelf.getSlots());
                 if (slotList != null) {
                     for (Slots slot : slotList) {
-                        if (!slot.getProvisionedCircuitPack().isEmpty()) {
+                        if (slot.getProvisionedCircuitPack() != null) {
                             this.shelfProvisionedcircuitPacks.put(slot.getProvisionedCircuitPack(), equipmentLevel + 2);
                         }
                         log.info("Slots for the shelf: {}", shelf.getShelfName());
@@ -200,87 +186,106 @@
                                 slot.getSlotStatus(), slot.getLabel());
                     }
                 }
-                log.info("size of shelfProvisionedcircuitPacks: {} ", shelfProvisionedcircuitPacks.size());
-
             }
-
+            log.info("size of shelfProvisionedcircuitPacks: {} ", shelfProvisionedcircuitPacks.size());
         }
+
     }
 
     private void readXpndrData(OrgOpenroadmDevice device) {
         Collection<Xponder> xponderList = YangHelper.getCollection(device.getXponder());
+
         if (xponderList != null) {
             for (Xponder xponder : xponderList) {
-                databaseService
-                        .writeInventory(this.opnRdmInventoryInput.getXponderInventory(xponder, equipmentLevel + 1));
+
+                databaseService.writeInventory(
+                        this.opnRdmInventoryInput.getXponderInventory(xponder, Uint32.valueOf(equipmentLevel + 1)));
                 log.info("Xponders: No.: {} , \n Port: {} ,\n Type: {}", xponder.getXpdrNumber(), xponder.getXpdrPort(),
                         xponder.getXpdrType());
                 Collection<XpdrPort> xpdrportlist = YangHelper.getCollection(xponder.getXpdrPort());
                 if (xpdrportlist != null) {
                     for (XpdrPort xpdrport : xpdrportlist)
-                        if (!xpdrport.getCircuitPackName().isEmpty()) {
+                        if (xpdrport.getCircuitPackName() != null) {
                             this.shelfProvisionedcircuitPacks.put(xpdrport.getCircuitPackName(), equipmentLevel + 2);
                             log.info("Size of dict{}", this.shelfProvisionedcircuitPacks.size());
                         }
-
-
                 }
-            }
 
+            }
         }
     }
 
     private void readCircuitPacketData(OrgOpenroadmDevice device) {
         Collection<CircuitPacks> circuitpacklist = YangHelper.getCollection(device.getCircuitPacks());
+        List<String> cpNames = new ArrayList<String>();
 
         if (circuitpacklist != null) {
             for (CircuitPacks cp : circuitpacklist) {
+                cpNames.add(cp.getCircuitPackName());
+
                 log.info("CP Name:{}", cp.getCircuitPackName());
-                if (!this.shelfProvisionedcircuitPacks.isEmpty()
-                        && this.shelfProvisionedcircuitPacks.containsKey(cp.getCircuitPackName())) {
 
-                    this.circuitPacksRecord.put(cp.getCircuitPackName(), (equipmentLevel + 2));
-                    databaseService.writeInventory(this.opnRdmInventoryInput.getCircuitPackInventory(cp,
-                            this.shelfProvisionedcircuitPacks.get(cp.getCircuitPackName())));
-                    log.info("shelf has circuit pack");
+                if (cp.getParentCircuitPack() == null
+                        && !this.shelfProvisionedcircuitPacks.containsKey(cp.getCircuitPackName())) {
+                    log.info("cp has no parent and no shelf");
+                    this.circuitPacksRecord.put(cp.getCircuitPackName(), (equipmentLevel + 1));
+                    databaseService.writeInventory(
+                            this.opnRdmInventoryInput.getCircuitPackInventory(cp, Uint32.valueOf(equipmentLevel + 1)));
                 } else {
-                    if (cp.getParentCircuitPack() == null) {
-                        this.circuitPacksRecord.put(cp.getCircuitPackName(), (equipmentLevel + 1));
-                        databaseService.writeInventory(
-                                this.opnRdmInventoryInput.getCircuitPackInventory(cp, equipmentLevel + 1));
-                        log.info("Cp has no parent circuit pack and no shelf");
+                    //                check for missing valid parent circuit name
+                    if (cp.getParentCircuitPack().getCpSlotName() != null
+                            && cp.getParentCircuitPack().getCircuitPackName() == null) {
 
+                        log.info("Cp {} has slotname of the parent circuit pack  but no parent circuit pack name",
+                                cp.getCircuitPackName());
+                        this.circuitPacksRecord.put(cp.getCircuitPackName(), (equipmentLevel + 3));
+                        databaseService.writeInventory(this.opnRdmInventoryInput.getCircuitPackInventory(cp,
+                                Uint32.valueOf(equipmentLevel + 3)));
+                        databaseService.writeEventLog(writeIncorrectParentLog(cp.getCircuitPackName(), counter)
+                                .setObjectId(device.getInfo().getNodeId().getValue())
+                                .setId(cp.getParentCircuitPack().getCpSlotName())
+                                .setNewValue("Missing parent circuit pack name").build());
+                    } else if (cp.getParentCircuitPack().getCircuitPackName() != null
+                            && this.shelfProvisionedcircuitPacks
+                                    .containsKey(cp.getParentCircuitPack().getCircuitPackName())) {
+                        log.info("Cp {} has parent circuit pack and shelf", cp.getCircuitPackName());
+                        this.circuitPacksRecord.put(cp.getCircuitPackName(), (equipmentLevel + 3));
+                        databaseService.writeInventory(this.opnRdmInventoryInput.getCircuitPackInventory(cp,
+                                Uint32.valueOf(equipmentLevel + 3)));
                     } else {
-                        if (this.shelfProvisionedcircuitPacks
-                                .containsKey(cp.getParentCircuitPack().getCircuitPackName())) {
-                            this.circuitPacksRecord.put(cp.getCircuitPackName(), (equipmentLevel + 3));
-                            databaseService.writeInventory(
-                                    this.opnRdmInventoryInput.getCircuitPackInventory(cp, equipmentLevel + 3));
-                            log.info("Cp {} has parent circuit pack and shelf", cp.getCircuitPackName());
-                        } else {
-                            this.circuitPacksRecord.put(cp.getCircuitPackName(), (equipmentLevel + 2));
-                            databaseService.writeInventory(
-                                    this.opnRdmInventoryInput.getCircuitPackInventory(cp, equipmentLevel + 2));
-                            log.info("Cp {} has parent circuit pack but no shelf", cp.getCircuitPackName());
-
+                        //                check for incorrect hierarchy
+                        if (cp.getParentCircuitPack().getCircuitPackName() != null
+                                && !cpNames.contains(cp.getParentCircuitPack().getCircuitPackName())) {
+                            databaseService.writeEventLog(writeIncorrectParentLog(cp.getCircuitPackName(), counter)
+                                    .setObjectId(device.getInfo().getNodeId().getValue())
+                                    .setId(cp.getParentCircuitPack().getCpSlotName()).build());
                         }
-
-
+                        log.info("Cp has parent circuit pack but no shelf or a shelf but no parent circuit pack");
+                        this.circuitPacksRecord.put(cp.getCircuitPackName(), (equipmentLevel + 2));
+                        databaseService.writeInventory(this.opnRdmInventoryInput.getCircuitPackInventory(cp,
+                                Uint32.valueOf(equipmentLevel + 2)));
                     }
+
                 }
-
-
             }
 
-        }
 
+            //            for (String s : cpParentNames) {
+            //                log.info("Parent cps {}:", s);
+            //
+            //                if (!cpNames.contains(s)) {
+            //                    log.info("Invalid Hierarchy detected for {}", s);
+            //                    databaseService.writeEventLog(writeIncorrectParentLog(s, counter)
+            //                            .setObjectId(device.getInfo().getNodeId().getValue()).setId(s).build());
+            //                }
+            //            }
+        }
     }
 
     private void readInterfaceData(OrgOpenroadmDevice device) {
         Collection<Interface> interfaceList = YangHelper.getCollection(device.getInterface());
         if (interfaceList != null) {
             for (Interface deviceInterface : interfaceList) {
-
                 log.info("\n InterfaceName: {}", deviceInterface.getName());
                 log.info("Supporting CP {}", this.circuitPacksRecord.size());
                 for (String s : this.circuitPacksRecord.keySet()) {
@@ -288,35 +293,38 @@
                 }
                 log.info("Interface {} and their supporting CP {}", deviceInterface.getName(),
                         deviceInterface.getSupportingCircuitPackName());
-
-
                 if (deviceInterface.getSupportingCircuitPackName() != null) {
                     if (this.circuitPacksRecord.containsKey(deviceInterface.getSupportingCircuitPackName())) {
                         databaseService.writeInventory(this.opnRdmInventoryInput.getInterfacesInventory(deviceInterface,
-                                this.circuitPacksRecord.get(deviceInterface.getSupportingCircuitPackName()) + 1));
+                                Uint32.valueOf(
+                                        this.circuitPacksRecord.get(deviceInterface.getSupportingCircuitPackName())
+                                                + 1)));
                     }
-
                 } else {
-                    databaseService.writeInventory(
-                            this.opnRdmInventoryInput.getInterfacesInventory(deviceInterface, equipmentLevel + 1));
+                    databaseService.writeInventory(this.opnRdmInventoryInput.getInterfacesInventory(deviceInterface,
+                            Uint32.valueOf(equipmentLevel + 1)));
                 }
             }
         }
-
     }
 
-    private OrgOpenroadmDevice readDevice(NetconfAccessor accessor) {
-
+    private OrgOpenroadmDevice readDevice(NetconfBindingAccessor accessor) {
         final Class<OrgOpenroadmDevice> openRoadmDev = OrgOpenroadmDevice.class;
         InstanceIdentifier<OrgOpenroadmDevice> deviceId = InstanceIdentifier.builder(openRoadmDev).build();
-
         OrgOpenroadmDevice device = accessor.getTransactionUtils().readData(accessor.getDataBroker(),
                 LogicalDatastoreType.OPERATIONAL, deviceId);
-
         return device;
+    }
+
+    private EventlogBuilder writeIncorrectParentLog(String attributeName, Integer counter) {
+        EventlogBuilder eventlogBuilder = new EventlogBuilder();
+        eventlogBuilder.setAttributeName(attributeName).setCounter(counter)
+                .setNodeId(this.netconfAccessor.getNodeId().getValue()).setSourceType(SourceType.Netconf)
+                .setNewValue("Invalid parent circuit-pack name")
+                .setTimestamp(new DateAndTime(ncTimeConverter.getTimeStamp()));
+
+        return eventlogBuilder;
 
     }
     // end of private methods
-
-
 }
diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementBase.java b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementBase.java
new file mode 100644
index 0000000..9949056
--- /dev/null
+++ b/sdnr/wt/devicemanager-openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementBase.java
@@ -0,0 +1,74 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ *
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl;
+
+import java.util.Optional;
+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.DeviceManagerServiceProvider;
+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.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;
+
+public class OpenroadmNetworkElementBase implements NetworkElement {
+
+    protected final NetconfBindingAccessor netconfAccessor;
+    protected final DataProvider databaseService;
+
+    public OpenroadmNetworkElementBase(NetconfBindingAccessor netconfAccess,
+            DeviceManagerServiceProvider serviceProvider) {
+
+        this.netconfAccessor = netconfAccess;
+        this.databaseService = serviceProvider.getDataProvider();
+    }
+
+    @Override
+    public void register() {}
+
+    @Override
+    public void deregister() {}
+
+    @Override
+    public void warmstart() {}
+
+    @Override
+    public NodeId getNodeId() {
+        return netconfAccessor.getNodeId();
+    }
+
+    @Override
+    public NetworkElementDeviceType getDeviceType() {
+        return NetworkElementDeviceType.OROADM;
+    }
+
+    @Override
+    public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) {
+        return Optional.empty();
+    }
+
+    @Override
+    public Optional<NetconfAccessor> getAcessor() {
+        return Optional.of(netconfAccessor);
+    }
+}
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 5e16401..cc8eaa6 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
@@ -27,6 +27,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.NetconfAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.OrgOpenroadmDevice;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,16 +47,24 @@
 
     // public methods
     @Override
-    public Optional<NetworkElement> create(NetconfAccessor acessor, DeviceManagerServiceProvider serviceProvider) {
+    public Optional<NetworkElement> create(NetconfAccessor accessor, DeviceManagerServiceProvider serviceProvider) {
 
-        if (acessor.getCapabilites().isSupportingNamespace(OrgOpenroadmDevice.QNAME)) {
+        if (accessor.getCapabilites().isSupportingNamespaceAndRevision(OrgOpenroadmDevice.QNAME)) {
             log.info("Create OpenRoadm device {} ", OpenroadmNetworkElement.class.getName());
-            log.info("Node Id read by Acessor {}:", acessor.getNodeId().getValue());
-
-            return Optional.of(new OpenroadmNetworkElement(acessor, serviceProvider));
-        } else {
-            return Optional.empty();
-        }
+            log.info("Node Id read by Acessor {}:", accessor.getNodeId().getValue());
+            Optional<NetconfBindingAccessor> bindingAccessor = accessor.getNetconfBindingAccessor();
+            if (bindingAccessor.isPresent()) {
+                return Optional.of(new OpenroadmNetworkElement(bindingAccessor.get(), serviceProvider));
+            }
+        } else if (accessor.getCapabilites().isSupportingNamespaceAndRevision("http://org/openroadm/device","2018-10-19")) {
+            log.info("Create OpenRoadm base device {} ", OpenroadmNetworkElementBase.class.getName());
+            log.info("Node Id read by Acessor {}:", accessor.getNodeId().getValue());
+            Optional<NetconfBindingAccessor> bindingAccessor = accessor.getNetconfBindingAccessor();
+            if (bindingAccessor.isPresent()) {
+                return Optional.of(new OpenroadmNetworkElementBase(bindingAccessor.get(), serviceProvider));
+            }
+        } 
+        return Optional.empty();
     }
     // end of public methods
 
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 b75e4c6..7ad2003 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
@@ -21,24 +21,39 @@
  */
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl;
 
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 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.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.HistoricalPmList;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.group.HistoricalPm;
 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.PmDataType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmGranularity;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmNamesEnum;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.g836.pm.types.rev200413.ErroredSecond;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.g836.pm.types.rev200413.SeverelyErroredSecond;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.openroadm.pm.types.rev200413.PerformanceMeasurementTypeId;
 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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.grp.MeasurementBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.grp.MeasurementKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.PerformanceMeasurementUnitId;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -51,10 +66,11 @@
     // variables
     private static final Logger log = LoggerFactory.getLogger(OpenroadmNetworkElement.class);
     private PmdataEntityBuilder pmDataBuilder;
+    private Bundle b = FrameworkUtil.getBundle(this.getClass());
 
     // end of variables
     // constructors
-    public PmDataBuilderOpenRoadm(NetconfAccessor accessor) {
+    public PmDataBuilderOpenRoadm(NetconfBindingAccessor accessor) {
         this.pmDataBuilder = new PmdataEntityBuilder();
         this.pmDataBuilder.setNodeName(accessor.getNodeId().getValue());
     }
@@ -62,7 +78,7 @@
     // end of constructors
     // public methods
     // Read PM data
-    public HistoricalPmList getPmData(NetconfAccessor accessor) {
+    public HistoricalPmList getPmData(NetconfBindingAccessor accessor) {
         final Class<HistoricalPmList> pmDataClass = HistoricalPmList.class;
         log.info("Get PM data for element {}", accessor.getNodeId().getValue());
         InstanceIdentifier<HistoricalPmList> pmDataIid = InstanceIdentifier.builder(pmDataClass).build();
@@ -74,17 +90,24 @@
     // Build PM entity for writing into the database
     public List<PmdataEntity> buildPmDataEntity(HistoricalPmList historicalPmEnitityList) {
         List<PmdataEntity> pmEntitiyList = new ArrayList<>();
-        Collection<HistoricalPmEntry> pmDataEntryList = YangHelper.getCollection(historicalPmEnitityList.getHistoricalPmEntry());
+        Collection<HistoricalPmEntry> pmDataEntryList =
+                YangHelper.getCollection(historicalPmEnitityList.getHistoricalPmEntry());
         for (HistoricalPmEntry pmDataEntry : pmDataEntryList) {
             pmDataBuilder.setUuidInterface(pmDataEntry.getPmResourceType().getName());
             Collection<HistoricalPm> historicalPmList = YangHelper.getCollection(pmDataEntry.getHistoricalPm());
             for (HistoricalPm historicalPm : historicalPmList) {
                 log.info("PmName:{}", historicalPm.getType());
-                this.pmDataBuilder.setScannerId(historicalPm.getType().getName());
-                writeperformanceData(historicalPm);
-                log.info("NodeName: {}, Scanner Id:{}, Period: {}", this.pmDataBuilder.getNodeName(),
-                        this.pmDataBuilder.getScannerId(), this.pmDataBuilder.getGranularityPeriod().getName());
+                //              pmDataBuilder.setPerformanceData(value)
+
+                try {
+                    writeperformanceData(historicalPm);
+                } catch (ClassNotFoundException e) {
+                    log.info("No relevant data found");
+                }
+                //              log.info("NodeName: {}, Scanner Id:{}, Period: {}", this.getNodeName(),
+                //                      this.getScannerId(), this.getGranularityPeriod().getName());
                 pmEntitiyList.add(this.pmDataBuilder.build());
+
                 log.info("PmListSize before db writing: {}", pmEntitiyList.size());
             }
             log.info("PmListSize before db writing: {}", pmEntitiyList.size());
@@ -94,21 +117,32 @@
     // end of public methods
 
     // private methods
-    private void writeperformanceData(HistoricalPm historicalPm) {
+    private void writeperformanceData(HistoricalPm historicalPm) throws ClassNotFoundException {
         Collection<Measurement> measurementList = YangHelper.getCollection(historicalPm.getMeasurement());
-
+          Map<MeasurementKey, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.grp.Measurement> measurementMap=new HashMap<MeasurementKey, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.grp.Measurement>();
+        // Map Performance data of PmDataEntity with MeasurmentData-HistoricalPm
+        PerformanceDataBuilder performanceDataBuilder = new PerformanceDataBuilder();
         for (Measurement measurementData : measurementList) {
             this.pmDataBuilder.setGranularityPeriod(mapGranularityPeriod(measurementData.getGranularity()))
-                    .setPerformanceData(getPerformancedata(measurementData))
                     .setTimeStamp(measurementData.getCompletionTime());
             if (measurementData.getValidity().getName().equals("suspect")) {
                 this.pmDataBuilder.setSuspectIntervalFlag(true);
             }
-            log.info("Time:d{}, \n Scannerid: {}, \n UUID: {}", this.pmDataBuilder.getGranularityPeriod().getName(),
-                    this.pmDataBuilder.getScannerId(), this.pmDataBuilder.getUuidInterface());
+            measurementMap.put(new MeasurementKey(measurementBuilder(historicalPm.getType(), measurementData.getPmParameterUnit(),
+                    measurementData.getPmParameterValue()).getPmKey()), measurementBuilder(historicalPm.getType(), measurementData.getPmParameterUnit(),
+                    measurementData.getPmParameterValue()));
+
+
+
+            //    log.info("Time:d{}, \n Scannerid: {}, \n UUID: {}", this.getGranularityPeriod().getName(),
+            //          pmDataBuilder.getScannerId(), this.getUuidInterface());
         }
+
+        pmDataBuilder.setPerformanceData(performanceDataBuilder.setMeasurement(measurementMap).build());
     }
 
+
+
     //Map Performance data of PmDataEntity with  MeasurmentData-HistoricalPm
     private PerformanceData getPerformancedata(Measurement measurementData) {
         PerformanceData performanceData;
@@ -138,5 +172,124 @@
         }
         return granPeriod;
     }
+
+    private List<Class<? extends PerformanceMeasurementTypeId>> setMeasurementTypeId() throws ClassNotFoundException {
+        String packageName =
+                "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.openroadm.pm.types.rev200413";
+        String packageName1 =
+                "/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/data/provider/openroadm/pm/types/rev200413/";
+        List<Class<? extends PerformanceMeasurementTypeId>> measTypeObjList =
+                new ArrayList<Class<? extends PerformanceMeasurementTypeId>>();
+        URL root = Thread.currentThread().getContextClassLoader().getResource(packageName1);
+
+        log.info("path for type package: {}", root);
+
+        Enumeration<URL> results = getFileURL(b, packageName);
+        log.info("FOund Packages {}", results);
+        while (results.hasMoreElements()) {
+            URL path = results.nextElement();
+            //          log.info("Enumeration URL-file {}", path.getFile());
+            //          log.info("Enumeration URL-String {}", path.toString());
+            Class<?> cls1 = loadClass(b, path.getFile());
+
+            if (PerformanceMeasurementTypeId.class.isAssignableFrom(cls1)) {
+                measTypeObjList.add((Class<? extends PerformanceMeasurementTypeId>) cls1);
+            }
+            log.info("Class Added {}", cls1.getSimpleName());
+
+        }
+
+        return measTypeObjList;
+    }
+
+    private List<Class<? extends PerformanceMeasurementUnitId>> setMeasurementUnit() throws ClassNotFoundException {
+        String packageName =
+                "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413";
+        List<Class<? extends PerformanceMeasurementUnitId>> measUnitObjList =
+                new ArrayList<Class<? extends PerformanceMeasurementUnitId>>();
+        URL root = Thread.currentThread().getContextClassLoader().getResource(packageName.replace(".", "/"));
+        log.info("path for unit package{}", root);
+
+        Enumeration<URL> results_unit = getFileURL(b, packageName);
+        log.info("FOund Packages {}", results_unit);
+        while (results_unit.hasMoreElements()) {
+            URL path = results_unit.nextElement();
+            Class<?> cls1 = loadClass(b, path.getFile());
+            if (PerformanceMeasurementUnitId.class.isAssignableFrom(cls1)) {
+                measUnitObjList.add((Class<? extends PerformanceMeasurementUnitId>) cls1);
+            }
+            log.info("Class Added {}", cls1.getSimpleName());
+
+        }
+
+        return measUnitObjList;
+    }
+
+    private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.grp.Measurement measurementBuilder(
+            PmNamesEnum pmType, String pmUnit, PmDataType pmDataType) throws ClassNotFoundException {
+
+        MeasurementBuilder measBuilder = new MeasurementBuilder();
+        if (pmType.getName() == "erroredSeconds") {
+            measBuilder.setPmKey(ErroredSecond.class);
+        } else if (pmType.getName() == "severelyErroredSeconds") {
+            measBuilder.setPmKey(SeverelyErroredSecond.class);
+        } else {
+            for (Class<? extends PerformanceMeasurementTypeId> obj : setMeasurementTypeId()) {
+                if (obj.toString().contains(pmType.name())) {
+                    measBuilder.setPmKey(obj);
+                }
+            }
+        }
+        for (Class<? extends PerformanceMeasurementUnitId> obj : setMeasurementUnit()) {
+            if (obj.toString().contains(pmUnit)) {
+                measBuilder.setPmUnit(obj);
+            }
+        }
+        measBuilder.setPmValue(pmDataType);
+        return measBuilder.build();
+
+    }
+
+    private Class<?> loadClass(Bundle bundle, String classFilePath) {
+        String className = classFilePath.replaceFirst("^/", "").replace('/', '.').replaceFirst(".class$", "");
+        try {
+            return bundle.loadClass(className);
+        } catch (Throwable e) {
+            log.info(String.format("Class [%s] could not be loaded. Message: [%s].", className, e.getMessage()));
+        }
+        return null;
+    }
+
+    private static Enumeration<URL> getFileURL(Bundle b, String classPath) {
+
+        BundleContext context = b == null ? null : b.getBundleContext();
+        if (context == null) {
+            log.info("no bundle context available");
+            return null;
+        }
+        Bundle[] bundles = context.getBundles();
+        if (bundles == null || bundles.length <= 0) {
+            log.info("no bundles found");
+            return null;
+        }
+        log.info("found {} bundles", bundles.length);
+        Enumeration<URL> resultUrl = null;
+
+        for (Bundle bundle : bundles) {
+            resultUrl = bundle.findEntries("/" + classPath.replace(".", "/"), "*.class", false);
+            //          resultUrl = bundle.getEntryPaths("/" + classPath.replace(".", "/"));
+            if (resultUrl != null) {
+                b = bundle;
+                break;
+
+            }
+
+        }
+
+        return resultUrl;
+    }
+
+
     // end of private methods
 }
+
diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestDeviceManagerOpenRoadmImpl.java b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestDeviceManagerOpenRoadmImpl.java
index 0f3401b..9967f78 100644
--- a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestDeviceManagerOpenRoadmImpl.java
+++ b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestDeviceManagerOpenRoadmImpl.java
@@ -22,23 +22,13 @@
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test;
 
 import static org.mockito.Mockito.mock;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl.DeviceManagerOpenroadmImpl;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class TestDeviceManagerOpenRoadmImpl {
-    private static Path KARAF_ETC = Paths.get("etc");
-    private static final Logger log = LoggerFactory.getLogger(TestDeviceManagerOpenRoadmImpl.class);
     DeviceManagerOpenroadmImpl devMgrOpenRdmImpl;
     NetconfNetworkElementService netcnfNtwrkElmntSrvc;
 
@@ -50,9 +40,7 @@
 
     @Test
     public void test() throws Exception {
-
         devMgrOpenRdmImpl.setNetconfNetworkElementService(netcnfNtwrkElmntSrvc);
-
     }
 
     @After
@@ -60,22 +48,4 @@
         devMgrOpenRdmImpl.close();
     }
 
-    private static void delete(Path etc) throws IOException {
-        if (Files.exists(etc)) {
-            System.out.println("Found, removing:" + etc.toString());
-            delete(etc.toFile());
-        }
-    }
-
-    private static void delete(File f) throws IOException {
-        if (f.isDirectory()) {
-            for (File c : f.listFiles()) {
-                delete(c);
-            }
-        }
-        if (!f.delete()) {
-            throw new FileNotFoundException("Failed to delete file: " + f);
-        }
-    }
-
 }
diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmInventory.java b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmInventory.java
index f63eeb8..607e9ac 100644
--- a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmInventory.java
+++ b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmInventory.java
@@ -44,6 +44,9 @@
 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.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -58,8 +61,8 @@
             .setCurrentIpAddress(ipAddress).setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20")))
             .setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20"))).setNodeType(NodeTypes.Rdm)
             .setCurrentDatetime(new DateAndTime("2017-10-22T15:23:43Z")).setSoftwareVersion("swversion1234")
-            .setPrefixLength((short) 28).setMaxDegrees(2).setMaxSrgs(3).setMaxNumBin15minHistoricalPm(32)
-            .setMaxNumBin24hourHistoricalPm(7).setOpenroadmVersion(OpenroadmVersionType._20).build();
+            .setPrefixLength(Uint8.valueOf(28)).setMaxDegrees(Uint16.valueOf(2)).setMaxSrgs(Uint16.valueOf(3)).setMaxNumBin15minHistoricalPm(Uint16.valueOf(32))
+            .setMaxNumBin24hourHistoricalPm(Uint16.valueOf(7)).setOpenroadmVersion(OpenroadmVersionType._20).build();
 
     private OrgOpenroadmDevice device = mock(OrgOpenroadmDevice.class);;
     private Shelves shelf = mock(Shelves.class);
@@ -73,7 +76,7 @@
         when(accessor.getNodeId()).thenReturn(nodeId);
         when(device.getInfo()).thenReturn(info);
 
-        roadmInventory.getInventoryData(value1);
+        roadmInventory.getInventoryData(Uint32.valueOf(value1));
         assertEquals(device.getInfo(), info);
 
     }
@@ -92,7 +95,7 @@
         when(shelf.getModel()).thenReturn("1");
         when(shelf.getHardwareVersion()).thenReturn("0.1");
         when(shelf.getManufactureDate()).thenReturn(new DateAndTime("2017-10-22T15:23:43Z"));
-        roadmInventory.getShelvesInventory(shelf, (value1 + 1));
+        roadmInventory.getShelvesInventory(shelf, Uint32.valueOf(value1 + 1));
         LOG.info("Shelves test completed");
 
     }
@@ -110,7 +113,7 @@
         when(cp.getProductCode()).thenReturn("oooooo");
         when(cp.getCircuitPackMode()).thenReturn("inServiceMode");
         when(device.getInfo()).thenReturn(info);
-        roadmInventory.getCircuitPackInventory(cp, value1 + 1);
+        roadmInventory.getCircuitPackInventory(cp, Uint32.valueOf(value1 + 1));
 
     }
 
@@ -121,17 +124,17 @@
         when(interfaces.getDescription()).thenReturn("Ethernet Interface");
         when(interfaces.getSupportingCircuitPackName()).thenReturn("1/0");
         when(device.getInfo()).thenReturn(info);
-        roadmInventory.getInterfacesInventory(interfaces, value1 + 2);
+        roadmInventory.getInterfacesInventory(interfaces, Uint32.valueOf(value1 + 2));
     }
 
     @Test
     public void TestXponder() {
-        when(xpdr.getXpdrNumber()).thenReturn(1);
+        when(xpdr.getXpdrNumber()).thenReturn(Uint16.valueOf(1));
         when(xpdr.getXpdrType()).thenReturn(XpdrNodeTypes.Mpdr);
         when(xpdr.getLifecycleState()).thenReturn(LifecycleState.Deployed);
         when(accessor.getNodeId()).thenReturn(nodeId);
         when(device.getInfo()).thenReturn(info);
-        roadmInventory.getXponderInventory(xpdr, value1 + 1);
+        roadmInventory.getXponderInventory(xpdr, Uint32.valueOf(value1 + 1));
 
     }
 
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 ce03a93..794c2eb 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
@@ -1,272 +1,304 @@
-/*
- * ============LICENSE_START=======================================================
- * ONAP : ccsdk features
- * ================================================================================
- * Copyright (C) 2020 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=========================================================
- *
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import java.math.BigInteger;
-import java.util.Arrays;
-import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl.OpenroadmInventoryInput;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl.OpenroadmNetworkElement;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
-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.TransactionUtils;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.ActiveAlarmList;
-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.http.org.openroadm.alarm.rev191129.alarm.ProbableCauseBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.alarm.ResourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev191129.NodeIdType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.LifecycleState;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev191129.OpenroadmVersionType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.pack.ParentCircuitPack;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.packs.CircuitPacks;
-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.Info;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.org.openroadm.device.InfoBuilder;
-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.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.types.rev191129.NodeTypes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.XpdrNodeTypes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.HistoricalPmList;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.group.HistoricalPm;
-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.PmDataType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmGranularity;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmNamesEnum;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.Validity;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.probablecause.rev191129.ProbableCauseEnum;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev191129.resource.DeviceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev191129.ResourceTypeEnum;
-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.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;
-
-public class TestOpenRoadmNetworkElement {
-
-    NetconfAccessor accessor = mock(NetconfAccessor.class);
-    DeviceManagerServiceProvider serviceProvider = mock(DeviceManagerServiceProvider.class);
-    DataProvider dataprovider = mock(DataProvider.class);
-    Capabilities capabilities = mock(Capabilities.class);
-    TransactionUtils transactionUtils = mock(TransactionUtils.class);
-    DataBroker dataBroker = mock(DataBroker.class);
-    // OscaNetworkElement optionalNe = mock(OscaNetworkElement.class);
-
-    FaultService faultService = mock(FaultService.class);
-    OrgOpenroadmDevice device;
-    // OscaInventoryInput inventoryData = mock(OscaInventoryInput.class);
-    OpenroadmInventoryInput inventoryData;
-    private Inventory equipment = mock(Inventory.class);
-    long level = 1;
-    private Shelves shelf = mock(Shelves.class);
-    private List<Shelves> shelfList;
-    private CircuitPacks cp, cp1, cp2, cp3;
-    private Interface interfaces = mock(Interface.class);
-    private Xponder xpdr = mock(Xponder.class);
-    private IpAddress ipAddress = new IpAddress(new Ipv4Address("127.0.0.11"));
-    private Info info = new InfoBuilder().setNodeId(NodeIdType.getDefaultInstance("zNhe2i5")).setClli("NodeB")
-            .setSerialId("0002").setModel("model2").setVendor("VendorA").setCurrentIpAddress(ipAddress)
-            .setCurrentIpAddress(ipAddress).setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20")))
-            .setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20"))).setNodeType(NodeTypes.Rdm)
-            .setCurrentDatetime(new DateAndTime("2017-10-22T15:23:43Z")).setSoftwareVersion("swversion1234")
-            .setPrefixLength((short) 28).setMaxDegrees(2).setMaxSrgs(3).setMaxNumBin15minHistoricalPm(32)
-            .setMaxNumBin24hourHistoricalPm(7).setOpenroadmVersion(OpenroadmVersionType._20).build();
-    private ActiveAlarmList alarmList = mock(ActiveAlarmList.class);
-    private ActiveAlarms activeAlarms = mock(ActiveAlarms.class);
-    private HistoricalPmList pmDataList = mock(HistoricalPmList.class);
-    private HistoricalPm historicalPm = mock(HistoricalPm.class);
-    @Before
-    public void init() {
-        when(accessor.getCapabilites()).thenReturn(capabilities);
-        when(serviceProvider.getFaultService()).thenReturn(faultService);
-        when(serviceProvider.getDataProvider()).thenReturn(dataprovider);
-        NodeId nNodeId = new NodeId("RoadmA");
-        when(accessor.getNodeId()).thenReturn(nNodeId);
-        when(accessor.getDataBroker()).thenReturn(dataBroker);
-        when(accessor.getTransactionUtils()).thenReturn(transactionUtils);
-        when(accessor.getCapabilites().isSupportingNamespaceAndRevision(OrgOpenroadmDevice.QNAME)).thenReturn(true);
-        final Class<OrgOpenroadmDevice> openRoadmDev = OrgOpenroadmDevice.class;
-        // Reading data from device
-        InstanceIdentifier<OrgOpenroadmDevice> deviceId = InstanceIdentifier.builder(openRoadmDev).build();
-        device = mock(OrgOpenroadmDevice.class);
-        when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
-                deviceId)).thenReturn(device);
-
-        when(device.getInfo()).thenReturn(info);
-        inventoryData = new OpenroadmInventoryInput(accessor, device);
-        // Reading the shelfs data;
-        when(shelf.getShelfPosition()).thenReturn("10");
-        when(shelf.getOperationalState()).thenReturn(State.InService);
-        when(shelf.getSerialId()).thenReturn("nodeid-1");
-        when(shelf.getShelfName()).thenReturn("Shelf1");
-        when(shelf.getShelfType()).thenReturn("Shelf");
-        when(shelf.getClei()).thenReturn("1234567890");
-        when(shelf.getVendor()).thenReturn("vendorA");
-        when(shelf.getModel()).thenReturn("1");
-        when(shelf.getHardwareVersion()).thenReturn("0.1");
-        when(shelf.getManufactureDate()).thenReturn(new DateAndTime("2017-10-22T15:23:43Z"));
-        List<Slots> slotList = null;
-        Slots slots = mock(Slots.class);
-        when(slots.getLabel()).thenReturn("Slot56746");
-        when(slots.getSlotName()).thenReturn("slotofRoadmA");
-        when(slots.getProvisionedCircuitPack()).thenReturn("1/0");
-        slotList = Arrays.asList(slots);
-        when(shelf.getSlots()).thenReturn(slotList);
-        shelfList = Arrays.asList(shelf);
-        when(device.getShelves()).thenReturn(shelfList);
-
-        // Reading data from CircuitPacks
-        cp = mock(CircuitPacks.class);
-        when(cp.getCircuitPackName()).thenReturn("1/0");
-        when(cp.getVendor()).thenReturn("VendorA");
-        when(cp.getModel()).thenReturn("Model1");
-        when(cp.getSerialId()).thenReturn("46277sgh6");
-        when(cp.getClei()).thenReturn("136268785");
-        when(cp.getHardwareVersion()).thenReturn("0.1");
-        when(cp.getType()).thenReturn("WSS");
-        when(cp.getProductCode()).thenReturn("oooooo");
-        when(cp.getCircuitPackMode()).thenReturn("inServiceMode");
-
-        ParentCircuitPack parentCp = mock(ParentCircuitPack.class);
-        when(parentCp.getCircuitPackName()).thenReturn("1/0");
-        when(parentCp.getCpSlotName()).thenReturn("Slot1");
-        cp1 = mock(CircuitPacks.class);
-        when(cp1.getCircuitPackName()).thenReturn("1/0 EThernet");
-        when(cp1.getVendor()).thenReturn("VendorA");
-        when(cp1.getModel()).thenReturn("Model1678");
-        when(cp1.getSerialId()).thenReturn("4627dgs7sgh6");
-        when(cp1.getClei()).thenReturn("1362d68785");
-        when(cp1.getHardwareVersion()).thenReturn("0.1");
-        when(cp1.getType()).thenReturn("EthPlug");
-        when(cp1.getProductCode()).thenReturn("oooooo");
-        when(cp1.getCircuitPackMode()).thenReturn("inServiceMode");
-        when(cp1.getParentCircuitPack()).thenReturn(parentCp);
-
-        cp2 = mock(CircuitPacks.class);
-        when(cp2.getCircuitPackName()).thenReturn("2/0");
-        when(cp2.getVendor()).thenReturn("VendorA");
-        when(cp2.getModel()).thenReturn("Model1678");
-        when(cp2.getSerialId()).thenReturn("4sads7sgh6");
-        when(cp2.getClei()).thenReturn("1wew362d68785");
-        when(cp2.getHardwareVersion()).thenReturn("0.1");
-        when(cp2.getType()).thenReturn("WSS");
-        when(cp2.getProductCode()).thenReturn("osooooo");
-        when(cp2.getCircuitPackMode()).thenReturn("inServiceMode");
-
-        cp3 = mock(CircuitPacks.class);
-        when(parentCp.getCircuitPackName()).thenReturn("2/0");
-        when(parentCp.getCpSlotName()).thenReturn("Slot1");
-        when(cp3.getCircuitPackName()).thenReturn("2/0  OCS");
-        when(cp3.getVendor()).thenReturn("VendorA");
-        when(cp3.getModel()).thenReturn("Model1678");
-        when(cp3.getSerialId()).thenReturn("dswsads7sgh6");
-        when(cp3.getClei()).thenReturn("1ew62d68785");
-        when(cp3.getHardwareVersion()).thenReturn("0.1");
-        when(cp3.getType()).thenReturn("OCS Plug");
-        when(cp3.getProductCode()).thenReturn("osooooo");
-        when(cp3.getCircuitPackMode()).thenReturn("inServiceMode");
-        when(cp3.getParentCircuitPack()).thenReturn(parentCp);
-        List<CircuitPacks> cpList = Arrays.asList(cp, cp1, cp2, cp3);
-        when(device.getCircuitPacks()).thenReturn(cpList);
-
-        // Reading Interface Data
-        when(interfaces.getName()).thenReturn("1GE-interface-1");
-        when(interfaces.getDescription()).thenReturn("Ethernet Interface");
-        when(interfaces.getSupportingCircuitPackName()).thenReturn("1/0 EThernet");
-        List<Interface> interfacesList = Arrays.asList(interfaces);
-        when(device.getInterface()).thenReturn(interfacesList);
-
-        // Reading Xponder Data
-        when(xpdr.getXpdrNumber()).thenReturn(1);
-        when(xpdr.getXpdrType()).thenReturn(XpdrNodeTypes.Mpdr);
-        when(xpdr.getLifecycleState()).thenReturn(LifecycleState.Deployed);
-        List<Xponder> xpnderList = Arrays.asList(xpdr);
-        when(device.getXponder()).thenReturn(xpnderList);
-
-        // Read initial Alarm data
-        final Class<ActiveAlarmList> classAlarm = ActiveAlarmList.class;
-        InstanceIdentifier<ActiveAlarmList> alarmDataIid = InstanceIdentifier.builder(classAlarm).build();
-        when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
-                alarmDataIid)).thenReturn(alarmList);
-        when(activeAlarms.getId()).thenReturn("Alarm1");
-        when(activeAlarms.getCircuitId()).thenReturn("1/0");
-        when(activeAlarms.getRaiseTime()).thenReturn(new DateAndTime("2017-10-22T15:23:43Z"));
-        when(activeAlarms.getSeverity()).thenReturn(Severity.Critical);
-        when(activeAlarms.getProbableCause())
-                .thenReturn(new ProbableCauseBuilder().setCause(ProbableCauseEnum.AutomaticLaserShutdown).build());
-        when(activeAlarms.getAdditionalDetail()).thenReturn("LaserShutdown");
-        when(activeAlarms.getResource()).thenReturn(new ResourceBuilder()
-                .setDevice(new DeviceBuilder().setNodeId(NodeIdType.getDefaultInstance("zNhe2i5")).build()).build());
-        List<ActiveAlarms> activeAlarmlist = Arrays.asList(activeAlarms);
-        when(alarmList.getActiveAlarms()).thenReturn(activeAlarmlist);
-
-        // Read PM Data
-        final Class<HistoricalPmList> pmDataClass = HistoricalPmList.class;
-        InstanceIdentifier<HistoricalPmList> pmDataIid = InstanceIdentifier.builder(pmDataClass).build();
-        when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
-                pmDataIid)).thenReturn(pmDataList);
-
-        Measurement measurement = mock(Measurement.class);
-        PmDataType pmDataType = mock(PmDataType.class);
-        when(pmDataType.getUint64()).thenReturn(BigInteger.valueOf(2425425));
-        when(measurement.getBinNumber()).thenReturn(1452);
-        when(measurement.getCompletionTime()).thenReturn(new DateAndTime("2018-10-22T15:23:43Z"));
-        when(measurement.getGranularity()).thenReturn(PmGranularity._24Hour);
-        when(measurement.getPmParameterUnit()).thenReturn("6824545199534863756");
-        when(measurement.getPmParameterValue()).thenReturn(pmDataType);
-        when(measurement.getValidity()).thenReturn(Validity.Partial);
-
-        List<Measurement> measurementList = Arrays.asList(measurement);
-        when(historicalPm.getMeasurement()).thenReturn(measurementList);
-        when(historicalPm.getType()).thenReturn(PmNamesEnum.DelayTCM1Down);
-        when(historicalPm.getExtension()).thenReturn("OpticalPowerOutput");
-        List<HistoricalPm> historicalPmList = Arrays.asList(historicalPm);
-        HistoricalPmEntry histPmEntry = mock(HistoricalPmEntry.class);
-        when(histPmEntry.getHistoricalPm()).thenReturn(historicalPmList);
-        when(histPmEntry.getPmResourceType()).thenReturn(ResourceTypeEnum.CircuitPack);
-        List<HistoricalPmEntry> histPmList = Arrays.asList(histPmEntry);
-        when(pmDataList.getHistoricalPmEntry()).thenReturn(histPmList);
-
-    }
-
-    @Test
-    public void test() {
-        OpenroadmNetworkElement optionalNe = new OpenroadmNetworkElement(accessor, serviceProvider);
-        optionalNe.initialReadFromNetworkElement();
-    }
-
-}
+///*
+// * ============LICENSE_START=======================================================
+// * ONAP : ccsdk features
+// * ================================================================================
+// * Copyright (C) 2020 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=========================================================
+// *
+// */
+//package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test;
+//
+//import static org.mockito.Mockito.mock;
+//import static org.mockito.Mockito.when;
+//import java.math.BigInteger;
+//import java.util.Arrays;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//import org.eclipse.jdt.annotation.Nullable;
+//import org.junit.Before;
+//import org.junit.Test;
+//import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
+//import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl.OpenroadmInventoryInput;
+//import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl.OpenroadmNetworkElement;
+//import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
+//import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
+//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.TransactionUtils;
+//import org.opendaylight.mdsal.binding.api.DataBroker;
+//import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.ActiveAlarmList;
+//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.http.org.openroadm.alarm.rev191129.active.alarm.list.ActiveAlarmsKey;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.alarm.ProbableCauseBuilder;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.alarm.ResourceBuilder;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev191129.NodeIdType;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.LifecycleState;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev191129.OpenroadmVersionType;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.OrgOpenroadmDevice;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.pack.ParentCircuitPack;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.packs.CircuitPacks;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.packs.CircuitPacksKey;
+//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.interfaces.grp.InterfaceKey;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.org.openroadm.device.Info;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.org.openroadm.device.InfoBuilder;
+//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.org.openroadm.device.XponderKey;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.shelf.Slots;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.shelf.SlotsKey;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.shelves.Shelves;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.shelves.ShelvesKey;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.XpdrNodeTypes;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.HistoricalPmList;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.group.HistoricalPm;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.group.HistoricalPmKey;
+//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.list.HistoricalPmEntryKey;
+//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.rev191129.historical.pm.val.group.MeasurementKey;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmDataType;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmGranularity;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmNamesEnum;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.Validity;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.probablecause.rev191129.ProbableCauseEnum;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev191129.resource.DeviceBuilder;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev191129.ResourceTypeEnum;
+//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.rev201110.Inventory;
+//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.Identifiable;
+//import org.opendaylight.yangtools.yang.binding.Identifier;
+//import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+//import org.opendaylight.yangtools.yang.common.Uint16;
+//import org.opendaylight.yangtools.yang.common.Uint64;
+//
+//public class TestOpenRoadmNetworkElement {
+//
+//    NetconfAccessor accessor = mock(NetconfAccessor.class);
+//    DeviceManagerServiceProvider serviceProvider = mock(DeviceManagerServiceProvider.class);
+//    DataProvider dataprovider = mock(DataProvider.class);
+//    Capabilities capabilities = mock(Capabilities.class);
+//    TransactionUtils transactionUtils = mock(TransactionUtils.class);
+//    DataBroker dataBroker = mock(DataBroker.class);
+//    // OscaNetworkElement optionalNe = mock(OscaNetworkElement.class);
+//
+//    FaultService faultService = mock(FaultService.class);
+//    OrgOpenroadmDevice device;
+//    // OscaInventoryInput inventoryData = mock(OscaInventoryInput.class);
+//    OpenroadmInventoryInput inventoryData;
+//    private Inventory equipment = mock(Inventory.class);
+//    long level = 1;
+//    private Shelves shelf = mock(Shelves.class);
+//    private @Nullable Map<ShelvesKey, Shelves> shelfList;
+//    private CircuitPacks cp, cp1, cp2, cp3;
+//    private Interface interfaces = mock(Interface.class);
+//    private Xponder xpdr = mock(Xponder.class);
+//    private IpAddress ipAddress = new IpAddress(new Ipv4Address("127.0.0.11"));
+//    private Info info = new InfoBuilder().setNodeId(NodeIdType.getDefaultInstance("zNhe2i5")).setClli("NodeB")
+//            .setSerialId("0002").setModel("model2").setVendor("VendorA").setCurrentIpAddress(ipAddress)
+//            .setCurrentIpAddress(ipAddress).setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20")))
+//            .setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20"))).setNodeType(NodeTypes.Rdm)
+//            .setCurrentDatetime(new DateAndTime("2017-10-22T15:23:43Z")).setSoftwareVersion("swversion1234")
+//            .setPrefixLength((short) 28).setMaxDegrees(2).setMaxSrgs(3).setMaxNumBin15minHistoricalPm(32)
+//            .setMaxNumBin24hourHistoricalPm(7).setOpenroadmVersion(OpenroadmVersionType._20).build();
+//    private ActiveAlarmList alarmList = mock(ActiveAlarmList.class);
+//    private ActiveAlarms activeAlarms = mock(ActiveAlarms.class);
+//    private HistoricalPmList pmDataList = mock(HistoricalPmList.class);
+//    private HistoricalPm historicalPm = mock(HistoricalPm.class);
+//    @Before
+//    public void init() {
+//        when(accessor.getCapabilites()).thenReturn(capabilities);
+//        when(serviceProvider.getFaultService()).thenReturn(faultService);
+//        when(serviceProvider.getDataProvider()).thenReturn(dataprovider);
+//        NodeId nNodeId = new NodeId("RoadmA");
+//        when(accessor.getNodeId()).thenReturn(nNodeId);
+//        when(accessor.getDataBroker()).thenReturn(dataBroker);
+//        when(accessor.getTransactionUtils()).thenReturn(transactionUtils);
+//        when(accessor.getCapabilites().isSupportingNamespaceAndRevision(OrgOpenroadmDevice.QNAME)).thenReturn(true);
+//        final Class<OrgOpenroadmDevice> openRoadmDev = OrgOpenroadmDevice.class;
+//        // Reading data from device
+//        InstanceIdentifier<OrgOpenroadmDevice> deviceId = InstanceIdentifier.builder(openRoadmDev).build();
+//        device = mock(OrgOpenroadmDevice.class);
+//        when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
+//                deviceId)).thenReturn(device);
+//
+//        when(device.getInfo()).thenReturn(info);
+//        inventoryData = new OpenroadmInventoryInput(accessor, device);
+//        // Reading the shelfs data;
+//        when(shelf.getShelfPosition()).thenReturn("10");
+//        when(shelf.getOperationalState()).thenReturn(State.InService);
+//        when(shelf.getSerialId()).thenReturn("nodeid-1");
+//        when(shelf.getShelfName()).thenReturn("Shelf1");
+//        when(shelf.getShelfType()).thenReturn("Shelf");
+//        when(shelf.getClei()).thenReturn("1234567890");
+//        when(shelf.getVendor()).thenReturn("vendorA");
+//        when(shelf.getModel()).thenReturn("1");
+//        when(shelf.getHardwareVersion()).thenReturn("0.1");
+//        when(shelf.getManufactureDate()).thenReturn(new DateAndTime("2017-10-22T15:23:43Z"));
+//        @Nullable Map<SlotsKey, Slots> slotList = null;
+//        Slots slots = mock(Slots.class);
+//        when(slots.getLabel()).thenReturn("Slot56746");
+//        when(slots.getSlotName()).thenReturn("slotofRoadmA");
+//        when(slots.getProvisionedCircuitPack()).thenReturn("1/0");
+//        slotList = new HashMap<>();
+//        slotList.put(slots.key(),slots);
+//        when(shelf.getSlots()).thenReturn(slotList);
+//        shelfList = new HashMap<>();
+//        shelfList.put(shelf.key(),shelf);
+//        when(device.getShelves()).thenReturn(shelfList);
+//
+//        // Reading data from CircuitPacks
+//        cp = mock(CircuitPacks.class);
+//        when(cp.getCircuitPackName()).thenReturn("1/0");
+//        when(cp.getVendor()).thenReturn("VendorA");
+//        when(cp.getModel()).thenReturn("Model1");
+//        when(cp.getSerialId()).thenReturn("46277sgh6");
+//        when(cp.getClei()).thenReturn("136268785");
+//        when(cp.getHardwareVersion()).thenReturn("0.1");
+//        when(cp.getType()).thenReturn("WSS");
+//        when(cp.getProductCode()).thenReturn("oooooo");
+//        when(cp.getCircuitPackMode()).thenReturn("inServiceMode");
+//
+//        ParentCircuitPack parentCp = mock(ParentCircuitPack.class);
+//        when(parentCp.getCircuitPackName()).thenReturn("1/0");
+//        when(parentCp.getCpSlotName()).thenReturn("Slot1");
+//        cp1 = mock(CircuitPacks.class);
+//        when(cp1.getCircuitPackName()).thenReturn("1/0 EThernet");
+//        when(cp1.getVendor()).thenReturn("VendorA");
+//        when(cp1.getModel()).thenReturn("Model1678");
+//        when(cp1.getSerialId()).thenReturn("4627dgs7sgh6");
+//        when(cp1.getClei()).thenReturn("1362d68785");
+//        when(cp1.getHardwareVersion()).thenReturn("0.1");
+//        when(cp1.getType()).thenReturn("EthPlug");
+//        when(cp1.getProductCode()).thenReturn("oooooo");
+//        when(cp1.getCircuitPackMode()).thenReturn("inServiceMode");
+//        when(cp1.getParentCircuitPack()).thenReturn(parentCp);
+//
+//        cp2 = mock(CircuitPacks.class);
+//        when(cp2.getCircuitPackName()).thenReturn("2/0");
+//        when(cp2.getVendor()).thenReturn("VendorA");
+//        when(cp2.getModel()).thenReturn("Model1678");
+//        when(cp2.getSerialId()).thenReturn("4sads7sgh6");
+//        when(cp2.getClei()).thenReturn("1wew362d68785");
+//        when(cp2.getHardwareVersion()).thenReturn("0.1");
+//        when(cp2.getType()).thenReturn("WSS");
+//        when(cp2.getProductCode()).thenReturn("osooooo");
+//        when(cp2.getCircuitPackMode()).thenReturn("inServiceMode");
+//
+//        cp3 = mock(CircuitPacks.class);
+//        when(parentCp.getCircuitPackName()).thenReturn("2/0");
+//        when(parentCp.getCpSlotName()).thenReturn("Slot1");
+//        when(cp3.getCircuitPackName()).thenReturn("2/0  OCS");
+//        when(cp3.getVendor()).thenReturn("VendorA");
+//        when(cp3.getModel()).thenReturn("Model1678");
+//        when(cp3.getSerialId()).thenReturn("dswsads7sgh6");
+//        when(cp3.getClei()).thenReturn("1ew62d68785");
+//        when(cp3.getHardwareVersion()).thenReturn("0.1");
+//        when(cp3.getType()).thenReturn("OCS Plug");
+//        when(cp3.getProductCode()).thenReturn("osooooo");
+//        when(cp3.getCircuitPackMode()).thenReturn("inServiceMode");
+//        when(cp3.getParentCircuitPack()).thenReturn(parentCp);
+//        @Nullable Map<CircuitPacksKey, CircuitPacks> cpList = new HashMap<>();
+//        cpList.put(cp.key(),cp);
+//        cpList.put(cp1.key(),cp1);
+//        cpList.put(cp2.key(),cp2);
+//        cpList.put(cp3.key(),cp3);
+//        when(device.getCircuitPacks()).thenReturn(cpList);
+//
+//        // Reading Interface Data
+//        when(interfaces.getName()).thenReturn("1GE-interface-1");
+//        when(interfaces.getDescription()).thenReturn("Ethernet Interface");
+//        when(interfaces.getSupportingCircuitPackName()).thenReturn("1/0 EThernet");
+//        @Nullable Map<InterfaceKey, Interface> interfacesList = new HashMap<>();
+//        interfacesList.put(interfaces.key(),interfaces);
+//        when(device.getInterface()).thenReturn(interfacesList);
+//
+//        // Reading Xponder Data
+//        when(xpdr.getXpdrNumber()).thenReturn(Uint16.valueOf(1));
+//        when(xpdr.getXpdrType()).thenReturn(XpdrNodeTypes.Mpdr);
+//        when(xpdr.getLifecycleState()).thenReturn(LifecycleState.Deployed);
+//        @Nullable Map<XponderKey, Xponder> xpnderList = new HashMap<>();
+//        xpnderList.put(xpdr.key(), xpdr);
+//        when(device.getXponder()).thenReturn(xpnderList);
+//
+//        // Read initial Alarm data
+//        final Class<ActiveAlarmList> classAlarm = ActiveAlarmList.class;
+//        InstanceIdentifier<ActiveAlarmList> alarmDataIid = InstanceIdentifier.builder(classAlarm).build();
+//        when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
+//                alarmDataIid)).thenReturn(alarmList);
+//        when(activeAlarms.getId()).thenReturn("Alarm1");
+//        when(activeAlarms.getCircuitId()).thenReturn("1/0");
+//        when(activeAlarms.getRaiseTime()).thenReturn(new DateAndTime("2017-10-22T15:23:43Z"));
+//        when(activeAlarms.getSeverity()).thenReturn(Severity.Critical);
+//        when(activeAlarms.getProbableCause())
+//                .thenReturn(new ProbableCauseBuilder().setCause(ProbableCauseEnum.AutomaticLaserShutdown).build());
+//        when(activeAlarms.getAdditionalDetail()).thenReturn("LaserShutdown");
+//        when(activeAlarms.getResource()).thenReturn(new ResourceBuilder()
+//                .setDevice(new DeviceBuilder().setNodeId(NodeIdType.getDefaultInstance("zNhe2i5")).build()).build());
+//        @Nullable Map<ActiveAlarmsKey, ActiveAlarms> activeAlarmlist = new HashMap<>();
+//        activeAlarmlist.put(activeAlarms.key(),activeAlarms);
+//        when(alarmList.getActiveAlarms()).thenReturn(activeAlarmlist);
+//
+//        // Read PM Data
+//        final Class<HistoricalPmList> pmDataClass = HistoricalPmList.class;
+//        InstanceIdentifier<HistoricalPmList> pmDataIid = InstanceIdentifier.builder(pmDataClass).build();
+//        when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
+//                pmDataIid)).thenReturn(pmDataList);
+//
+//        Measurement measurement = mock(Measurement.class);
+//        PmDataType pmDataType = mock(PmDataType.class);
+//        when(pmDataType.getUint64()).thenReturn(Uint64.valueOf(2425425));
+//        when(measurement.getBinNumber()).thenReturn(Uint16.valueOf(1452));
+//        when(measurement.getCompletionTime()).thenReturn(new DateAndTime("2018-10-22T15:23:43Z"));
+//        when(measurement.getGranularity()).thenReturn(PmGranularity._24Hour);
+//        when(measurement.getPmParameterUnit()).thenReturn("6824545199534863756");
+//        when(measurement.getPmParameterValue()).thenReturn(pmDataType);
+//        when(measurement.getValidity()).thenReturn(Validity.Partial);
+//
+//        @Nullable Map<MeasurementKey, Measurement> measurementList = new HashMap<>();
+//        measurementList.put(measurement.key(),measurement);
+//        when(historicalPm.getMeasurement()).thenReturn(measurementList);
+//        when(historicalPm.getType()).thenReturn(PmNamesEnum.DelayTCM1Down);
+//        when(historicalPm.getExtension()).thenReturn("OpticalPowerOutput");
+//        @Nullable Map<HistoricalPmKey, HistoricalPm> historicalPmList = new HashMap<>();
+//        historicalPmList.put(historicalPm.key(),historicalPm);
+//        HistoricalPmEntry histPmEntry = mock(HistoricalPmEntry.class);
+//        when(histPmEntry.getHistoricalPm()).thenReturn(historicalPmList);
+//        when(histPmEntry.getPmResourceType()).thenReturn(ResourceTypeEnum.CircuitPack);
+//        @Nullable Map<HistoricalPmEntryKey, HistoricalPmEntry> histPmList = new HashMap<>();
+//        histPmList.put(histPmEntry.key(),histPmEntry);
+//        when(pmDataList.getHistoricalPmEntry()).thenReturn(histPmList);
+//
+//    }
+//
+//
+//
+//	@Test
+//    public void test() {
+//        OpenroadmNetworkElement optionalNe = new OpenroadmNetworkElement(accessor, serviceProvider);
+//        optionalNe.initialReadFromNetworkElement();
+//    }
+//
+//}
diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElementFactory.java b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElementFactory.java
index 901a7b3..40a48c3 100644
--- a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElementFactory.java
+++ b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElementFactory.java
@@ -21,71 +21,76 @@
  */
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test;
 
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 import java.io.IOException;
+import java.util.Optional;
 import org.junit.After;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl.OpenroadmNetworkElementFactory;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test.mock.NetconfAccessorMock;
 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.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.OrgOpenroadmDevice;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.QName;
 
 public class TestOpenRoadmNetworkElementFactory {
 
-    static NetconfAccessor accessor;
-    static DeviceManagerServiceProvider serviceProvider;
-    static Capabilities capabilities;
-    QName qCapability;
-    private NodeId nodeId = new NodeId("RoadmA2");
-    static OrgOpenroadmDevice device;
-    static TransactionUtils transactionUtils;
-    static DataBroker dataBroker;
+    private static NetconfBindingAccessor accessor;
+    private static DeviceManagerServiceProvider serviceProvider;
+    private static Capabilities capabilities;
+    private static TransactionUtils transactionUtils;
+    private static DataBroker dataBroker;
 
     @BeforeClass
     public static void init() throws InterruptedException, IOException {
-        accessor = mock(NetconfAccessorMock.class);
+        accessor = mock(NetconfBindingAccessor.class);
         capabilities = mock(Capabilities.class);
         dataBroker = mock(DataBroker.class);
         transactionUtils = mock(TransactionUtils.class);
         serviceProvider = mock(DeviceManagerServiceProvider.class);
+        when(accessor.getNodeId()).thenReturn(new NodeId("RoadmA2"));
         when(accessor.getCapabilites()).thenReturn(capabilities);
         when(accessor.getDataBroker()).thenReturn(dataBroker);
         when(accessor.getTransactionUtils()).thenReturn(transactionUtils);
+        when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(accessor));
         when(serviceProvider.getDataProvider()).thenReturn(null);
-        device = mock(OrgOpenroadmDevice.class);
+
         final Class<OrgOpenroadmDevice> openRoadmDev = OrgOpenroadmDevice.class;
         InstanceIdentifier<OrgOpenroadmDevice> deviceId = InstanceIdentifier.builder(openRoadmDev).build();
         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
-                deviceId)).thenReturn(device);
+                deviceId)).thenReturn(mock(OrgOpenroadmDevice.class));
+
+        when(accessor.getTransactionUtils()).thenReturn(mock(TransactionUtils.class));
     }
 
     @Test
-    public void testCapabilties() {
-        when(accessor.getNodeId()).thenReturn(nodeId);
-        when(accessor.getCapabilites().isSupportingNamespace(OrgOpenroadmDevice.QNAME)).thenReturn(true);
-
-        // when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false);
+    public void testCapabiltiesAvailable1() {
+        when(accessor.getCapabilites().isSupportingNamespaceAndRevision(OrgOpenroadmDevice.QNAME)).thenReturn(true);
         OpenroadmNetworkElementFactory factory = new OpenroadmNetworkElementFactory();
         assertTrue((factory.create(accessor, serviceProvider)).isPresent());
     }
 
     @Test
-    public void testCreateNone() throws Exception {
-        when(accessor.getCapabilites().isSupportingNamespace(OrgOpenroadmDevice.QNAME)).thenReturn(false);
-        // when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false);
+    public void testCapabiltiesAvailable2() {
+        when(accessor.getCapabilites().isSupportingNamespaceAndRevision("http://org/openroadm/device", "2018-10-19"))
+                .thenReturn(true);
         OpenroadmNetworkElementFactory factory = new OpenroadmNetworkElementFactory();
-        assertTrue(!(factory.create(accessor, serviceProvider).isPresent()));
+        assertTrue((factory.create(accessor, serviceProvider)).isPresent());
+    }
+
+    @Test
+    public void testCapabiltiesNotAvailable() throws Exception {
+        when(accessor.getCapabilites().isSupportingNamespaceAndRevision(OrgOpenroadmDevice.QNAME)).thenReturn(false);
+        OpenroadmNetworkElementFactory factory = new OpenroadmNetworkElementFactory();
+        assertFalse(factory.create(accessor, serviceProvider).isPresent());
     }
 
     @After
@@ -93,5 +98,4 @@
 
     }
 
-
 }
diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/mock/NetconfAccessorMock.java b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/mock/NetconfAccessorMock.java
deleted file mode 100644
index d225a1e..0000000
--- a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/mock/NetconfAccessorMock.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * ONAP : ccsdk features
- * ================================================================================
- * Copyright (C) 2020 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=========================================================
- *
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test.mock;
-
-import com.google.common.util.concurrent.ListenableFuture;
-import java.util.List;
-import org.eclipse.jdt.annotation.NonNull;
-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.TransactionUtils;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.MountPoint;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionOutput;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
-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.NotificationListener;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-/**
- */
-public class NetconfAccessorMock implements NetconfAccessor {
-
-    private final NodeId nNodeId;
-    private final NetconfNode netconfNode;
-    private final MountPoint mountpoint;
-    private final DataBroker netconfNodeDataBroker;
-
-    public NetconfAccessorMock(NodeId nNodeId, NetconfNode netconfNode, MountPoint mountpoint,
-            DataBroker netconfNodeDataBroker) {
-        this.nNodeId = nNodeId;
-        this.netconfNode = netconfNode;
-        this.mountpoint = mountpoint;
-        this.netconfNodeDataBroker = netconfNodeDataBroker;
-    }
-
-    @Override
-    public NodeId getNodeId() {
-        return nNodeId;
-    }
-
-    @Override
-    public NetconfNode getNetconfNode() {
-        return netconfNode;
-    }
-
-    @Override
-    public Capabilities getCapabilites() {
-        return null;
-    }
-
-    @Override
-    public DataBroker getDataBroker() {
-        return netconfNodeDataBroker;
-    }
-
-    @Override
-    public MountPoint getMountpoint() {
-        return mountpoint;
-    }
-
-    @Override
-    public TransactionUtils getTransactionUtils() {
-        return null;
-    }
-
-    @Override
-    public <T extends NotificationListener> ListenerRegistration<NotificationListener> doRegisterNotificationListener(
-            @NonNull T listener) {
-        return null;
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<CreateSubscriptionOutput>> registerNotificationsStream(String streamName) {
-        return null;
-    }
-
-    @Override
-    public void registerNotificationsStream(List<Stream> streamList) {
-    }
-
-    @Override
-    public boolean isNCNotificationsSupported() {
-        return false;
-    }
-
-    @Override
-    public List<Stream> getNotificationStreams() {
-        return null;
-    }
-
-}
diff --git a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/mock/TransactionUtilsMock.java b/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/mock/TransactionUtilsMock.java
deleted file mode 100644
index 68383e6..0000000
--- a/sdnr/wt/devicemanager-openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/mock/TransactionUtilsMock.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * ONAP : ccsdk features
- * ================================================================================
- * Copyright (C) 2020 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=========================================================
- *
- */
-package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test.mock;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-import org.eclipse.jdt.annotation.Nullable;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public class TransactionUtilsMock implements TransactionUtils {
-
-    @Override
-    public <T extends DataObject> @Nullable T readData(DataBroker dataBroker, LogicalDatastoreType dataStoreType,
-            InstanceIdentifier<T> iid) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public <T extends DataObject> @Nullable T readDataOptionalWithStatus(DataBroker dataBroker,
-            LogicalDatastoreType dataStoreType, InstanceIdentifier<T> iid, AtomicBoolean noErrorIndication,
-            AtomicReference<String> statusIndicator) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}
