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;
-    }
-
-}
