diff --git a/sdnr/wt/README.md b/sdnr/wt/README.md
index 1a8d1e9..33e7084 100644
--- a/sdnr/wt/README.md
+++ b/sdnr/wt/README.md
@@ -1,33 +1,57 @@
 # wt - wireless transport microservices
 
-## apigateway
+## apigateway (osgi)
 
-The API gateway provides WEB access to all wt related web service providers to prevent cross site requests. The Opendaylight default UI port is extendet by additonal URIs.
+The API gateway provides WEB access to all wt related web service providers to prevent cross site requests. The Opendaylight default Web server is extended by additional URIs.
 
   * /database to access elasticsearch
   * /aai to access AAI
-  * /ms to access mediator servers
 
-## devicemodel
+## common (osgi)
 
-Model classes, specified by ONF Model and provided as yang files for Java class generation for NETCONF devices.
+Common classes, included into most bundles
 
-## websocketmanager2
+## data-provider (osgi)
 
-Notification service for browser clients.
+Interface to devicemanager database. In Frankfurt database is elasticsearch.
 
-## devicemanager
+## devicemanager (osgi)
 
-Management application for NETCONF devices.
+Devicemanager services, used by specfic devicemanagers for NETCONF devices.
 
-## odlux
+## devicemanager-specific (osgi)
 
-Web applications for user operations for devices
+Devicemanager implementation for specfic devicemodel. Today available are:
+  * onf: ONF Core model
+  * oran: O-RAN model
+  * gran: 3GPP model
 
-## helpserver
+## featureaggregator (osgi)
+
+karaf features
+  * sdnr-wt-feature-aggregator to start all services
+  * sdnr-wt-feature-aggregator-devicemanager to start devicemanager service
+
+## helpserver (osgi)
 
 Providing help pages for related web applications
 
-## featureaggregator
+## netconfnode-state-provider (osgi)
 
-karaf feature with name sdnr-wt-feature-aggregator to start all services.
+Provide netconf state information to devicemanager and mountpoint-state-provider
+
+## odlux (osgi)
+
+Web applications for user operations for devices
+
+## websocketmanager2 (osgi)
+
+Notification service for browser clients.
+
+## readthedocs
+
+readthedocs - Providing documentation. Scripts to convert documentation within helpserver to the [ccsdk/features]/doc folder
+~
+~
+~
+~
diff --git a/sdnr/wt/common/pom.xml b/sdnr/wt/common/pom.xml
index 1010fa8..d942925 100644
--- a/sdnr/wt/common/pom.xml
+++ b/sdnr/wt/common/pom.xml
@@ -30,7 +30,7 @@
     <version>0.7.1-SNAPSHOT</version>
     <packaging>jar</packaging>
 
-    <name>ccsdk-features-sdnr-wt :: ${project.artifactId}</name>
+    <name>ccsdk-features :: ${project.artifactId}</name>
     <licenses>
         <license>
             <name>Apache License, Version 2.0</name>
diff --git a/sdnr/wt/data-provider/README.md b/sdnr/wt/data-provider/README.md
new file mode 100644
index 0000000..e8edcb9
--- /dev/null
+++ b/sdnr/wt/data-provider/README.md
@@ -0,0 +1,16 @@
+# sdnr-wt-data-provider
+
+Data-provider bundle manages all access to SDN-R database.
+Database is actually ElasticSearch.
+
+## ES-INIT Script
+
+Central SDN-R script initializing and preparing the database BEFORE SDN-R usage.
+
+Name: es-init.sh
+Dir: provider/src/main/resources
+
+  * Elasticsearch database initialization script using bash and curl commands.
+  * Intended to be executed in a linux command line environment
+  * Needs to be executed before the database is used to initialize type mapping of the indexes
+  * The script is included into the ZIP created by sdnr-wt-feature-aggregator to be available in containers
diff --git a/sdnr/wt/data-provider/daexim/pom.xml b/sdnr/wt/data-provider/daexim/pom.xml
new file mode 100644
index 0000000..a5e46a9
--- /dev/null
+++ b/sdnr/wt/data-provider/daexim/pom.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ * ============LICENSE_START=======================================================
+ * ONAP : CCSDK.sdnr.wt.data-provider.model
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+
+-->
+<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>
+    <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+    <artifactId>sdnr-wt-data-provider-daexim</artifactId>
+    <version>0.7.1-SNAPSHOT</version>
+    <name>ccsdk-features :: ${project.artifactId}</name>
+    <packaging>bundle</packaging>
+
+    <parent>
+        <groupId>org.onap.ccsdk.parent</groupId>
+        <artifactId>binding-parent</artifactId>
+        <version>1.5.2-SNAPSHOT</version>
+        <relativePath />
+    </parent>
+
+    <properties>
+        <maven.javadoc.skip>true</maven.javadoc.skip>
+        <databaseport>49401</databaseport>
+    </properties>
+
+    <licenses>
+        <license>
+            <name>Apache License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+        </license>
+    </licenses>
+
+    <dependencies>
+         <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.netconf</groupId>
+             <artifactId>sal-netconf-connector</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>**/gen/**</exclude>
+                        <exclude>**/generated-sources/**</exclude>
+                        <exclude>**/yang-gen-sal/**</exclude>
+                        <exclude>**/pax/**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generateDTOs</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>exec</goal>
+                          </goals>
+                            <configuration>
+                                <skip>${skipTests}</skip>
+                                <executable>bash</executable>
+                                <arguments>
+                                   <argument>${basedir}/../data-provider/provider/src/main/resources/es-init.sh</argument>
+                                   <argument>initfile</argument>
+                                   <argument>-f</argument>
+                                   <argument>${project.build.directory}/EsInit.script</argument>
+                                </arguments>
+                          </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.github.alexcojocaru</groupId>
+                <artifactId>elasticsearch-maven-plugin</artifactId>
+                <version>6.16</version>
+                <configuration>
+                    <skip>${skipTests}</skip>
+                    <clusterName>testCluster</clusterName>
+                    <transportPort>9500</transportPort>
+                    <httpPort>${databaseport}</httpPort>
+                    <version>6.5.0</version>
+                    <pathInitScript>${project.build.directory}/EsInit.script</pathInitScript>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>start-elasticsearch</id>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>runforked</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>stop-elasticsearch</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemProperties>
+                        <property>
+                            <name>databaseport</name>
+                            <value>${databaseport}</value>
+                        </property>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/sdnr/wt/data-provider/feature/pom.xml b/sdnr/wt/data-provider/feature/pom.xml
new file mode 100644
index 0000000..35d8670
--- /dev/null
+++ b/sdnr/wt/data-provider/feature/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ * ============LICENSE_START=======================================================
+ * ONAP : CCSDK.sdnr.wt.dataprovider.feature
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+
+-->
+<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>single-feature-parent</artifactId>
+    <version>1.5.2-SNAPSHOT</version>
+    <relativePath />
+  </parent>
+
+  <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+  <artifactId>sdnr-wt-data-provider-feature</artifactId>
+  <version>0.7.1-SNAPSHOT</version>
+  <packaging>feature</packaging>
+
+  <name>ccsdk-features :: ${project.artifactId} :: feature</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>sdnr-wt-data-provider-provider</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/sdnr/wt/data-provider/installer/pom.xml b/sdnr/wt/data-provider/installer/pom.xml
new file mode 100755
index 0000000..f83c21f
--- /dev/null
+++ b/sdnr/wt/data-provider/installer/pom.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ * ============LICENSE_START=======================================================
+ * ONAP : CCSDK.sdnr.wt.dataprovider.installer
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+
+-->
+<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>1.5.2-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+  <artifactId>sdnr-wt-data-provider-installer</artifactId>
+  <version>0.7.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <name>ccsdk-features :: ${project.artifactId}</name>
+
+  <properties>
+    <application.name>sdnr-wt-data-provider</application.name>
+    <include.transitive.dependencies>false</include.transitive.dependencies>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+      <artifactId>${application.name}-feature</artifactId>
+      <version>${project.version}</version>
+      <type>xml</type>
+      <classifier>features</classifier>
+      <exclusions>
+        <exclusion>
+          <groupId>*</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+      <artifactId>${application.name}-provider</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>maven-repo-zip</id>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <phase>package</phase>
+            <configuration>
+              <attach>true</attach>
+              <finalName>stage/${application.name}-${project.version}</finalName>
+              <descriptors>
+                <descriptor>src/assembly/assemble_mvnrepo_zip.xml</descriptor>
+              </descriptors>
+              <appendAssemblyId>true</appendAssemblyId>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy-nested-dependencies</id>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <phase>prepare-package</phase>
+            <configuration>
+              <transitive>true</transitive>
+              <outputDirectory>${project.build.directory}/assembly/system</outputDirectory>
+              <overWriteReleases>false</overWriteReleases>
+              <overWriteSnapshots>true</overWriteSnapshots>
+              <overWriteIfNewer>true</overWriteIfNewer>
+              <useRepositoryLayout>true</useRepositoryLayout>
+              <addParentPoms>false</addParentPoms>
+              <copyPom>false</copyPom>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.6</version>
+        <executions>
+          <execution>
+            <id>copy-schemas</id>
+            <goals>
+              <goal>copy-resources</goal>
+            </goals>
+            <phase>validate</phase>
+            <configuration>
+              <outputDirectory>${project.build.directory}/assembly/cache/schema</outputDirectory>
+              <resources>
+                <resource>
+                  <directory>${basedir}/../provider/src/main/resources/preload.cache.schema</directory>
+                  <includes>
+                    <include>*.yang</include>
+                  </includes>
+                  <filtering>true</filtering>
+                </resource>
+              </resources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/sdnr/wt/data-provider/installer/src/assembly/assemble_mvnrepo_zip.xml b/sdnr/wt/data-provider/installer/src/assembly/assemble_mvnrepo_zip.xml
new file mode 100644
index 0000000..c4eb9aa
--- /dev/null
+++ b/sdnr/wt/data-provider/installer/src/assembly/assemble_mvnrepo_zip.xml
@@ -0,0 +1,49 @@
+<!--
+  ============LICENSE_START=======================================================
+  ONAP : CCSDK
+  ================================================================================
+  Copyright (C) 2017 AT&T 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=========================================================
+  -->
+
+<!-- Defines how we build the .zip file which is our distribution. -->
+
+<assembly
+	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>repo</id>
+	<formats>
+		<format>zip</format>
+	</formats>
+
+	<!--  we want "system" and related files right at the root level
+		  as this file is suppose to be unzip on top of a karaf
+		  distro. -->
+	<includeBaseDirectory>false</includeBaseDirectory>
+
+	<fileSets>
+		<fileSet>
+			<directory>target/assembly/</directory>
+			<outputDirectory>.</outputDirectory>
+			<excludes>
+			</excludes>
+		</fileSet>
+	</fileSets>
+
+
+
+</assembly>
diff --git a/sdnr/wt/data-provider/model/pom.xml b/sdnr/wt/data-provider/model/pom.xml
new file mode 100644
index 0000000..b84639e
--- /dev/null
+++ b/sdnr/wt/data-provider/model/pom.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ * ============LICENSE_START=======================================================
+ * ONAP : CCSDK.sdnr.wt.data-provider.model
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+
+-->
+<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>binding-parent</artifactId>
+		<version>1.5.2-SNAPSHOT</version>
+		<relativePath />
+	</parent>
+
+	<groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+	<artifactId>sdnr-wt-data-provider-model</artifactId>
+	<version>0.7.1-SNAPSHOT</version>
+	<packaging>bundle</packaging>
+
+	<name>ccsdk-features :: ${project.artifactId}</name>
+	<licenses>
+		<license>
+			<name>Apache License, Version 2.0</name>
+			<url>http://www.apache.org/licenses/LICENSE-2.0</url>
+		</license>
+	</licenses>
+
+	<properties>
+		<maven.javadoc.skip>true</maven.javadoc.skip>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.opendaylight.netconf</groupId>
+			<artifactId>sal-netconf-connector</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>${project.groupId}</groupId>
+			<artifactId>sdnr-wt-common</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.jacoco</groupId>
+				<artifactId>jacoco-maven-plugin</artifactId>
+				<configuration>
+					<excludes>
+						<exclude>**/gen/**</exclude>
+						<exclude>**/generated-sources/**</exclude>
+						<exclude>**/yang-gen-sal/**</exclude>
+						<exclude>**/pax/**</exclude>
+					</excludes>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/ArchiveCleanProvider.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/ArchiveCleanProvider.java
new file mode 100644
index 0000000..00ec2e6
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/ArchiveCleanProvider.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+import java.util.Date;
+
+public interface ArchiveCleanProvider {
+
+    /**
+     * Remove all index data older, than specified
+     * @param olderAreOutdated time to specify older elements
+     * @return number of removed elements
+     */
+    int doIndexClean(Date olderAreOutdated);
+
+    /**
+     * Get number of elements older then
+     * @param olderAreOutdated date to compare with and specify older elements
+     * @return number of elements
+     */
+    public int getNumberOfOldObjects(Date olderAreOutdated);
+
+
+}
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java
new file mode 100644
index 0000000..fd25661
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java
@@ -0,0 +1,102 @@
+/**
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ */
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+import java.util.Date;
+import java.util.List;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntity;
+
+public interface DataProvider extends ArchiveCleanProvider {
+
+    // -- Connection log
+    void writeConnectionLog(ConnectionlogEntity event);
+
+    // -- Event log
+    void writeEventLog(EventlogEntity event);
+
+    void writeFaultLog(FaultlogEntity fault);
+
+    void updateFaultCurrent(FaultcurrentEntity fault);
+
+    /**
+     * Remove all entries for one node
+     *
+     * @param nodeName contains the mountpointname
+     * @return number of deleted entries
+     */
+    int clearFaultsCurrentOfNode(String nodeName);
+
+    /**
+     * Remove all entries for one node
+     *
+     * @param nodeName contains the mountpointname
+     * @param objectId of element to be deleted
+     * @return number of deleted entries
+     */
+    int clearFaultsCurrentOfNodeWithObjectId(String nodeName, String objectId);
+
+    /**
+     * Deliver list with all mountpoint/node-names in the database.
+     *
+     * @return List of all mountpoint/node-names the had active alarms.
+     */
+    List<String> getAllNodesWithCurrentAlarms();
+
+    /**
+     * write internal equipment to database
+     * @param internalEquipment with mandatory fields.
+     */
+    void writeInventory(Inventory internalEquipment);
+
+    /**
+     *
+     * @param networkElementConnectionEntitiy to wirte to DB
+     * @param nodeId Id for this DB element
+     */
+    void updateNetworkConnectionDeviceType(NetworkElementConnectionEntity networkElementConnectionEntitiy,
+            String nodeId);
+
+    /**
+     * Update after new mountpoint registration
+     * @param networkElementConnectionEntitiy data
+     * @param nodeId of device (mountpoint name)
+     */
+    void updateNetworkConnection22(NetworkElementConnectionEntity networkElementConnectionEntitiy, String nodeId);
+
+    void removeNetworkConnection(String nodeId);
+
+    @Override
+    int doIndexClean(Date olderAreOutdated);
+
+    @Override
+    int getNumberOfOldObjects(Date olderAreOutdated);
+
+    List<NetworkElementConnectionEntity> getNetworkElementConnections();
+
+    /**
+     * @param list
+     */
+    void doWritePerformanceData(List<PmdataEntity> list);
+
+}
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/HtDatabaseMaintenance.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/HtDatabaseMaintenance.java
new file mode 100644
index 0000000..11681c0
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/HtDatabaseMaintenance.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+import java.util.List;
+import org.eclipse.jdt.annotation.Nullable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceEntity;
+
+/**
+ * @author herbert
+ *
+ */
+public interface HtDatabaseMaintenance {
+
+    /**
+     * @param mountPointNodeName
+     */
+    MaintenanceEntity createIfNotExists(String mountPointNodeName);
+
+    /**
+     * @param mountPointNodeName
+     */
+    void deleteIfNotRequired(String mountPointNodeName);
+
+    /**
+     * @return
+     */
+    List<MaintenanceEntity> getAll();
+
+    /**
+     * @param mountpointName
+     * @return
+     */
+    MaintenanceEntity getMaintenance(@Nullable String mountpointName);
+
+    /**
+     * @param m
+     */
+    MaintenanceEntity setMaintenance(MaintenanceEntity m);
+
+}
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEntityDataProvider.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEntityDataProvider.java
new file mode 100644
index 0000000..95ea075
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEntityDataProvider.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.StatusChangedHandler.StatusKey;
+
+public interface IEntityDataProvider {
+
+    /** Get provider for database read/write operations **/
+    public DataProvider getDataProvider();
+
+    /** Get provider to access read/write operations for maintenance **/
+    public HtDatabaseMaintenance getHtDatabaseMaintenance();
+
+    /** Set overall ready status from outside of this data-provider **/
+    public void setReadyStatus(boolean status);
+
+    /** Set some static status information after startup */
+    public void setStatus(StatusKey key,String value);
+
+    /** Database configuration information **/
+    public IEsConfig getEsConfig();
+
+    /** Provide NetconfTimeStamp handler **/
+    public NetconfTimeStamp getConverter();
+}
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEsConfig.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEsConfig.java
new file mode 100644
index 0000000..f41095d
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEsConfig.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.filechange.IConfigChangedListener;
+
+public interface IEsConfig {
+
+    String getCluster();
+
+    /**
+     * @return seconds
+     */
+    long getArchiveCheckIntervalSeconds();
+
+    /**
+     * @return seconds
+     */
+    long getArchiveLifetimeSeconds();
+
+    /**
+     * @param archiveCleanService
+     */
+    void unregisterConfigChangedListener(IConfigChangedListener archiveCleanService);
+
+    /**
+     * @param archiveCleanService
+     */
+    void registerConfigChangedListener(IConfigChangedListener archiveCleanService);
+
+
+   
+}
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/NetconfTimeStamp.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/NetconfTimeStamp.java
new file mode 100644
index 0000000..5bed9f7
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/NetconfTimeStamp.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+
+/**
+ * @author herbert
+ *
+ */
+public interface NetconfTimeStamp {
+
+	/**
+	 * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format
+	 *
+	 * @return String with Date in NETCONF/YANG Format Version 1.0.
+	 */
+	String getTimeStampAsNetconfString();
+
+	/**
+	 * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format
+	
+	 * @return String with Date in NETCONF/YANG Format Version 1.0.
+	 */
+	String getTimeStampAsNetconfString(Date date);
+
+	/**
+	 * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
+	 *
+	 * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
+	 */
+	DateAndTime getTimeStamp();
+
+	/**
+	 * Get time from date as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
+	 * @param date specifying the date and time
+	 * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
+	 */
+	DateAndTime getTimeStamp(Date date);
+
+	/**
+	 * Get time from date as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
+	 * @param date specifying the date and time
+	 * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
+	 */
+	DateAndTime getTimeStamp(String date);
+
+	/**
+	 * Return the String with a NETCONF time converted to long
+	 *
+	 * @param netconfTime as String according the formats given above
+	 * @return Epoch milliseconds
+	 * @throws IllegalArgumentException In case of no compliant time format definition for the string
+	 */
+	long getTimeStampFromNetconfAsMilliseconds(String netconfTime) throws IllegalArgumentException;
+
+	/**
+	 * Deliver String result.
+	 *
+	 * @param netconfTime as String according the formats given above
+	 * @return If successful: String in ISO8601 Format for database and presentation. If "wrong formed
+	 *         input" the Input string with the prefix "Maleformed date" is delivered back.
+	 */
+	String getTimeStampFromNetconf(String netconfTime);
+
+	Date getDateFromNetconf(String netconfTime);
+
+	String getTimeStampAsNetconfString(LocalDateTime dt);
+
+}
\ No newline at end of file
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/StatusChangedHandler.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/StatusChangedHandler.java
new file mode 100644
index 0000000..fa64d4d
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/StatusChangedHandler.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+
+public interface StatusChangedHandler {
+
+	public enum StatusKey {
+		CLUSTER_SIZE,
+		
+	}
+	public void onStatusChanged(StatusKey key,String newValue);
+	
+}
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/types/NetconfTimeStampImpl.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/types/NetconfTimeStampImpl.java
new file mode 100644
index 0000000..f5dd652
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/types/NetconfTimeStampImpl.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types;
+
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
+import java.util.Date;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 2019/06/17 Redesign to ZonedDateTime because of sync problems.
+ *
+ * Function is handling the NETCONF and the format used by database and restconf communication.
+ *
+ * Input supported for the formats used in NETCONF messages:
+ *
+ * Format1 ISO 8601 2017-01-18T11:44:49.482-05:00
+ *
+ * Format2 NETCONF - pattern from ietf-yang-types "2013-07-15" Pattern:
+ * "\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[\+\-](\d{2}):(\d{2}))"
+ *
+ * Format3 NETCONF DateAndTime CoreModel-CoreFoundationModule-TypeDefinitions vom
+ * 2016-07-01 Example1: 20170118114449.1Z Example2: 20170118114449.1-0500 Pattern:
+ * "\d{4}\d{2}\d{2}\d{2}\d{2}\d{2}.\d+?(Z|[\+\-](\d{2})(\d{2}))" typedef DateAndTime { description
+ * "This primitive type defines the date and time according to the following structure:
+ * 'yyyyMMddhhmmss.s[Z|{+|-}HHMm]' where: yyyy '0000'..'9999' year MM '01'..'12' month dd '01'..'31'
+ * day hh '00'..'23' hour mm '00'..'59' minute ss '00'..'59' second s '.0'..'.9' tenth of second
+ * (set to '.0' if EMS or NE cannot support this granularity) Z 'Z' indicates UTC (rather than local
+ * time) {+|-} '+' or '-' delta from UTC HH '00'..'23' time zone difference in hours Mm '00'..'59'
+ * time zone difference in minutes."; type string; } Format4 E/// specific Example1:
+ * 2017-01-23T13:32:38-05:00 Example2: 2017-01-23T13:32-05:00
+ *
+ * Input formats netconfTime as String according the formats given above
+ *
+ * Return format is String in ISO8601 Format for database and presentation.
+ *
+ * Example formats:
+ *    1) ISO8601. Example 2017-01-18T11:44:49.482-05:00
+ *    2) Microwave ONF. Examples 20170118114449.1Z, 20170118114449.1-0500
+ *    3.1) Ericson. Example: 2017-01-23T13:32:38-05:00
+ *    3.2) Ericson. Example: 2017-01-23T13:32-05:00
+ *          Always 10 Groups,
+ *          1:Year 2:Month 3:day 4:Hour 5:minute 6:optional sec 7:optional ms 8:optional Z or 9:offset
+ *           signedhour 10:min
+ *
+ * Template:
+ *     private static final NetconfTimeStamp NETCONFTIME_CONVERTER = NetconfTimeStamp.getConverter();
+ */
+
+public class NetconfTimeStampImpl implements NetconfTimeStamp {
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfTimeStamp.class);
+
+    private static final NetconfTimeStamp CONVERTER = new NetconfTimeStampImpl();
+
+    /**
+     * Specify the input format expected from netconf, and from specific devices.
+     */
+    private static DateTimeFormatter formatterInput = DateTimeFormatter.ofPattern(""
+            + "[yyyy-MM-dd'T'HH:mm[:ss][.SSS][.SS][.S][xxx][xx][X][Z]]"
+            + "[yyyyMMddHHmmss[.SSS][.SS][.S][xxx][xx][X][Z]]"
+            ).withZone(ZoneOffset.UTC);
+
+    /**
+     * Specify output format that is used internally
+     */
+    private static DateTimeFormatter formatterOutput = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.S'Z'")
+            .withZone(ZoneOffset.UTC);
+
+    /**
+     * Use static access
+     */
+    private NetconfTimeStampImpl() {
+    }
+
+    /*
+     * ------------------------------------ Public function
+     */
+
+    /**
+     * Use this function to get the converter
+     * @return global converter
+     */
+    public static NetconfTimeStamp getConverter() {
+        return CONVERTER;
+    }
+
+    /**
+     * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format
+     *
+     * @return String with Date in NETCONF/YANG Format Version 1.0.
+     */
+    @Override
+    public String getTimeStampAsNetconfString() {
+        return ZonedDateTime.now(ZoneOffset.UTC).format(formatterOutput);
+    }
+
+    /**
+     * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format
+
+     * @return String with Date in NETCONF/YANG Format Version 1.0.
+     */
+    @Override
+    public String getTimeStampAsNetconfString(Date date) {
+        return ZonedDateTime.ofInstant(date.toInstant(),ZoneOffset.UTC).format(formatterOutput);
+    }
+
+
+
+    /**
+     * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
+     *
+     * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
+     */
+    @Override
+    public DateAndTime getTimeStamp() {
+        return DateAndTime.getDefaultInstance(getTimeStampAsNetconfString());
+    }
+
+    /**
+     * Get time from date as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
+     * @param date specifying the date and time
+     * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
+     */
+    @Override
+    public DateAndTime getTimeStamp(Date date) {
+        return DateAndTime.getDefaultInstance(getTimeStampAsNetconfString(date));
+    }
+    /**
+     * Get time from date as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
+     * @param date specifying the date and time
+     * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
+     */
+    @Override
+    public DateAndTime getTimeStamp(String date) {
+        return DateAndTime.getDefaultInstance(date);
+    }
+
+    /**
+     * Return the String with a NETCONF time converted to long
+     *
+     * @param netconfTime as String according the formats given above
+     * @return Epoch milliseconds
+     * @throws IllegalArgumentException In case of no compliant time format definition for the string
+     */
+    @Override
+    public long getTimeStampFromNetconfAsMilliseconds(String netconfTime) throws IllegalArgumentException {
+        try {
+            long utcMillis = doParse(netconfTime).toInstant().toEpochMilli();
+            return utcMillis;
+        } catch (DateTimeParseException e) {
+            throw new IllegalArgumentException(
+                    "No pattern for NETCONF data string: " + netconfTime + " Msg:" + e.getMessage());
+        }
+       }
+
+    /**
+     * Deliver String result.
+     *
+     * @param netconfTime as String according the formats given above
+     * @return If successful: String in ISO8601 Format for database and presentation. If "wrong formed
+     *         input" the Input string with the prefix "Maleformed date" is delivered back.
+     */
+    @Override
+    public String getTimeStampFromNetconf(String netconfTime) {
+        try {
+            String inputUTC = doParse(netconfTime).format(formatterOutput);
+            return inputUTC;
+        } catch (Exception e) {
+            LOG.info(e.getMessage());
+         }
+        LOG.debug("No pattern for NETCONF data string: {}", netconfTime);
+        return "Malformed date: " + netconfTime; // Error handling
+    }
+
+    /*----------------------------------------------------
+     * Private functions
+     */
+
+    private OffsetDateTime doParse(String netconfTime) {
+        return OffsetDateTime.parse(netconfTime, formatterInput);
+    }
+
+    @Override
+    public Date getDateFromNetconf(String netconfTime) {
+        return Date.from(LocalDateTime.parse(netconfTime, formatterInput).atZone(ZoneOffset.UTC).toInstant());
+    }
+
+    @Override
+    public String getTimeStampAsNetconfString(LocalDateTime dt) {
+        return formatterOutput.format(dt);
+    }
+
+}
diff --git a/sdnr/wt/data-provider/model/src/main/yang/dataprovider.yang b/sdnr/wt/data-provider/model/src/main/yang/dataprovider.yang
new file mode 100644
index 0000000..3a56661
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/yang/dataprovider.yang
@@ -0,0 +1,1228 @@
+module data-provider {
+
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:data-provider";
+    prefix "odluxprovider";
+
+    import ietf-yang-types { prefix "yang"; revision-date 2013-07-15; }
+    import netconf-node-topology { prefix "nettop"; revision-date 2015-01-14; }
+    description
+        "data-provider api module";
+
+    revision "2019-08-01" {
+        description
+                "Initial revision";
+    }
+    // --- typedef
+    typedef Entity {
+        description "Data type and alias for elasticsearch or table name for SQL database.";
+        type enumeration {
+            enum connectionlog {
+                description "logs mountpoint connection state changes";
+            }
+            enum faultcurrent {
+                description "current faults";
+            }
+            enum eventlog {
+                description "logs for all notifications e.g. netconf, ves and internal events";
+            }
+            enum faultlog {
+                description "faultlog information";
+            }
+            enum historicalperformance15min {
+                description "performance data";
+            }
+            enum historicalperformance24h {
+                description "performance data";
+            }
+            enum mediator-server {
+                description "list of mediator servers";
+            }
+            enum networkelement-connection {
+                description "list of mountpoints for netconf devices (joint required-network-element+mdsal
+                                state";
+            }
+            enum inventoryequipment {
+                description "list of equipment inventory";
+            }
+            enum maintenancemode {
+                description "list of maintenance setting";
+            }
+        }
+    }
+    typedef SortOrder {
+        type enumeration {
+            enum ascending {
+            }
+            enum descending {
+            }
+        }
+        description "Entities for odlux clients";
+    }
+    typedef FilterProperty {
+        type string;
+    }
+
+    typedef NotificationType {
+        type enumeration {
+            enum ProblemNotificationXml {
+                description "";
+            }
+            enum AttributeValueChangedNotificationXml {
+                description "";
+            }
+        }
+    }
+
+    typedef ConnectionLogStatus {
+        type enumeration {
+            enum Mounted {
+                description "Mountpoint created";
+            }
+            enum Unmounted {
+                description "Mountpoint removed";
+            }
+            enum Connecting {
+                description "Mountpoint establishing connection";
+            }
+            enum Connected {
+                description "Mountpoint connection established";
+            }
+            enum UnableToConnect {
+                description "Mountpoint connection not possible";
+            }
+            enum Disconnected {
+                description "Required and mountpoint removed";
+            }
+            enum Undefined {
+                description "Status not available";
+            }
+        }
+    }
+    typedef NetworkElementDeviceType {
+        type enumeration {
+            enum Wireless {
+                description "implements microwave-model.yang or air-interface.yang";
+            }
+            enum RAN {
+                description "implements sth. like o-ran*.yang";
+            }
+            enum ORAN {
+                description "implements RAN according to o-ran*.yang";
+            }
+            enum RAN3GPP {
+                description "implements RAN according to _3gpp-ran*.yang";
+            }
+            enum Optical {
+                description "implements tapi-*.yang or org-openroadm*.yang";
+            }
+            enum Router {
+                description "implements vlan-interface.yang";
+            }
+            enum NtsManager {
+
+                description "Simulation of device";
+            }
+            enum Nonsupported {
+                description "Device type known, but not support";
+            }
+            enum Unknown {
+                description "Device type at this point of time unknown";
+            }
+        }
+    }
+    typedef severity-type {
+        type enumeration {
+            enum NonAlarmed {
+                description "problem cleared indication";
+            }
+            enum Warning {
+                description "problem level";
+            }
+            enum Minor {
+                description "problem level";
+            }
+            enum Major {
+                description "problem level";
+            }
+            enum Critical {
+                description "problem level";
+            }
+        }
+        description "According to ITU-T M.3160";
+    }
+    typedef source-type {
+        type enumeration {
+            enum ves {
+                description "VES Interface";
+            }
+            enum netconf {
+                description "NETCONF Interface";
+            }
+            enum controller {
+                description "SDN Controller";
+            }
+            enum unknown {
+                description "Unknown source";
+            }
+        }
+    }
+    typedef granularity-period-type {
+        type enumeration {
+            enum unknown {
+                description "none";
+            }
+            enum period-15-min {
+                description "none";
+            }
+            enum period-24-hours {
+                description "none";
+            }
+        }
+        description "The enumeration with the options for granularity period of the performance data similar to g.874.1-model";
+    }
+    // --- grouping and builder-container
+    grouping connectionlog-entity {
+        leaf id {
+            type string;
+            description "database id";
+        }
+        leaf node-id {
+            type string;
+            description "the node/mountpoint which connection state has changed";
+        }
+        leaf timestamp {
+            type yang:date-and-time;
+            description "timestamp when event happened";
+        }
+        leaf status {
+            type ConnectionLogStatus;
+            description "new state of the connection of the device";
+        }
+    }
+    container connectionlog {
+        description "builder";
+        uses connectionlog-entity;
+    }
+    grouping object-change-reference {
+        description "Reference of of object (e.g. Interface pack) owned by a node";
+        leaf node-id {
+            type string;
+        }
+        leaf counter {
+            type int32;
+        }
+        leaf timestamp {
+            type yang:date-and-time;
+        }
+        leaf object-id {
+            type string;
+        }
+    }
+    grouping source-reference {
+        description "Identify a source";
+        leaf source-type {
+            type source-type;
+        }
+    }
+    grouping fault {
+        description "Fault event of an object";
+        leaf problem {
+            type string;
+        }
+        leaf severity {
+            type severity-type;
+        }
+    }
+    grouping attribute-change {
+        description "update change of an attribute";
+        leaf attribute-name {
+            type string;
+        }
+        leaf new-value {
+            type string;
+        }
+    }
+    grouping entity-id {
+        description "Unique database id of entity";
+        leaf id {
+            type string;
+        }
+    }
+    grouping faultcurrent-entity {
+        description "Current fault status";
+        uses object-change-reference;
+        uses fault;
+        uses entity-id;
+    }
+    container faultcurrent {
+        description "builder";
+        uses faultcurrent-entity;
+    }
+    grouping faultlog-entity {
+        description "Changed fault indication";
+        uses source-reference;
+        uses object-change-reference;
+
+        uses fault;
+        uses entity-id;
+    }
+    container faultlog {
+        description "builder";
+        uses faultlog-entity;
+    }
+    grouping eventlog-entity {
+        description "One change event of devices";
+        uses source-reference;
+        uses object-change-reference;
+        uses attribute-change;
+        uses entity-id;
+    }
+    container eventlog {
+        description "builder";
+        uses eventlog-entity;
+    }
+    grouping filter {
+        leaf description {
+            type string;
+            description "Filter specific description";
+        }
+        leaf start {
+            type yang:date-and-time;
+            description "begin of maintenance-mode";
+        }
+        leaf end {
+            type yang:date-and-time;
+            description "end of maintenance-mode";
+        }
+        leaf object-id-ref {
+            type string;
+            description "object id to filter on, or empty for all";
+        }
+        leaf problem {
+            type string;
+            description "name of the problem to filter or empty for all";
+        }
+    }
+    grouping maintenance-entity {
+        description "Maintenance mode for a device. ";
+        leaf id {
+            mandatory true;
+            type string;
+            description "Key to get/set configuration entry in database. Normally Mountpoint-name
+                        is used as key id of node.";
+        }
+        leaf node-id {
+            mandatory true;
+            type string;
+            description "";
+        }
+        leaf active {
+            type boolean;
+            description "Configuration to activate or deactivate this entry";
+        }
+        uses filter;
+    }
+    container maintenance {
+        description "builder";
+        uses maintenance-entity;
+    }
+    grouping mediator-server-entity {
+        leaf id {
+            mandatory true;
+            type string;
+        }
+        leaf url {
+            type string;
+        }
+        leaf name {
+            type string;
+        }
+    }
+    grouping pmdata-base {
+       description "Performance data base information";
+        leaf node-name {
+            type string;
+        }
+        leaf uuid-interface {
+            type string;
+        }
+        leaf layer-protocol-name {
+            type string;
+        }
+        leaf radio-signal-id {
+            type string;
+        }
+        leaf time-stamp {
+            type yang:date-and-time;
+        }
+        leaf suspect-interval-flag {
+            type boolean;
+        }
+        leaf granularity-period {
+            type granularity-period-type;
+        }
+        leaf scanner-id {
+            type string;
+        }
+    }
+    grouping pmdata-microwave {
+        description "Consolidated performance information of all microwave model interface pacs";
+        leaf es {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "Number of errored seconds.";
+        }
+        leaf ses {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "Number of severely errored seconds.";
+        }
+        leaf cses {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "Number of consecutive severely errored seconds.";
+        }
+        leaf unavailability {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "Total time of unavailability in seconds.";
+        }
+        leaf tx-level-min {
+            type int8;
+            units "dBm";
+            default 99;
+            config false;
+            description "Minimum transmit power. Signed integers are required.";
+        }
+        leaf tx-level-max {
+            type int8;
+            units "dBm";
+            default 99;
+            config false;
+            description "Maximum transmit power. Signed integers are required.";
+        }
+        leaf tx-level-avg {
+            type int8;
+            units "dBm";
+            default 99;
+            config false;
+            description "Averaged transmit power. Signed integers are required.";
+        }
+        leaf rx-level-min {
+            type int8;
+            units "dBm";
+            default 99;
+            config false;
+            description "Minimum receive level. Signed integers are required.";
+        }
+        leaf rx-level-max {
+            type int8;
+            units "dBm";
+            default 99;
+            config false;
+            description "Maximum receive level. Signed integers are required.";
+        }
+        leaf rx-level-avg {
+            type int8;
+            units "dBm";
+            default 99;
+            config false;
+            description "Averaged receive level. Signed integers are required.";
+        }
+        leaf time2-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "Sum of all seconds the transmitter operated in e.g. BPSK.";
+        }
+        leaf time4-states-s {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time4-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time8-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time16-states-s {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time16-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time32-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time64-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time128-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time256-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time512-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time512-states-l {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time1024-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time1024-states-l {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time2048-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time2048-states-l {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time4096-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time4096-states-l {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time8192-states {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf time8192-states-l {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "none";
+        }
+        leaf snir-min {
+            type int8;
+            units "dB";
+            default -99;
+            config false;
+            description "Minimum signal to (noise+interference) ratio.";
+        }
+        leaf snir-max {
+            type int8;
+            units "dB";
+            default -99;
+            config false;
+            description "Maximum signal to (noise+interference) ratio.";
+        }
+        leaf snir-avg {
+            type int8;
+            units "dB";
+            default -99;
+            config false;
+            description "Averaged signal to (noise+interference) ratio.";
+        }
+        leaf xpd-min {
+            type int8;
+            units "dB";
+            default -99;
+            config false;
+            description "Minimum cross polarization discrimination.";
+        }
+        leaf xpd-max {
+            type int8;
+            units "dB";
+            default -99;
+            config false;
+            description "Maximum cross polarization discrimination.";
+        }
+        leaf xpd-avg {
+            type int8;
+            units "dB";
+            default -99;
+            config false;
+            description "Averaged cross polarization discrimination.";
+        }
+        leaf rf-temp-min {
+            type int8;
+            units "C";
+            default -99;
+            config false;
+            description "Lowest temperature (in degree Celsius) of the radio module inside the outdoor unit.";
+        }
+        leaf rf-temp-max {
+            type int8;
+            units "C";
+            default -99;
+            config false;
+            description "Highest temperature (in degree Celsius) of the radio module inside the outdoor unit.";
+        }
+        leaf rf-temp-avg {
+            type int8;
+            units "C";
+            default -99;
+            config false;
+            description "Averaged temperature (in degree Celsius) of the radio module inside the outdoor unit.";
+        }
+        leaf defect-blocks-sum {
+            type int16;
+            units "blocks";
+            default -1;
+            config false;
+            description "Total number of blocks that were defect after receiving and could not be corrected by the FEC.";
+        }
+        leaf time-period {
+            type int32;
+            units "s";
+            default -1;
+            config false;
+            description "Total length of the measurement period.";
+        }
+    }
+    grouping pmdata-ethernet {
+        description "Consolidated performance information for ethernet.";
+        leaf tx-ethernet-bytes-max-s {
+            type int32;
+            units "Bytes/s";
+            default -1;
+            config false;
+            description "Counts the number of Bytes of Ethernet traffic (before header compression) transmitted within a second and keeps the highest value within the measurement period. Field to be left blank for all types of TDM containers.";
+        }
+        leaf tx-ethernet-bytes-max-m {
+            type int64;
+            units "Bytes/min";
+            default -1;
+            config false;
+            description "Counts the number of Bytes of Ethernet traffic (before header compression) transmitted within a minute and keeps the highest value with in the measurement period. Field to be left blank for all types of TDM containers.";
+        }
+        leaf tx-ethernet-bytes-sum {
+            type int64;
+            units "Bytes";
+            default -1;
+            config false;
+            description "Total number of Bytes of Ethernet traffic (before header compression) transmitted (in direction out of the device) during the measurement period. Field to be left blank for all types of TDM containers.";
+        }
+    }
+    container pmdata-entity {
+        description "builder";
+        uses pmdata-base;
+        container performance-data {
+            uses pmdata-microwave;
+            uses pmdata-ethernet;
+        }
+    }
+    grouping pmdata15m-entity {
+        uses pmdata-base;
+        container performance-data {
+            uses pmdata-microwave;
+            uses pmdata-ethernet;
+        }
+    }
+    grouping pmdata24h-entity {
+        uses pmdata-base;
+        container performance-data {
+            uses pmdata-microwave;
+            uses pmdata-ethernet;
+        }
+    }
+    grouping inventory-entity {
+        description "One equipment entity in a list of a network element that could be rack, card, backplane, module";
+
+        leaf id {
+            description "Unique database id, node-id/uuid";
+            mandatory true;
+            type string;
+        }
+        leaf tree-level {
+            description "Containment level, starting with 0..";
+            type uint32;
+        }
+        leaf parent-uuid {
+            description "Unique inventory id of holder";
+            type string;
+        }
+        leaf node-id {
+            description "Unique node id of network element";
+            type string;
+        }
+        leaf uuid {
+            description "Unique inventory id of this node for this equipement, provided by network element";
+            type string;
+        }
+        leaf-list contained-holder {
+            description "List of uuid of contained equipment";
+            type string;
+        }
+        leaf manufacturer-name {
+            description "manufactured-thing/manufacturer-properties/manufacturer-name";
+            type string;
+        }
+        leaf manufacturer-identifier {
+            description "manufactured-thing/manufacturer-properties/manufacturer-identifier";
+            type string;
+        }
+        leaf serial {
+            description "manufactured-thing/equipment-instance/serial";
+            type string;
+        }
+        leaf date {
+            description "manufactured-thing/equipment-instance/manufacture-date: Date information provided by manufacturer. No specific format. ()";
+            type string;
+        }
+        leaf version {
+            description "manufactured-thing/equipment-type/version";
+            type string;
+        }
+        leaf description {
+            description "manufactured-thing/equipment-type/description";
+            type string;
+        }
+        leaf part-type-id {
+            description "manufactured-thing/equipment-type/part-type-identifier";
+            type string;
+        }
+        leaf model-identifier {
+            description "manufactured-thing/equipment-type/model-identifier";
+            type string;
+        }
+        leaf type-name {
+            description "manufactured-thing/equipment-type/type-name";
+            type string;
+        }
+    }
+    container inventory {
+        description "builder";
+        uses inventory-entity;
+    }
+    grouping node-details-g {
+        leaf-list available-capabilities {
+            type string;
+        }
+        leaf-list unavailable-capabilities {
+            type string;
+        }
+    }
+    grouping network-element-connection-entity {
+
+        leaf id {
+            type string;
+            description "database id/key. here is equal to node-id";
+        }
+        leaf node-id {
+            type string;
+            description "mountpoint name of device in controller";
+        }
+        leaf host {
+            type string;
+            description "netconf hostname or ip address of device";
+        }
+        leaf port {
+            type uint32;
+            description "netconf port of device";
+        }
+        leaf username {
+            type string;
+            description "netconf username";
+        }
+        leaf password {
+            type string;
+            description "netconf password. should be removed asap";
+        }
+        leaf core-model-capability {
+            type string;
+            description "revision of core-model capability";
+        }
+        leaf device-type {
+            type NetworkElementDeviceType;
+            description "categoried type of ne based on implemented yang specs";
+        }
+        leaf is-required {
+            type boolean;
+            description "entry exists in db index required-networkelement";
+        }
+        container node-details {
+            uses node-details-g;
+            description "holder of available and unavailable capabilities";
+        }
+        leaf status {
+            type ConnectionLogStatus;
+            description "current connection status. default Disconnected";
+        }
+    }
+    container network-element-connection {
+        description "builder";
+        uses network-element-connection-entity;
+    }
+    grouping status-entity {
+        container faults {
+            leaf criticals {
+                type uint32;
+            }
+            leaf majors {
+                type uint32;
+            }
+            leaf minors {
+                type uint32;
+            }
+            leaf warnings {
+                type uint32;
+            }
+        }
+    }
+    container status {
+        description "builder";
+         uses status-entity;
+    }
+    grouping entity-input {
+        list filter {
+            key property;
+            leaf property {
+                type string;
+            }
+            leaf filtervalue {
+                type string;
+            }
+            description "List with filter criteria. Not listed means all.";
+        }
+        list sortorder {
+            key property;
+            leaf property {
+                type string;
+            }
+            leaf sortorder {
+                type SortOrder;
+            }
+            description "List with sort order. Not listed means default";
+        }
+        container pagination {
+            leaf size {
+                type uint32 {
+                    range "1..max";
+                }
+                default 20;
+                description "Number of entries to be delivered";
+            }
+            leaf page {
+                type uint64 {
+                    range "1..max";
+                }
+                default 1;
+                description "Number to be used to calculate starting entry to deliver";
+            }
+        }
+    }
+    grouping pagination-output-g {
+        leaf size {
+            type uint32 {
+                range "1..max";
+            }
+            default 20;
+            description "Number of entries to be delivered";
+        }
+        leaf page {
+            type uint64 {
+                range "1..max";
+            }
+            default 1;
+            description "Number to be used to calculate starting entry to deliver";
+        }
+        leaf total {
+            type uint64 {
+                range "0..max";
+            }
+            default 0;
+            description "Number to be used to calculate starting entry to deliver";
+        }
+    }
+    container pagination-output {
+        description "builder";
+        uses pagination-output-g;
+    }
+    // --- rpc
+    rpc read-faultcurrent-list {
+        description
+                "Get list of faultcurrent entries according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses faultcurrent-entity;
+            }
+        }
+    }
+    rpc read-faultlog-list {
+        description
+                "Get list of faultlog entries according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses faultlog-entity;
+            }
+        }
+    }
+
+    rpc read-eventlog-list {
+        description
+                "Get list of eventlog entities according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses eventlog-entity;
+            }
+        }
+    }
+    rpc read-connectionlog-list {
+        description
+                "Get list of eventlog entities according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses connectionlog-entity;
+            }
+        }
+    }
+    rpc read-maintenance-list {
+        description
+                "Get list of maintenance entries according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses maintenance-entity;
+            }
+        }
+    }
+    rpc create-maintenance {
+        description
+                "insert new entry of maintenance";
+        input {
+            uses maintenance-entity;
+        }
+        output {
+            uses maintenance-entity;
+        }
+    }
+    rpc update-maintenance {
+        description
+                "update existing entity of maintenance";
+        input {
+            uses maintenance-entity;
+        }
+        output {
+            uses maintenance-entity;
+        }
+    }
+    rpc delete-maintenance {
+        description
+                "delete entity of maintenance";
+        input {
+            uses maintenance-entity;
+        }
+        output {
+        }
+    }
+
+    rpc read-mediator-server-list {
+        description
+                "Get list of mediator-servers according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses mediator-server-entity;
+            }
+        }
+    }
+    rpc create-mediator-server {
+        description
+                "create new entry of entity mediator-server";
+        input {
+            uses mediator-server-entity;
+        }
+        output {
+            uses mediator-server-entity;
+        }
+    }
+    rpc update-mediator-server {
+        description
+                "update entry of entity mediator-server";
+        input {
+            uses mediator-server-entity;
+        }
+        output {
+            uses mediator-server-entity;
+        }
+    }
+    rpc delete-mediator-server {
+        description
+                "delete entry of entity mediator-server";
+        input {
+            uses mediator-server-entity;
+        }
+        output {
+        }
+    }
+    rpc read-network-element-connection-list {
+        description
+                "Get list of networkelement-connections according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses network-element-connection-entity;
+            }
+        }
+    }
+    rpc create-network-element-connection {
+        description "create entry in networkelement-connection";
+        input {
+            uses network-element-connection-entity;
+        }
+        output {
+            uses network-element-connection-entity;
+        }
+    }
+    rpc update-network-element-connection {
+        description "Put an element to ne-entity";
+        input {
+            uses network-element-connection-entity;
+        }
+        output {
+            uses network-element-connection-entity;
+        }
+    }
+    rpc delete-network-element-connection {
+        description "!ONLY FOR TESTING! Put an element to ne-entity";
+        input {
+            uses network-element-connection-entity;
+        }
+        output {
+        }
+    }
+
+    rpc read-pmdata-15m-ltp-list {
+        description
+                "Get list of ltps for one mountpoint with historical pmdata";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            leaf-list data {
+                type string;
+            }
+        }
+    }
+    rpc read-pmdata-24h-ltp-list {
+        description
+                "Get list of ltps for one mountpoint with historical pmdata";
+        input {
+            uses entity-input;
+        }
+
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            leaf-list data {
+                type string;
+            }
+        }
+    }
+    rpc read-pmdata-15m-device-list {
+        description
+                "Get list of mountpoints with historical pmdata";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            leaf-list data {
+                type string;
+            }
+        }
+    }
+    rpc read-pmdata-24h-device-list {
+        description
+                "Get list of mountpoints with historical pmdata";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            leaf-list data {
+                type string;
+            }
+        }
+    }
+
+    rpc read-pmdata-15m-list {
+        description
+                "Get list of entities according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses pmdata15m-entity;
+            }
+        }
+    }
+    rpc read-pmdata-24h-list {
+        description
+                "Get list of historical pmdata according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses pmdata24h-entity;
+            }
+        }
+    }
+    rpc read-inventory-list {
+        description
+                "Get list of inventory according to filter";
+        input {
+            uses entity-input;
+        }
+        output {
+            container pagination {
+                uses pagination-output-g;
+            }
+            list data {
+                uses inventory-entity;
+            }
+        }
+    }
+    rpc read-status {
+        description
+                "Read status information of controller";
+        output {
+            list data {
+                uses status-entity;
+            }
+        }
+    }
+}
+
diff --git a/sdnr/wt/data-provider/pom.xml b/sdnr/wt/data-provider/pom.xml
new file mode 100755
index 0000000..1d2a255
--- /dev/null
+++ b/sdnr/wt/data-provider/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ * ============LICENSE_START=======================================================
+ * ONAP : CCSDK.sdnr.wt.data-provider
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+
+-->
+<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>1.5.2-SNAPSHOT</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+    <artifactId>sdnr-wt-data-provider-top</artifactId>
+    <version>0.7.1-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <name>ccsdk-features :: ${project.artifactId}</name>
+
+    <modules>
+        <module>model</module>
+        <module>provider</module>
+        <module>feature</module>
+        <module>installer</module>
+    </modules>
+
+    <properties>
+        <feature-name>sdnr-wt-data-provider</feature-name>
+    </properties>
+</project>
diff --git a/sdnr/wt/data-provider/provider/copyright b/sdnr/wt/data-provider/provider/copyright
new file mode 100644
index 0000000..754b621
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/copyright
@@ -0,0 +1,17 @@
+/**
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ */
diff --git a/sdnr/wt/data-provider/provider/pom.xml b/sdnr/wt/data-provider/provider/pom.xml
new file mode 100644
index 0000000..e862b2e
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/pom.xml
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    ============LICENSE_START=======================================================
+    ONAP : CCSDK / SDNR / WT / data-provider
+    ================================================================================
+    Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All
+    rights reserved.
+    ================================================================================
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not
+    use this file except in compliance with the License. You may obtain a copy
+    of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+    by applicable law or agreed to in writing, software distributed under the
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+    OF ANY KIND, either express or implied. See the License for the specific
+    language governing permissions and limitations under the License.
+    ============LICENSE_END=========================================================
+-->
+<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>binding-parent</artifactId>
+        <version>1.5.2-SNAPSHOT</version>
+        <relativePath />
+    </parent>
+
+    <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+    <artifactId>sdnr-wt-data-provider-provider</artifactId>
+    <version>0.7.1-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>ccsdk-features :: ${project.artifactId}</name>
+    <licenses>
+        <license>
+            <name>Apache License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+        </license>
+    </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}</buildtime>
+        <databaseport>49402</databaseport>
+        <odlux.buildno>39.0e1988b(20/01/12)</odlux.buildno>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sdnr-wt-data-provider-model</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+         <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+            <dependency>
+            <groupId>org.apache.karaf.shell</groupId>
+            <artifactId>org.apache.karaf.shell.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.netconf</groupId>
+            <artifactId>sal-netconf-connector</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+            <artifactId>rfc6991-ietf-yang-types</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal</groupId>
+            <artifactId>yang-binding</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal</groupId>
+            <artifactId>mdsal-singleton-common-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>**/gen/**</exclude>
+                        <exclude>**/generated-sources/**</exclude>
+                        <exclude>**/yang-gen-sal/**</exclude>
+                        <exclude>**/pax/**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generateDTOs</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>exec</goal>
+                          </goals>
+                            <configuration>
+                               <executable>bash</executable>
+                               <arguments>
+                                   <argument>${basedir}/../../data-provider/provider/src/main/resources/es-init.sh</argument>
+                                   <argument>initfile</argument>
+                                   <argument>-f</argument>
+                                   <argument>${project.build.directory}/EsInit.script</argument>
+                               </arguments>
+                          </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.github.alexcojocaru</groupId>
+                <artifactId>elasticsearch-maven-plugin</artifactId>
+                <version>6.16</version>
+                <configuration>
+                    <skip>${skipTests}</skip>
+                    <clusterName>testCluster</clusterName>
+                    <transportPort>9500</transportPort>
+                    <httpPort>${databaseport}</httpPort>
+                    <version>6.5.0</version>
+                    <timeout>120</timeout>
+                    <pathInitScript>${project.build.directory}/EsInit.script</pathInitScript>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>start-elasticsearch</id>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>runforked</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>stop-elasticsearch</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemProperties>
+                        <property>
+                            <name>databaseport</name>
+                            <value>${databaseport}</value>
+                        </property>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/DataObjectAcessor.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/DataObjectAcessor.java
new file mode 100644
index 0000000..aef6356
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/DataObjectAcessor.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.EsDataObjectReaderWriter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataObjectAcessor<T extends DataObject> extends EsDataObjectReaderWriter<T> {
+
+	private static final Logger LOG = LoggerFactory.getLogger(DataObjectAcessor.class);
+
+	public DataObjectAcessor(HtDatabaseClient dbClient, Entity entity, Class<T> clazz) throws ClassNotFoundException {
+		this(dbClient, entity, clazz, true);
+		LOG.info("Create {}", this.getClass().getName());
+	}
+
+	public DataObjectAcessor(HtDatabaseClient dbClient, Entity entity, Class<T> clazz, boolean idSupported) throws ClassNotFoundException {
+		super(dbClient, entity, clazz);
+		if (idSupported) {
+			setEsIdAttributeName("_id");
+		}
+	}
+
+	QueryResult<T> getData(EntityInput input) {
+		long page = QueryByFilter.getPage(input);
+		long pageSize = QueryByFilter.getPageSize(input);
+        LOG.info("Request: {}", this.getDataTypeName());
+		QueryBuilder query = QueryByFilter.fromFilter(input.getFilter()).from((page - 1) * pageSize).size(pageSize);
+		QueryByFilter.setSortOrder(query, input.getSortorder());
+		SearchResult<T> result = doReadAll(query,query.contains("range"));
+		return new QueryResult<>(page, pageSize, result);
+	}
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/DataObjectAcessorPm.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/DataObjectAcessorPm.java
new file mode 100644
index 0000000..a145a9f
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/DataObjectAcessorPm.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.io.IOException;
+
+import org.onap.ccsdk.features.sdnr.wt.common.database.ExtRestClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.SearchRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.AggregationEntries;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.SearchResponse;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SortOrder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Sortorder;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataObjectAcessorPm<T extends DataObject> extends DataObjectAcessor<T> {
+
+ 	private final Logger LOG = LoggerFactory.getLogger(DataObjectAcessorPm.class);
+
+	private static final String UUID_KEY = "uuid-interface";
+	private static final String NODE_KEY = "node-name";
+	private static final String KEY = "node-name";
+
+
+	enum Intervall {
+		PMDATA15M("historicalperformance15min", "historicalperformance15min"),
+		PMDATA24H("historicalperformance24h", "historicalperformance24h");
+
+		String index;
+		String type;
+
+		Intervall(String index, String type) {
+		    this.index = index;
+		    this.type = type;
+		}
+
+		public String getIndex() {
+			return index;
+		}
+
+		public String getType() {
+			return type;
+		}
+	}
+
+	private ExtRestClient dbClient;
+	private Intervall mode;
+
+	public DataObjectAcessorPm(HtDatabaseClient dbClient, Intervall mode, Entity entity, Class<T> clazz) throws ClassNotFoundException {
+		super(dbClient, entity, clazz, false);
+		this.dbClient = dbClient;
+		this.mode = mode;
+	}
+
+	/**
+	 * get aggregated list of ltps for filter NODE_KEY
+	 * @param input
+	 * @return
+	 * @throws IOException
+	 */
+	QueryResult<String> getDataLtpList(EntityInput input) throws IOException {
+		long page = QueryByFilter.getPage(input);
+		long pageSize = QueryByFilter.getPageSize(input);
+		Filter nodeFilter = QueryByFilter.getFilter(input.getFilter(), NODE_KEY);
+		if (nodeFilter != null) {
+			SearchRequest request = new SearchRequest(mode.getIndex(), mode.getType());
+			request.setQuery(QueryBuilders.matchQuery(NODE_KEY, nodeFilter.getFiltervalue()).aggregations(UUID_KEY).size(0));
+			try {
+				SearchResponse response = this.dbClient.search(request);
+				AggregationEntries aggs = response.getAggregations(UUID_KEY);
+				String[] uuids = aggs.getKeysAsPagedStringList(pageSize, pageSize * (page - 1));
+				long totalSize = aggs.size();
+				return new QueryResult<String>(page, pageSize, new SearchResult<String>(uuids, totalSize));
+			} catch (IOException e) {
+				throw new IOException("problem reading ltps for req="+request, e);
+			}
+		} else {
+			String msg = "no nodename in filter found ";
+			LOG.debug(msg);
+			throw new IllegalArgumentException(msg);
+		}
+	}
+	
+//	QueryResult<String> getDataDeviceList(EntityInput input) throws IOException {
+//
+//		long page = QueryByFilter.getPage(input);
+//		long pageSize = QueryByFilter.getPageSize(input);
+//
+//		SearchRequest request = new SearchRequest(mode.getIndex(), mode.getType());
+//		request.setQuery(QueryBuilders.matchAllQuery().aggregations(KEY).size(0));
+////		try {
+//			SearchResponse response = this.dbClient.search(request);
+//			AggregationEntries aggs = response.getAggregations(KEY);
+//			String[] uuids = aggs.getKeysAsPagedStringList(pageSize, pageSize * (page - 1));
+//			long totalSize = aggs.size();
+//			return new QueryResult<String>(page, pageSize, new SearchResult<String>(uuids, totalSize));
+////		} catch (IOException e) {
+////			throw new IOException("problem reading nodes for req="+request, e);
+////		}
+//	}
+	/**
+	 * get aggregated devices list
+	 * @param input filter should be empty/no filter handled, only sortorder for KEY ('node-name')
+	 * @return
+	 * @throws IOException
+	 */
+	QueryResult<String> getDataDeviceList(EntityInput input) throws IOException {
+
+		long page = QueryByFilter.getPage(input);
+		long pageSize = QueryByFilter.getPageSize(input);
+
+		Sortorder soNode = QueryByFilter.getSortOrder(input.getSortorder(), KEY);
+		SearchRequest request = new SearchRequest(mode.getIndex(), mode.getType());
+		QueryBuilder query = null;
+		if (soNode != null) {
+			query = QueryBuilders.matchAllQuery()
+					.aggregations(KEY,
+							soNode.getSortorder() == SortOrder.Ascending
+									? org.onap.ccsdk.features.sdnr.wt.common.database.queries.SortOrder.ASCENDING
+									: org.onap.ccsdk.features.sdnr.wt.common.database.queries.SortOrder.DESCENDING)
+					.size(0);
+		} else {
+			query = QueryBuilders.matchAllQuery().aggregations(KEY).size(0);
+		}
+		request.setQuery(query);
+		try {
+			SearchResponse response = this.dbClient.search(request);
+			AggregationEntries aggs = response.getAggregations(KEY);
+			String[] uuids = aggs.getKeysAsPagedStringList(pageSize, pageSize * (page - 1));
+			long totalSize = aggs.size();
+			return new QueryResult<String>(page, pageSize, new SearchResult<String>(uuids, totalSize));
+		} catch (IOException e) {
+			throw new IOException("problem reading nodes for req=" + request, e);
+		}
+
+	}
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/DataObjectAcessorStatus.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/DataObjectAcessorStatus.java
new file mode 100644
index 0000000..5970d54
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/DataObjectAcessorStatus.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.io.IOException;
+
+import org.onap.ccsdk.features.sdnr.wt.common.database.ExtRestClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.SearchRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.AggregationEntries;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.SearchResponse;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.status.output.Data;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.status.output.DataBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.status.entity.FaultsBuilder;
+
+public class DataObjectAcessorStatus extends DataObjectAcessor<Data> {
+
+	final String ESDATATYPE_FAULTCURRENT_SEVERITY_KEY = "severity";
+
+	private final ExtRestClient dbClient;
+	private final Entity entity;
+
+	public DataObjectAcessorStatus(HtDatabaseClient dbClient, Entity entity)
+			throws ClassNotFoundException {
+		super(dbClient, entity, Data.class, false);
+		this.dbClient = dbClient;
+		this.entity = entity;
+	}
+
+	QueryResult<Data> getDataStatus() throws IOException {
+	SearchRequest request = getNewInstanceOfSearchRequest(entity);
+	request.setQuery(
+			QueryBuilders.matchAllQuery().aggregations(ESDATATYPE_FAULTCURRENT_SEVERITY_KEY).size(0));
+		SearchResponse response = this.dbClient.search(request);
+		AggregationEntries aggs = response.getAggregations(ESDATATYPE_FAULTCURRENT_SEVERITY_KEY);
+
+		Data[] data = { new DataBuilder().setFaults(new FaultsBuilder().
+						setCriticals(aggs.getOrDefault("Critical",0L)).
+						setMajors(aggs.getOrDefault("Major", 0L)).
+						setMinors(aggs.getOrDefault("Minor", 0L)).
+						setWarnings(aggs.getOrDefault("Warning", 0L)).
+						build()).build() };
+		long toalsize = data.length;
+		return new QueryResult<Data>(1L, 1L, new SearchResult<Data>(data, toalsize));
+
+	}
+
+
+    private static SearchRequest getNewInstanceOfSearchRequest(Entity entity) {
+    	return new SearchRequest(entity.getName(), entity.getName());
+    }
+
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java
new file mode 100644
index 0000000..4878d89
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java
@@ -0,0 +1,445 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.DataObjectAcessorPm.Intervall;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MediatorServerEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadStatusOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionOutputBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implements IEntityDataProvider*/ {
+
+    private static final Logger LOG = LoggerFactory.getLogger(ElasticSearchDataProvider.class);
+
+	private static final String EXCEPTION_UNABLE_TO_WRITE_IN_DATABASE = "unable to write data to database";
+	private static final String EXCEPTION_UNABLE_TO_UPDATE_IN_DATABASE = "unable to update data in database";
+	private static final String EXCEPTION_UNABLE_TO_REMOVE_FROM_DATABASE = "unable to remove data from database";
+
+    private final HtDatabaseClient dbClient;
+    private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data> eventRWFaultCurrent;
+    private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data> eventRWFaultLog;
+    private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data> mediatorserverRW;
+    private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data> maintenanceRW;
+    private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data> equipmentRW;
+    private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.Data> connnectionlogRW;
+    private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data> eventlogRW;
+    private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data> networkelementConnectionRW;
+    private final DataObjectAcessorPm<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> pm15mRW;
+    private final DataObjectAcessorPm<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data> pm24hRW;
+
+    private final DataObjectAcessorStatus readStatus;
+    private final HtDatabaseEventsService databaseService;
+    private final HtDatabaseMaintenanceService databaseMaintenanceService;
+    public ElasticSearchDataProvider(HostInfo[] hosts) throws Exception {
+    	this(hosts,null,null);
+    }
+    public ElasticSearchDataProvider(HostInfo[] hosts,String authUsername,String authPassword) throws Exception {
+         super();
+         LOG.info("Start {}", this.getClass().getName());
+
+         this.dbClient = new HtDatabaseClient(hosts,authUsername,authPassword);
+         this.mediatorserverRW = new DataObjectAcessor<>(dbClient, Entity.MediatorServer,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data.class);
+             this.mediatorserverRW.setWriteInterface(MediatorServerEntity.class);
+
+         this.maintenanceRW = new DataObjectAcessor<>(dbClient, Entity.Maintenancemode,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data.class);
+         this.maintenanceRW.setWriteInterface(MaintenanceEntity.class);
+
+         this.equipmentRW = new DataObjectAcessor<>(dbClient, Entity.Inventoryequipment,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data.class);
+
+         this.eventRWFaultCurrent = new DataObjectAcessor<>(dbClient, Entity.Faultcurrent,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data.class);
+
+         this.eventRWFaultLog = new DataObjectAcessor<>(dbClient, Entity.Faultlog,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data.class);
+
+         this.connnectionlogRW = new DataObjectAcessor<>(dbClient, Entity.Connectionlog,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.Data.class);
+
+         this.eventlogRW = new DataObjectAcessor<>(dbClient, Entity.Eventlog,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data.class);
+
+         this.networkelementConnectionRW = new DataObjectAcessor<>(dbClient, Entity.NetworkelementConnection,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data.class);
+         this.networkelementConnectionRW.setWriteInterface(NetworkElementConnectionEntity.class);
+
+         this.pm15mRW = new DataObjectAcessorPm<>(dbClient, Intervall.PMDATA15M, Entity.Historicalperformance15min,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data.class);
+
+         this.pm24hRW = new DataObjectAcessorPm<>(dbClient, Intervall.PMDATA24H, Entity.Historicalperformance24h,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data.class);
+
+         this.readStatus = new DataObjectAcessorStatus(dbClient, Entity.Faultcurrent );
+
+         this.databaseService = new HtDatabaseEventsService(dbClient, this);
+         this.databaseMaintenanceService = new HtDatabaseMaintenanceService(dbClient);
+    }
+
+    /*-------------------------
+     * Provide access to model API
+     */
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.PaginationBuilder
+    //eventRWFaultCurrent
+    public ReadFaultcurrentListOutputBuilder readFaultCurrentList(EntityInput input) {
+
+        ReadFaultcurrentListOutputBuilder outputBuilder = new ReadFaultcurrentListOutputBuilder();
+
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data> result = this.eventRWFaultCurrent
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.PaginationBuilder
+    //eventRWFaultLog
+    public ReadFaultlogListOutputBuilder readFaultLogList(EntityInput input) {
+        ReadFaultlogListOutputBuilder outputBuilder = new ReadFaultlogListOutputBuilder();
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data> result = this.eventRWFaultLog
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.PaginationBuilder
+    //maintenanceRW
+    public ReadMaintenanceListOutputBuilder readMaintenanceList(EntityInput input) {
+        ReadMaintenanceListOutputBuilder outputBuilder = new ReadMaintenanceListOutputBuilder();
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data> result = this.maintenanceRW
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Pagination
+    //mediatorserverRW
+    public ReadMediatorServerListOutputBuilder readMediatorServerList(EntityInput input) {
+
+        ReadMediatorServerListOutputBuilder outputBuilder = new ReadMediatorServerListOutputBuilder();
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data> result = this.mediatorserverRW
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.PaginationBuilder
+    //networkelementConnectionRW
+    public ReadNetworkElementConnectionListOutputBuilder readNetworkElementConnectionList(
+            EntityInput input) {
+        ReadNetworkElementConnectionListOutputBuilder outputBuilder = new ReadNetworkElementConnectionListOutputBuilder();
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data> result = this.networkelementConnectionRW
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.PaginationBuilder
+    //equipmentRW
+    public ReadInventoryListOutputBuilder readInventoryList(EntityInput input) {
+        ReadInventoryListOutputBuilder outputBuilder = new ReadInventoryListOutputBuilder();
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data> result = this.equipmentRW
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.PaginationBuilder
+    //connnectionlogRW
+    public ReadConnectionlogListOutputBuilder readConnectionlogList(EntityInput input) {
+        ReadConnectionlogListOutputBuilder outputBuilder = new ReadConnectionlogListOutputBuilder();
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.Data> result = this.connnectionlogRW
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.PaginationBuilder
+    //eventlogRW
+    public ReadEventlogListOutputBuilder readEventlogList(ReadEventlogListInput input) throws IOException {
+        ReadEventlogListOutputBuilder outputBuilder = new ReadEventlogListOutputBuilder();
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data> result = this.eventlogRW
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.PaginationBuilder
+    public ReadPmdata15mListOutputBuilder readPmdata15mList(EntityInput input) {
+        ReadPmdata15mListOutputBuilder outputBuilder = new ReadPmdata15mListOutputBuilder();
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> result = this.pm15mRW
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data
+    //org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Pagination
+    public ReadPmdata24hListOutputBuilder readPmdata24hList(EntityInput input) {
+        ReadPmdata24hListOutputBuilder outputBuilder = new ReadPmdata24hListOutputBuilder();
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data> result = this.pm24hRW
+                .getData(input);
+        outputBuilder.setData(result.getResult().getHits());
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        return outputBuilder;
+    }
+
+    public ReadPmdata15mLtpListOutputBuilder readPmdata15mLtpList(EntityInput input) throws IOException {
+        ReadPmdata15mLtpListOutputBuilder outputBuilder = new ReadPmdata15mLtpListOutputBuilder();
+        QueryResult<String> result = pm15mRW.getDataLtpList(input);
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.ltp.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        outputBuilder.setData(result.getResult().getHits());
+        return outputBuilder;
+    }
+
+    public ReadPmdata15mDeviceListOutputBuilder readPmdata15mDeviceList(EntityInput input) throws IOException {
+        ReadPmdata15mDeviceListOutputBuilder outputBuilder = new ReadPmdata15mDeviceListOutputBuilder();
+        QueryResult<String> result = pm15mRW.getDataDeviceList(input);
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.device.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        outputBuilder.setData(result.getResult().getHits());
+        return outputBuilder;
+    }
+
+    public ReadPmdata24hLtpListOutputBuilder readPmdata24hLtpList(EntityInput input) throws IOException {
+
+        QueryResult<String> result = pm24hRW.getDataLtpList(input);
+
+        ReadPmdata24hLtpListOutputBuilder outputBuilder = new ReadPmdata24hLtpListOutputBuilder();
+        new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.ltp.list.output.PaginationBuilder();
+        outputBuilder.setPagination(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.ltp.list.output.PaginationBuilder(
+                result.getPagination()).build());
+        outputBuilder.setData(result.getResult().getHits());
+        return outputBuilder;
+    }
+
+    public ReadPmdata24hDeviceListOutputBuilder readPmdata24hDeviceList(EntityInput input)
+            throws IOException {
+
+        QueryResult<String> result = pm24hRW.getDataDeviceList(input);
+
+        ReadPmdata24hDeviceListOutputBuilder outputBuilder = new ReadPmdata24hDeviceListOutputBuilder();
+        outputBuilder.setPagination(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.device.list.output.PaginationBuilder(
+                        result.getPagination()).build());
+        outputBuilder.setData(result.getResult().getHits());
+        return outputBuilder;
+    }
+
+    public ReadStatusOutputBuilder readStatus() throws IOException {
+        QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.status.output.Data> result = readStatus.getDataStatus();
+
+        ReadStatusOutputBuilder outputBuilder = new ReadStatusOutputBuilder();
+        outputBuilder.setData(result.getResult().getHits());
+        return outputBuilder;
+    }
+
+    public boolean waitForYellowDatabaseStatus(long timeout, TimeUnit unit) {
+        return this.dbClient.waitForYellowStatus(unit.toMillis(timeout));
+    }
+
+     public CreateNetworkElementConnectionOutputBuilder createNetworkElementConnection(
+            NetworkElementConnectionEntity input) throws IOException {
+        String id = this.networkelementConnectionRW.update(input, input.getNodeId());
+        if (id == null) {
+            throw new IOException(EXCEPTION_UNABLE_TO_WRITE_IN_DATABASE);
+        }
+        CreateNetworkElementConnectionOutputBuilder builder = new CreateNetworkElementConnectionOutputBuilder();
+        builder.setId(id).setNodeId(input.getNodeId()).setHost(input.getHost()).setPort(input.getPort())
+                .setUsername(input.getUsername()).setPassword(input.getPassword()).setIsRequired(input.isIsRequired())
+                .setCoreModelCapability(input.getCoreModelCapability()).setDeviceType(input.getDeviceType());
+        return builder;
+    }
+
+    public UpdateNetworkElementConnectionOutputBuilder updateNetworkElementConnection(
+            UpdateNetworkElementConnectionInput input) throws IOException {
+        String id = this.networkelementConnectionRW.update(input, input.getId());
+        if (id == null) {
+            throw new IOException(EXCEPTION_UNABLE_TO_UPDATE_IN_DATABASE);
+        }
+        UpdateNetworkElementConnectionOutputBuilder builder = new UpdateNetworkElementConnectionOutputBuilder();
+        builder.setId(id).setNodeId(input.getNodeId()).setHost(input.getHost()).setPort(input.getPort())
+                .setUsername(input.getUsername()).setPassword(input.getPassword())
+                .setCoreModelCapability(input.getCoreModelCapability()).setDeviceType(input.getDeviceType());
+        return builder;
+    }
+
+    public DeleteNetworkElementConnectionOutputBuilder deleteNetworkElementConnection(DeleteNetworkElementConnectionInput input) throws IOException {
+        boolean removed = this.networkelementConnectionRW.remove(input.getId());
+        if (!removed) {
+            throw new IOException(EXCEPTION_UNABLE_TO_REMOVE_FROM_DATABASE);
+        }
+        return new DeleteNetworkElementConnectionOutputBuilder();
+    }
+
+    public DeleteMediatorServerOutputBuilder deleteMediatorServer(DeleteMediatorServerInput input) throws IOException {
+        boolean removed = this.mediatorserverRW.remove(input.getId());
+        if (!removed) {
+            throw new IOException(EXCEPTION_UNABLE_TO_REMOVE_FROM_DATABASE);
+        }
+        return new DeleteMediatorServerOutputBuilder();
+    }
+
+    public DeleteMaintenanceOutputBuilder deleteMaintenance(DeleteMaintenanceInput input) throws IOException {
+        boolean removed = this.maintenanceRW.remove(input.getId());
+        if (!removed) {
+            throw new IOException(EXCEPTION_UNABLE_TO_REMOVE_FROM_DATABASE);
+        }
+        return new DeleteMaintenanceOutputBuilder();
+    }
+
+    public UpdateMaintenanceOutputBuilder updateMaintenance(UpdateMaintenanceInput input) throws IOException {
+        if (input.getId() == null) {
+            throw new IOException("please give the id for updating entry");
+        }
+        String id = this.maintenanceRW.update(input, input.getId());
+        if (id == null) {
+            throw new IOException(EXCEPTION_UNABLE_TO_UPDATE_IN_DATABASE);
+        }
+        UpdateMaintenanceOutputBuilder builder = new UpdateMaintenanceOutputBuilder(input).setId(id);
+        return builder;
+    }
+
+    public UpdateMediatorServerOutputBuilder updateMediatorServer(UpdateMediatorServerInput input) throws IOException {
+        if (input.getId() == null) {
+            throw new IOException("please give the id for updating entry");
+        }
+        String id = this.mediatorserverRW.update(input, input.getId());
+        if (id == null) {
+            throw new IOException(EXCEPTION_UNABLE_TO_UPDATE_IN_DATABASE);
+        }
+        UpdateMediatorServerOutputBuilder builder = new UpdateMediatorServerOutputBuilder();
+        builder.setId(id).setName(input.getName()).setUrl(input.getUrl());
+        return builder;
+    }
+
+    public CreateMaintenanceOutputBuilder createMaintenance(CreateMaintenanceInput input) throws IOException {
+        String id = this.maintenanceRW.write(input, input.getNodeId());
+        if (id == null) {
+            throw new IOException(EXCEPTION_UNABLE_TO_WRITE_IN_DATABASE);
+        }
+        CreateMaintenanceOutputBuilder builder = new CreateMaintenanceOutputBuilder(input).setId(id);
+        return builder;
+    }
+
+     public CreateMediatorServerOutputBuilder createMediatorServer(CreateMediatorServerInput input) throws IOException {
+        String id = this.mediatorserverRW.write(input, null);
+
+        if (id == null) {
+            throw new IOException(EXCEPTION_UNABLE_TO_WRITE_IN_DATABASE);
+        }
+        CreateMediatorServerOutputBuilder builder = new CreateMediatorServerOutputBuilder();
+        builder.setId(id).setName(input.getName()).setUrl(input.getUrl());
+        return builder;
+    }
+
+    public DataProvider getDataProvider() {
+        return this.databaseService;
+    }
+
+    public HtDatabaseMaintenance getHtDatabaseMaintenance() {
+        return this.databaseMaintenanceService;
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/FaultEntityManager.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/FaultEntityManager.java
new file mode 100644
index 0000000..f26a30d
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/FaultEntityManager.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.annotation.Nonnull;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Fault;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType;
+
+public class FaultEntityManager {
+
+    private static final Pattern pattern = Pattern.compile(".*\\[layerProtocol=(.*)\\]");
+
+    /**
+     * The leading indication for notification or events that are not in the
+     * currentProblem data of the ONF Coremodel
+     */
+    private static final String NOCURRENTPROBLEMINDICATION = "#";
+
+    /**
+     * Specific problems are not moving into current problem list
+     * @param problemName to be verified
+     * @return true if problem is current
+     */
+    public static boolean isManagedAsCurrentProblem(String problemName) {
+        return ! problemName.startsWith(NOCURRENTPROBLEMINDICATION);
+    }
+
+    public static boolean isManagedAsCurrentProblem(Fault problem) {
+        return isManagedAsCurrentProblem(problem.getProblem());
+    }
+
+    /**
+     * Specific problems are not moving into current problem list
+     * @param fault to be verified
+     * @return true if cleared indication
+     */
+    public static boolean isNoAlarmIndication(@Nonnull Fault fault) {
+        return SeverityType.NonAlarmed.equals(fault.getSeverity());
+    }
+
+    /**
+     * Create a specific ES id for the current log.
+     * @return a string with the generated ES Id
+     */
+     public static String genSpecificEsId(String nodeName, String objectId, String problemName) {
+
+        String uuId;
+
+        Matcher matcher = pattern.matcher(objectId);
+        if (matcher.matches() && matcher.groupCount() == 1) {
+            uuId = matcher.group(1);
+        } else {
+            uuId = objectId;
+        }
+
+        StringBuffer strBuf = new StringBuffer();
+        strBuf.append(nodeName);
+        strBuf.append("/");
+        strBuf.append(uuId);
+        strBuf.append("/");
+        strBuf.append(problemName);
+        return strBuf.toString();
+    }
+
+    /**
+     * Create Es id
+     * @param fault used to create uuid for faultcurrent
+     * @return String with Id
+     */
+    public static String genSpecificEsId(FaultcurrentEntity fault) {
+        return genSpecificEsId(fault.getNodeId(), fault.getObjectId(), fault.getProblem());
+    }
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/HtDatabaseEventsService.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/HtDatabaseEventsService.java
new file mode 100644
index 0000000..63d92b6
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/HtDatabaseEventsService.java
@@ -0,0 +1,442 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.BoolQueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.RangeQueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.EsDataObjectReaderWriter2;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.ArchiveCleanProvider;
+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.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionLogStatus;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.GranularityPeriodType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.InventoryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.InventoryEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntityBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInputBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Event service, writing all events into the database into the appropriate
+ * index.
+ *
+ * @author herbert
+ */
+public class HtDatabaseEventsService implements ArchiveCleanProvider, DataProvider {
+    private static final Logger LOG = LoggerFactory.getLogger(HtDatabaseEventsService.class);
+
+    private static final NetconfTimeStamp NETCONFTIME_CONVERTER = NetconfTimeStampImpl.getConverter();
+
+    private HtDatabaseClient client;
+    private EsDataObjectReaderWriter2<EventlogEntity> eventRWEventLogDevicemanager;
+    private EsDataObjectReaderWriter2<InventoryEntity> eventRWEquipment;
+    private EsDataObjectReaderWriter2<FaultcurrentEntity> eventRWFaultCurrentDB;
+    private EsDataObjectReaderWriter2<FaultlogEntity> eventRWFaultLogDB;
+    private EsDataObjectReaderWriter2<ConnectionlogEntity> eventRWConnectionLogDB;
+    private final EsDataObjectReaderWriter2<NetworkElementConnectionEntity> networkelementConnectionDB;
+    private final EsDataObjectReaderWriter2<PmdataEntity> pmData15mDB;
+    private final EsDataObjectReaderWriter2<PmdataEntity> pmData24hDB;
+
+    @SuppressWarnings("unused")
+    private final ElasticSearchDataProvider dataProvider;
+    // --- Construct and initialize
+
+
+    public HtDatabaseEventsService(HtDatabaseClient client, ElasticSearchDataProvider elasticSearchDataProvider) throws Exception {
+
+        LOG.info("Create {} start", HtDatabaseEventsService.class);
+        this.dataProvider = elasticSearchDataProvider;
+
+        try {
+            // Create control structure
+            this.client = client;
+
+            eventRWEventLogDevicemanager = new EsDataObjectReaderWriter2<>(client, Entity.Eventlog,
+                    EventlogEntity.class, EventlogBuilder.class);
+
+            eventRWEquipment = new EsDataObjectReaderWriter2<>(client, Entity.Inventoryequipment,
+                    InventoryEntity.class, InventoryBuilder.class);
+
+            eventRWFaultCurrentDB = new EsDataObjectReaderWriter2<>(client, Entity.Faultcurrent,
+                    FaultcurrentEntity.class, FaultcurrentBuilder.class);
+
+            eventRWFaultLogDB = new EsDataObjectReaderWriter2<>(client, Entity.Faultlog,
+                    FaultlogEntity.class, FaultlogBuilder.class);
+
+            eventRWConnectionLogDB = new EsDataObjectReaderWriter2<>(client, Entity.Connectionlog,
+                    ConnectionlogEntity.class, ConnectionlogBuilder.class);
+
+            networkelementConnectionDB = new EsDataObjectReaderWriter2<>(client, Entity.NetworkelementConnection,
+                    NetworkElementConnectionEntity.class, NetworkElementConnectionBuilder.class)
+                    .setEsIdAttributeName("_id");
+
+            pmData15mDB = new EsDataObjectReaderWriter2<>(client, Entity.Historicalperformance15min,
+                    PmdataEntity.class, PmdataEntityBuilder.class);
+
+            pmData24hDB = new EsDataObjectReaderWriter2<>(client, Entity.Historicalperformance24h,
+                    PmdataEntity.class, PmdataEntityBuilder.class);
+
+        } catch (Exception e) {
+            LOG.error("Can not start database client. Exception: {}", e);
+            throw new Exception("Can not start database client. Exception: {}", e);
+        }
+        LOG.info("Create {} finished. DB Service {} started.", HtDatabaseEventsService.class,
+                client != null ? "sucessfully" : "not");
+    }
+
+    // --- Function
+
+    // -- Connection log
+    @Override
+    public void writeConnectionLog(ConnectionlogEntity event) {
+        if (assertIfClientNull(event)) {
+            return;
+        }
+        LOG.debug("Write event: {}", event);
+        eventRWConnectionLogDB.write(event, null);
+
+    }
+    // -- Event log
+    @Override
+    public void writeEventLog(EventlogEntity event) {
+        if (assertIfClientNull("No client to write {}", event)) {
+            return;
+        }
+
+        LOG.debug("Write event: {}", event.toString());
+        eventRWEventLogDevicemanager.write(event, null);
+    }
+
+
+    // -- Fault log
+
+    @Override
+    public void writeFaultLog(FaultlogEntity fault) {
+        if (assertIfClientNull(fault)) {
+            return;
+        }
+
+        LOG.debug("Write fault to faultlog: {}", fault.toString());
+        eventRWFaultLogDB.write(fault,null);
+    }
+
+    // -- Fault current
+
+    @Override
+    public void updateFaultCurrent(FaultcurrentEntity fault) {
+        if (assertIfClientNull(fault)) {
+            return;
+        }
+
+        if (FaultEntityManager.isManagedAsCurrentProblem(fault)) {
+            if (FaultEntityManager.isNoAlarmIndication(fault)) {
+                LOG.debug("Remove from currentFaults: {}", fault.toString());
+                eventRWFaultCurrentDB.remove(FaultEntityManager.genSpecificEsId(fault));
+            } else {
+                LOG.debug("Write to currentFaults: {}", fault.toString());
+                eventRWFaultCurrentDB.write(fault, FaultEntityManager.genSpecificEsId(fault));
+            }
+        } else {
+            LOG.debug("Ingnore for currentFaults: {}", fault.toString());
+        }
+    }
+
+    /**
+     * Remove all entries for one node
+     *
+     * @param nodeName contains the mountpointname
+     * @return number of deleted entries
+     */
+    @Override
+    public int clearFaultsCurrentOfNode(String nodeName) {
+        if (assertIfClientNullForNodeName(nodeName)) {
+            return -1;
+        }
+
+        LOG.debug("Remove from currentFaults all faults for node: {}", nodeName);
+        return eventRWFaultCurrentDB.remove(EsFaultCurrent.getQueryForOneNode(nodeName));
+    }
+
+    /**
+     * Remove all entries for one node
+     *
+     * @param nodeName contains the mountpointname
+     * @param objectId of element to be deleted
+     * @return number of deleted entries
+     */
+    @Override
+    public int clearFaultsCurrentOfNodeWithObjectId(String nodeName, String objectId) {
+        if (assertIfClientNullForNodeName(nodeName)) {
+            return -1;
+        }
+
+        LOG.debug("Remove from currentFaults all faults for node/objectId: {}/{}", nodeName, objectId);
+        return eventRWFaultCurrentDB.remove(EsFaultCurrent.getQueryForOneNodeAndObjectId(nodeName, objectId));
+    }
+
+    /**
+     * Deliver list with all mountpoint/node-names in the database.
+     *
+     * @return List of all mountpoint/node-names the had active alarms.
+     */
+    @Override
+    public @Nonnull List<String> getAllNodesWithCurrentAlarms() {
+        if (assertIfClientNull("No DB, can not delete for all nodes", null)) {
+            return new ArrayList<>();
+        }
+
+        LOG.debug("Remove from currentFaults faults for all node");
+        List<String> nodeNames = new ArrayList<>();
+
+        for (FaultcurrentEntity fault : eventRWFaultCurrentDB.doReadAll().getHits()) {
+            String nodeName = fault.getNodeId();
+            if (!nodeNames.contains(nodeName)) {
+                // this.clearFaultsCurrentOfNode(nodeName); -> Function shifted
+                nodeNames.add(nodeName);
+            }
+        }
+        return nodeNames;
+    }
+
+    // -- Inventory and equipment current
+
+    /**
+     * write internal equipment to database
+     * @param internalEquipment with mandatory fields.
+     */
+    @Override
+    public void writeInventory(Inventory internalEquipment) {
+
+        if (assertIfClientNullForNodeName(internalEquipment.getNodeId())) {
+            return;
+        }
+        eventRWEquipment.write(internalEquipment, internalEquipment.getNodeId()+"/"+internalEquipment.getUuid());
+    }
+
+
+    // -- Networkelement
+
+    /**
+     *
+     * @param networkElementConnectionEntitiy to wirte to DB
+     * @param nodeId Id for this DB element
+     */
+    @Override
+    public void updateNetworkConnectionDeviceType(NetworkElementConnectionEntity networkElementConnectionEntitiy, String nodeId) {
+        this.networkelementConnectionDB.update(networkElementConnectionEntitiy, nodeId);
+    }
+
+    /**
+     * Update after new mountpoint registration
+     * @param networkElementConnectionEntitiy data
+     * @param nodeId of device (mountpoint name)
+     */
+    @Override
+    public void updateNetworkConnection22(NetworkElementConnectionEntity networkElementConnectionEntitiy, String nodeId) {
+        this.networkelementConnectionDB.updateOrCreate(networkElementConnectionEntitiy, nodeId, Arrays.asList("is-required", "username", "password"));
+    }
+
+    /* please do not remove */
+    //    public void cleanNetworkElementConnections() {
+    //        this.networkelementConnectionDB.remove(QueryBuilders.matchQuery("is-required", false));
+    //        CreateNetworkElementConnectionInput x = new CreateNetworkElementConnectionInputBuilder().setStatus(ConnectionLogStatus.Disconnected).build();
+    //        this.networkelementConnectionDB.update(x,QueryBuilders.matchAllQuery());
+    //    }
+
+    @Override
+    public void removeNetworkConnection(String nodeId) {
+        Boolean isRequired;
+        NetworkElementConnectionEntity e = this.networkelementConnectionDB.read(nodeId);
+        if (e != null && (isRequired = e.isIsRequired()) != null) {
+            if (isRequired) {
+                LOG.debug("updating connection status for {} of required ne to disconnected",nodeId);
+                this.networkelementConnectionDB.update(new UpdateNetworkElementConnectionInputBuilder().setStatus(ConnectionLogStatus.Disconnected).build(), nodeId);
+            } else {
+                LOG.debug("remove networkelement-connection for {} entry because of non-required",nodeId);
+                this.networkelementConnectionDB.remove(nodeId);
+            }
+        }
+        else {
+            LOG.warn("Unable to update connection-status. dbentry for {} not found in networkelement-connection",nodeId);
+        }
+    }
+
+    // -- Multiple areas
+
+    @Override
+    public int doIndexClean(Date olderAreOutdated) {
+
+        String netconfTimeStamp = NETCONFTIME_CONVERTER.getTimeStampAsNetconfString(olderAreOutdated);
+        int removed = 0;
+
+        QueryBuilder queryEventBase = EsEventBase.getQueryForTimeStamp(netconfTimeStamp);
+        removed += eventRWEventLogDevicemanager.remove(queryEventBase);
+
+        QueryBuilder queryFaultLog = EsFaultLogDevicemanager.getQueryForTimeStamp(netconfTimeStamp);
+        removed += eventRWFaultLogDB.remove(queryFaultLog);
+        return removed;
+    }
+
+    @Override
+    public int getNumberOfOldObjects(Date olderAreOutdated) {
+
+        String netconfTimeStamp = NETCONFTIME_CONVERTER.getTimeStampAsNetconfString(olderAreOutdated);
+        int numberOfElements = 0;
+
+        QueryBuilder queryEventBase = EsEventBase.getQueryForTimeStamp(netconfTimeStamp);
+        numberOfElements += eventRWEventLogDevicemanager.doReadAll(queryEventBase).getTotal();
+
+        QueryBuilder queryFaultLog = EsFaultLogDevicemanager.getQueryForTimeStamp(netconfTimeStamp);
+        numberOfElements += eventRWFaultLogDB.doReadAll(queryFaultLog).getTotal();
+
+        return numberOfElements;
+    }
+
+    // -- Helper
+
+    /**
+     * Verify status of client
+     * @param event that is printed with message
+     * @return true if client is null
+     */
+    private boolean assertIfClientNull(Object event) {
+        return assertIfClientNull("No DB, can not write: {}", event);
+    }
+
+    private boolean assertIfClientNullForNodeName(Object object) {
+        return assertIfClientNull("No DB, can not handle node: {}", object);
+    }
+    /**
+     * Verify status of client
+     * @param message to print including {} for object printout.
+     * @return true if client is null
+     */
+    private boolean assertIfClientNull(String message, Object object) {
+        if (client == null) {
+            LOG.debug(message, object);
+            return true;
+        }
+        return false;
+    }
+
+    // ### sub classes
+
+
+    private static class EsEventBase {
+        /**
+         * Query to get older Elements
+         * @param netconfTimeStamp to identify older Elements
+         * @return QueryBuilder for older elements related to timestamp
+         */
+        private static QueryBuilder getQueryForTimeStamp(String netconfTimeStamp) {
+            return new RangeQueryBuilder("event.timeStamp").lte(netconfTimeStamp);
+        }
+    }
+    private static class EsFaultLogDevicemanager {
+        /**
+         * Get older Elements
+         * @param netconfTimeStamp to identify query elements older than this timestamp.
+         * @return QueryBuilder for related elements
+         */
+        public static QueryBuilder getQueryForTimeStamp(String netconfTimeStamp) {
+            return new RangeQueryBuilder("timestamp").lte(netconfTimeStamp);
+        }
+     }
+    public static class EsFaultCurrent  {
+        /**
+         * @param nodeName name of the node
+         * @return query builder
+         */
+        public static QueryBuilder getQueryForOneNode( String nodeName) {
+            return QueryBuilders.matchQuery("node-id", nodeName);
+        }
+
+        public static QueryBuilder getQueryForOneNodeAndObjectId( String nodeName, String objectId) {
+            BoolQueryBuilder bq = QueryBuilders.boolQuery();
+            bq.must(QueryBuilders.matchQuery("node-id", nodeName));
+            bq.must(QueryBuilders.matchQuery("object-id", objectId));
+            return bq;
+        }
+    }
+    @Override
+    public List<NetworkElementConnectionEntity> getNetworkElementConnections() {
+        return this.networkelementConnectionDB.doReadAll().getHits();
+    }
+
+    @Override
+    public void doWritePerformanceData(List<PmdataEntity> list) {
+
+        list.forEach(elem -> {
+            GranularityPeriodType granularityPeriod = nnGetGranularityPeriodType(elem.getGranularityPeriod());
+            //_id": "Sim12600/LP-MWPS-TTP-01/2017-07-04T15:15:00.0+00:00"
+            StringBuffer id = new StringBuffer();
+            DateAndTime date = elem.getTimeStamp();
+            id.append(elem.getNodeName());
+            id.append("/");
+            id.append(elem.getUuidInterface());
+            id.append("/");
+            id.append(date != null ? date.getValue() : "null");
+
+            switch (granularityPeriod) {
+            case Period15Min:
+                pmData15mDB.write(elem, id.toString());
+                break;
+            case Period24Hours:
+                pmData24hDB.write(elem, id.toString());
+                break;
+            case Unknown:
+            default:
+                LOG.debug("Unknown granularity {} id {}", granularityPeriod, id);
+                break;
+            }
+        } );
+
+    }
+
+    @NonNull GranularityPeriodType nnGetGranularityPeriodType(@Nullable GranularityPeriodType granularityPeriod) {
+        return granularityPeriod != null ? granularityPeriod : GranularityPeriodType.Unknown;
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/HtDatabaseMaintenanceService.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/HtDatabaseMaintenanceService.java
new file mode 100644
index 0000000..45d989d
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/HtDatabaseMaintenanceService.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.onap.ccsdk.features.sdnr.wt.common.HtAssert;
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.EsDataObjectReaderWriter2;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HtDatabaseMaintenanceService implements HtDatabaseMaintenance {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HtDatabaseMaintenanceService.class);
+
+    private final EsDataObjectReaderWriter2<MaintenanceEntity> maintenanceRW;
+    private final EsDataObjectReaderWriter2<NetworkElementConnectionEntity> requiredNeRW;
+
+    HtDatabaseMaintenanceService(@NonNull HtDatabaseClient client) throws ClassNotFoundException {
+        HtAssert.nonnull(client);
+
+        // Create control structure
+        maintenanceRW = new EsDataObjectReaderWriter2<>(client, Entity.Maintenancemode, MaintenanceEntity.class,
+                MaintenanceBuilder.class).setEsIdAttributeName("_id");
+
+        requiredNeRW = new EsDataObjectReaderWriter2<>(client, Entity.NetworkelementConnection,
+                NetworkElementConnectionEntity.class, NetworkElementConnectionBuilder.class)
+                        .setEsIdAttributeName("_id");
+
+    }
+
+    /**
+     * Get existing object for mountpoint to manage maintenance mode
+     * @return Object with configuration
+     */
+    @Override
+    @Nullable
+    public MaintenanceEntity getMaintenance(@Nullable String mountpointId) {
+        MaintenanceEntity deviceMaintenanceMode = null;
+        if (maintenanceRW != null && mountpointId != null) {
+            deviceMaintenanceMode = maintenanceRW.read(mountpointId);
+        }
+        return deviceMaintenanceMode;
+    }
+
+    @Override
+    public
+    MaintenanceEntity setMaintenance(MaintenanceEntity m) {
+        if (maintenanceRW != null) {
+           if (maintenanceRW.write(m, m.getNodeId() ) == null) {
+                throw new IllegalArgumentException("Problem writing to database: "+m.getId());
+            }
+           LOG.info("Wrote maintenance object {}", m.toString());
+        }
+        return m;
+    }
+
+    @Override
+    public
+    List<MaintenanceEntity> getAll() {
+        return maintenanceRW != null ? maintenanceRW.doReadAll().getHits() : new ArrayList<>();
+    }
+
+    @Override
+    public
+    MaintenanceEntity createIfNotExists(String mountpointId) {
+        MaintenanceEntity deviceMaintenanceMode = null;
+        if (maintenanceRW != null) {
+            deviceMaintenanceMode = maintenanceRW.read(mountpointId);
+            if (deviceMaintenanceMode == null) {
+                LOG.debug("creating empty maintenance object in database");
+                deviceMaintenanceMode = getDefaultMaintenance(mountpointId);
+                maintenanceRW.write(deviceMaintenanceMode, mountpointId);
+            } else {
+                LOG.debug("maintenance object already exists in database");
+            }
+        } else {
+            LOG.warn("cannot create maintenance obj. db reader/writer is null");
+        }
+        return deviceMaintenanceMode;
+    }
+
+    @Override
+    public
+    void deleteIfNotRequired(String mountPointNodeName) {
+
+        if (!this.isRequireNe(mountPointNodeName)) {
+            if (maintenanceRW != null) {
+                LOG.debug("removing maintenance object in database for " + mountPointNodeName);
+                maintenanceRW.remove(mountPointNodeName);
+            } else {
+                LOG.warn("cannot create maintenance obj. db reader/writer is null");
+            }
+        }
+
+    }
+
+    /**
+     * Provide default maintenanceinformation for a device
+     * @param mountpointId nodeId of device
+     * @return default data
+     */
+    static private MaintenanceEntity getDefaultMaintenance(String mountpointId) {
+
+        DateAndTime now = NetconfTimeStampImpl.getConverter().getTimeStamp();
+
+        MaintenanceBuilder deviceMaintenanceModeBuilder = new MaintenanceBuilder();
+        deviceMaintenanceModeBuilder.setNodeId(mountpointId).setId(mountpointId);
+        // Use time from mountpoint creation
+        deviceMaintenanceModeBuilder.setDescription("");
+        // Use time from mountpoint creation
+        deviceMaintenanceModeBuilder.setStart(now);
+        deviceMaintenanceModeBuilder.setEnd(now);
+        // Reference to all
+        deviceMaintenanceModeBuilder.setObjectIdRef("");
+        deviceMaintenanceModeBuilder.setProblem("");
+        deviceMaintenanceModeBuilder.setActive(false);
+
+        return deviceMaintenanceModeBuilder.build();
+   }
+
+    // -- Private
+    /**
+     * Check in required ne if entry exists for mountpointNodeName
+     *
+     * @param mountPointNodeName
+     * @return
+     */
+    private boolean isRequireNe(String mountPointNodeName) {
+        NetworkElementConnectionEntity ne = null;
+        if (requiredNeRW != null) {
+            LOG.debug("searching for entry in required-networkelement for " + mountPointNodeName);
+            ne = requiredNeRW.read(mountPointNodeName);
+        } else {
+            LOG.warn("cannot read db. no db reader writer initialized");
+        }
+        return ne != null;
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/MediatorServerDataProvider.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/MediatorServerDataProvider.java
new file mode 100644
index 0000000..bc61e81
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/MediatorServerDataProvider.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MediatorServerDataProvider implements AutoCloseable {
+
+	private static final Logger LOG = LoggerFactory.getLogger(MediatorServerDataProvider.class);
+
+	private final HtDatabaseClient dbClient;
+	private final DataObjectAcessor<Data> mediatorserverRW;
+	private final int REFRESH_INTERVAL = 60;
+	private final Map<String, Data> entries;
+	private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
+	private boolean isRunning;
+
+	public MediatorServerDataProvider(HostInfo[] hosts) throws Exception {
+		this(hosts, null, null);
+	}
+
+	public MediatorServerDataProvider(HostInfo[] hosts, String authUsername, String authPassword) throws Exception {
+		super();
+		LOG.info("Start {}", this.getClass().getName());
+		this.entries = new HashMap<>();
+		this.dbClient = new HtDatabaseClient(hosts, authUsername, authPassword);
+		this.mediatorserverRW = new DataObjectAcessor<>(dbClient, Entity.MediatorServer, Data.class);
+		this.scheduler.scheduleAtFixedRate(onTick, this.REFRESH_INTERVAL, this.REFRESH_INTERVAL, TimeUnit.SECONDS);
+	}
+
+	private final Runnable onTick = new Runnable() {
+
+		@Override
+		public void run() {
+			isRunning = true;
+			SearchResult<Data> result = MediatorServerDataProvider.this.mediatorserverRW.doReadAll();
+			List<Data> data = result.getHits();
+			for (Data item : data) {
+				MediatorServerDataProvider.this.entries.put(item.getId(), item);
+			}
+			isRunning = false;
+		}
+
+	};
+
+	public String getHostUrl(String dbServerId) {
+		Data info = this.entries.getOrDefault(dbServerId, null);
+		return info == null ? null : info.getUrl();
+	}
+
+	public boolean triggerReloadSync() {
+		new Thread(onTick).start();
+		int i = 20;
+		while (isRunning && i-- > 0) {
+			try {
+				Thread.sleep(500);
+			} catch (InterruptedException e) {
+				Thread.currentThread().interrupt();
+			}
+		}
+		return i > 0;
+	}
+
+	@Override
+	public void close() throws Exception {
+		this.scheduler.shutdown();
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ODLVersionLUT.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ODLVersionLUT.java
new file mode 100644
index 0000000..adf5d3b
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ODLVersionLUT.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+public class ODLVersionLUT {
+
+	public static String getONAPReleaseName(String onapCCSDKVersion,String def) {
+		if(onapCCSDKVersion==null) {
+			return def;
+		}
+		if(onapCCSDKVersion.startsWith("1.6.")) {
+			return "ONAP Guillin";
+		}
+		if(onapCCSDKVersion.startsWith("1.5.")) {
+			return "ONAP Frankfurt";
+		}
+		if(onapCCSDKVersion.startsWith("1.4.")) {
+			return "ONAP El Alto";
+		}
+		if(onapCCSDKVersion.startsWith("1.3.")) {
+			return "ONAP El Alto";
+		}
+		return def;
+	}
+	public static String getOdlVersion(String onapCCSDKVersion,String def) {
+		
+		if(onapCCSDKVersion==null) {
+			return def;
+		}
+		if(onapCCSDKVersion.startsWith("1.6.")) {
+			return "sodium-SRX (0.11.X)";
+		}
+		if(onapCCSDKVersion.startsWith("1.5.")) {
+			return "neon-SR1 (0.10.1)";
+		}
+		if(onapCCSDKVersion.startsWith("1.4.")) {
+			return "neon-SR1 (0.10.1)";
+		}
+		if(onapCCSDKVersion.startsWith("1.3.")) {
+			return "fluorine-SR2 (0.9.2)";
+		}
+		return def;
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/QueryByFilter.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/QueryByFilter.java
new file mode 100644
index 0000000..db52795
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/QueryByFilter.java
@@ -0,0 +1,343 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.TimeZone;
+
+import org.eclipse.jdt.annotation.Nullable;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.DbFilter;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.BoolQueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.RangeQueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SortOrder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Sortorder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class QueryByFilter {
+
+     private static final Logger LOG = LoggerFactory.getLogger(DataObjectAcessorPm.class);
+
+     private QueryByFilter() {
+         //Hide
+     }
+
+    static long getPage(EntityInput input) {
+        return getPage(input, 1);
+    }
+
+    @SuppressWarnings("null")
+    private static long getPage(EntityInput input, long defaultValue) {
+        return input.getPagination() != null ? input.getPagination().getPage().longValue() : defaultValue;
+    }
+
+    static long getPageSize(EntityInput input) {
+        return getPageSize(input, 1);
+    }
+
+    @SuppressWarnings("null")
+    private static long getPageSize(EntityInput input, long defaultValue) {
+        return input.getPagination() != null ? input.getPagination().getSize().longValue() : defaultValue;
+    }
+
+
+    public static QueryBuilder setSortOrder(QueryBuilder query, @Nullable List<Sortorder> sortorder) {
+        return setSortOrder(query, sortorder, "");
+    }
+
+    private static QueryBuilder setSortOrder(QueryBuilder query, @Nullable List<Sortorder> sortorder, String prefix) {
+        if (sortorder != null && sortorder.size() > 0) {
+            for (Sortorder so : sortorder) {
+                query.sort((prefix != null ? prefix : "") + so.getProperty(),
+                        so.getSortorder() == SortOrder.Ascending
+                                ? org.onap.ccsdk.features.sdnr.wt.common.database.queries.SortOrder.ASCENDING
+                                : org.onap.ccsdk.features.sdnr.wt.common.database.queries.SortOrder.DESCENDING);
+            }
+        }
+        return query;
+
+    }
+
+
+     public static Sortorder getSortOrder(@Nullable List<Sortorder> list, String prop) {
+        if (list == null) {
+            return null;
+        }
+        for (Sortorder o : list) {
+            if (prop.equals(o.getProperty())) {
+                return o;
+            }
+        }
+        return null;
+    }
+
+     public static Filter getFilter(@Nullable List<Filter> list, String prop) {
+        if (list == null) {
+            return null;
+        }
+        for (Filter f : list) {
+            if (prop.equals(f.getProperty())) {
+                return f;
+            }
+        }
+        return null;
+    }
+
+     public static QueryBuilder fromFilter(@Nullable List<Filter> filters) {
+        return fromFilter(filters, "");
+    }
+
+     private static String fillTimeStamp(String value) {
+        int idx=value.lastIndexOf("*");
+        final String REPLACE="0000-00-00T00:00:00.0Z";
+        String s = value.substring(0,idx)+REPLACE.substring(idx);
+        if(Integer.parseInt(s.substring(5,7))==0) {
+            s=s.substring(0,5)+"01-"+s.substring(8);
+        }
+        if(Integer.parseInt(s.substring(8,10))==0) {
+            s=s.substring(0,8)+"01"+s.substring(10);
+        }
+
+        return s;
+     }
+     /**
+      * convert timestamp with ending placeholder in filter to elasticsearch filter
+      * e.g. 2017* => gte: 2017-01-01T00:00:00Z, lt:2018-01-01T00:00:00Z
+      *
+      * 201*   => 2010-01... 2020 ..
+      * 2018-* => 2018-01... <=> 2019-01
+      *
+      */
+    private static @Nullable QueryBuilder fromTimestampSearchFilter(String property,String value) {
+        if(!value.endsWith("*")) {
+            return null;
+        }
+        int idx=value.lastIndexOf("*");
+        String lowerEnd = fillTimeStamp(value);
+        String upperEnd =null;
+        NetconfTimeStamp converter = NetconfTimeStampImpl.getConverter();
+        Date dt = null;
+        try{
+            dt=converter.getDateFromNetconf(lowerEnd);
+        }
+        catch(Exception e) {
+
+        }
+        if(dt==null) {
+            return null;
+        }
+//        property.substring(0,idx)+REPLACE.substring(idx+1);
+        Calendar c  = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+        c.setTime(dt);
+        int tmpvalue;
+        switch(idx) {
+        case 1:  // (2*)
+            c.set(Calendar.YEAR,c.get(Calendar.YEAR)+1000);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 2:  // (20*)
+            c.set(Calendar.YEAR,c.get(Calendar.YEAR)+100);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 3:  // (200*)
+            c.set(Calendar.YEAR,c.get(Calendar.YEAR)+10);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 4:  // (2000*)
+        case 5:  // (2000-*)
+            c.set(Calendar.YEAR,c.get(Calendar.YEAR)+1);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 6: //switch 10 months (2000-0* or 2000-1*)
+            tmpvalue = c.get(Calendar.MONTH);
+                if(tmpvalue<9) {
+                    c.set(Calendar.MONTH,9);
+                }
+                else {
+                    c.set(Calendar.YEAR,c.get(Calendar.YEAR)+1);
+                    c.set(Calendar.MONTH,0);
+                }
+                upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+
+            break;
+        case 7: //switch one month (2018-01* or 2018-01-*)
+        case 8:
+            c.add(Calendar.MONTH, 1);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 9: // (2018-01-0*)
+            tmpvalue = c.get(Calendar.DAY_OF_MONTH);
+            if(tmpvalue==1) {
+                c.set(Calendar.DAY_OF_MONTH, 10);
+            }else if(tmpvalue==10) {
+                c.set(Calendar.DAY_OF_MONTH, 20);
+            }else if(tmpvalue==20) {
+                if(c.getActualMaximum(Calendar.DAY_OF_MONTH)<30) {
+                    c.set(Calendar.DAY_OF_MONTH,1);
+                    c.add(Calendar.MONTH,1);
+                }
+                else {
+                    c.set(Calendar.DAY_OF_MONTH,30);
+                }
+            }else if(tmpvalue==30) {
+                c.set(Calendar.DAY_OF_MONTH,1);
+                c.add(Calendar.MONTH,1);
+            }
+            else {
+                break;
+            }
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 10: // (2018-01-01*)
+        case 11: // (2018-01-01T*)
+            c.add(Calendar.DAY_OF_MONTH,1);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 12: // (2018-01-01T1*)
+            tmpvalue = c.get(Calendar.HOUR_OF_DAY);
+            if(tmpvalue==20) {
+                c.set(Calendar.HOUR_OF_DAY,0);
+                c.add(Calendar.DAY_OF_MONTH,1);
+            }
+            else {
+                c.add(Calendar.HOUR_OF_DAY,10);
+            }
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 13: // (2018-01-01T11*)
+        case 14: // (2018-01-01T11-*)
+            c.add(Calendar.HOUR_OF_DAY,1);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 15: // (2018-01-01T11-3*)
+            c.add(Calendar.MINUTE,10);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 16: // (2018-01-01T11-32*)
+        case 17: // (2018-01-01T11-32-*)
+            c.add(Calendar.MINUTE,1);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 18: // (2018-01-01T11-32-1*)
+            c.add(Calendar.SECOND,10);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+        case 19: // (2018-01-01T11-32-11*)
+        case 20: // (2018-01-01T11-32-11.*)
+            c.add(Calendar.SECOND,1);
+            upperEnd = converter.getTimeStampAsNetconfString(c.getTime());
+            break;
+
+            default:
+                break;
+        }
+
+        if(upperEnd==null) {
+            return null;
+        }
+        return QueryBuilders.rangeQuery(property).gte(lowerEnd).lt(upperEnd);
+
+    }
+    private static QueryBuilder fromFilter(@Nullable List<Filter> filters, String prefix) {
+        if (filters == null || filters.size() == 0) {
+            return QueryBuilders.matchAllQuery();
+
+        } else if (filters.size() == 1) {
+            QueryBuilder query;
+            String p = filters.get(0).getProperty();
+            String v= filters.get(0).getFiltervalue();
+            if ("id".equals(p)) {
+                p = "_id";
+            }
+            else {
+            //    v=v.toLowerCase();
+            }
+            if (DbFilter.hasSearchParams(v)) {
+                if(p!=null && "timestamp".equals(p.toLowerCase())) {
+                    query = fromTimestampSearchFilter(p,v);
+                    if(query!=null) {
+                        return query;
+                    }
+                }
+                return QueryBuilders.regex(p, DbFilter.createDatabaseRegex(v));
+
+
+            } else if (DbFilter.isComparisonValid(v)) {
+                RangeQueryBuilder q = DbFilter.getRangeQuery((prefix != null ? prefix : "") + p, v);
+                if (q != null) {
+                    return q;
+                }
+                else {
+                    return QueryBuilders.matchQuery((prefix != null ? prefix : "") + p, v);
+                }
+            }
+            else {
+                return QueryBuilders.matchQuery((prefix != null ? prefix : "") + p, v);
+            }
+        }
+        else {
+            BoolQueryBuilder query = new BoolQueryBuilder();
+            QueryBuilder tmpQuery;
+            for (Filter fi : filters) {
+                String p = fi.getProperty();
+                String v=fi.getFiltervalue();
+                if ("id".equals(p)) {
+                    p = "_id";
+                }
+                else {
+                //    v=v.toLowerCase();
+                }
+                if(DbFilter.hasSearchParams(v)) {
+                    if(p!=null && "timestamp".equals(p.toLowerCase())) {
+                        tmpQuery=fromTimestampSearchFilter(p,v);
+                        if(tmpQuery!=null) {
+                            query.must(tmpQuery);
+                        }else {
+                            query.must(QueryBuilders.regex((prefix != null ? prefix : "") + p,DbFilter.createDatabaseRegex(v)));
+                        }
+                    }else {
+                        query.must(QueryBuilders.regex((prefix != null ? prefix : "") + p,DbFilter.createDatabaseRegex(v)));
+                    }
+                }
+                else if (DbFilter.isComparisonValid(v)) {
+                    RangeQueryBuilder q = DbFilter.getRangeQuery((prefix != null ? prefix : "") + p,v);
+                    if(q!=null) {
+                        query.must(q);
+                    }
+                    else {
+                        query.must(QueryBuilders.matchQuery((prefix != null ? prefix : "") + p,v));
+                    }
+                }
+                else {
+                    query.must(QueryBuilders.matchQuery((prefix != null ? prefix : "") + p,v));
+                }
+            }
+            LOG.trace("Query result. {}", query.toJSON());
+            return query;
+        }
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/QueryResult.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/QueryResult.java
new file mode 100644
index 0000000..9cbe943
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/QueryResult.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.math.BigInteger;
+
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PaginationOutputG;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.PaginationBuilder;
+
+public class QueryResult<T> {
+
+	private SearchResult<T> result;
+	private PaginationOutputG pagination;
+
+	public QueryResult(long page, long pageSize, SearchResult<T> result) {
+		this.result = result;
+
+		PaginationBuilder x = new PaginationBuilder();
+		x.setPage(BigInteger.valueOf(page));
+		x.setSize(pageSize);
+		x.setTotal(BigInteger.valueOf(result.getTotal()));
+		pagination = x.build();
+	}
+
+	public SearchResult<T> getResult() {
+		return result;
+	}
+
+	PaginationOutputG getPagination() {
+		return pagination;
+	}
+
+
+
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/SystemInfo.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/SystemInfo.java
new file mode 100644
index 0000000..2b3ebd8
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/SystemInfo.java
@@ -0,0 +1,331 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.management.ClassLoadingMXBean;
+import java.lang.management.GarbageCollectorMXBean;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+import java.lang.management.MemoryPoolMXBean;
+import java.lang.management.MemoryType;
+import java.lang.management.MemoryUsage;
+import java.lang.management.OperatingSystemMXBean;
+import java.lang.management.RuntimeMXBean;
+import java.lang.management.ThreadMXBean;
+import java.lang.reflect.Method;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.text.NumberFormat;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.concurrent.Callable;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Stream;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+
+public class SystemInfo {
+	private static NumberFormat fmtI = new DecimalFormat("###,###", new DecimalFormatSymbols(Locale.ENGLISH));
+	private static NumberFormat fmtDec = new DecimalFormat("###,###.##", new DecimalFormatSymbols(Locale.ENGLISH));
+	private static NumberFormat fmtD = new DecimalFormat("###,##0.000", new DecimalFormatSymbols(Locale.ENGLISH));
+	private static OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();
+	protected static boolean showMemoryPools = false;
+
+	public static String getMdSalVersion(String def) {
+		return getMdSalVersion("", def);
+	}	
+	public static String getYangToolsVersion(String def) {
+		return getYangToolsVersion("", def);
+	}	
+	
+	public static String getMdSalVersion(String baseOdlDirectory,String def) {
+		return getFeatureVersionByFolder(baseOdlDirectory,"system/org/opendaylight/mdsal/mdsal-binding-api/",def);
+	}
+	public static String getYangToolsVersion(String baseOdlDirectory,String def) {
+		return getFeatureVersionByFolder(baseOdlDirectory,"system/org/opendaylight/yangtools/odl-yangtools-common/",def);
+	}
+	private static String getFeatureVersionByFolder(String baseOdlDirectory,String dir,String def) {
+				final String regex = "^[0-9]+\\.[0-9]+\\.[0-9]+(-SNAPSHOT)?$";
+		Stream<Path> entries=null;
+		try {
+			if(baseOdlDirectory!=null && baseOdlDirectory.length()>0 && !baseOdlDirectory.endsWith("/")) {
+				baseOdlDirectory+="/";
+			}
+			entries = Files.list(new File(baseOdlDirectory+dir).toPath());
+		} catch (IOException e) {
+			
+		}
+		if(entries==null) {
+			return def;
+		}
+		final Pattern pattern = Pattern.compile(regex);
+		
+		Iterator<Path> it = entries.iterator();
+		Path p;File f;
+		while(it.hasNext()) {
+		    p = it.next();
+			f=p.toFile();
+			if(f.isDirectory()) {
+				final Matcher matcher = pattern.matcher(f.getName().toString());
+				if(matcher.find()) {
+					def= matcher.group(0);
+					break;
+				}
+			}
+		}
+		entries.close();
+		return def;
+	}
+	public static String get() throws Exception {
+		StringBuilder sb = new StringBuilder();
+		int maxNameLen;
+
+		RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
+		ThreadMXBean threads = ManagementFactory.getThreadMXBean();
+		MemoryMXBean mem = ManagementFactory.getMemoryMXBean();
+		ClassLoadingMXBean cl = ManagementFactory.getClassLoadingMXBean();
+
+		//
+		// print Karaf informations
+		//
+		maxNameLen = 25;
+		sb.append("Karaf\n");
+		printValue(sb, "Karaf version", maxNameLen, System.getProperty("karaf.version"));
+		printValue(sb, "Karaf home", maxNameLen, System.getProperty("karaf.home"));
+		printValue(sb, "Karaf base", maxNameLen, System.getProperty("karaf.base"));
+		String osgi = getOsgiFramework();
+		if (osgi != null) {
+			printValue(sb, "OSGi Framework", maxNameLen, osgi);
+		}
+
+		sb.append("JVM\n");
+		printValue(sb, "Java Virtual Machine", maxNameLen, runtime.getVmName() + " version " + runtime.getVmVersion());
+		printValue(sb, "Version", maxNameLen, System.getProperty("java.version"));
+		printValue(sb, "Vendor", maxNameLen, runtime.getVmVendor());
+		printValue(sb, "Pid", maxNameLen, getPid());
+		printValue(sb, "Uptime", maxNameLen, printDuration(runtime.getUptime()));
+		try {
+			Class<?> sunOS = Class.forName("com.sun.management.OperatingSystemMXBean");
+			printValue(sb, "Process CPU time", maxNameLen,
+					printDuration(getValueAsLong(sunOS, "getProcessCpuTime") / 1000000.0));
+			printValue(sb, "Process CPU load", maxNameLen, fmtDec.format(getValueAsDouble(sunOS, "getProcessCpuLoad")));
+			printValue(sb, "System CPU load", maxNameLen, fmtDec.format(getValueAsDouble(sunOS, "getSystemCpuLoad")));
+		} catch (Throwable t) {
+		}
+		try {
+			Class<?> unixOS = Class.forName("com.sun.management.UnixOperatingSystemMXBean");
+			printValue(sb, "Open file descriptors", maxNameLen,
+					printLong(getValueAsLong(unixOS, "getOpenFileDescriptorCount")));
+			printValue(sb, "Max file descriptors", maxNameLen,
+					printLong(getValueAsLong(unixOS, "getMaxFileDescriptorCount")));
+		} catch (Throwable t) {
+		}
+		printValue(sb, "Total compile time", maxNameLen,
+				printDuration(ManagementFactory.getCompilationMXBean().getTotalCompilationTime()));
+
+		sb.append("Threads\n");
+		printValue(sb, "Live threads", maxNameLen, Integer.toString(threads.getThreadCount()));
+		printValue(sb, "Daemon threads", maxNameLen, Integer.toString(threads.getDaemonThreadCount()));
+		printValue(sb, "Peak", maxNameLen, Integer.toString(threads.getPeakThreadCount()));
+		printValue(sb, "Total started", maxNameLen, Long.toString(threads.getTotalStartedThreadCount()));
+
+		sb.append("Memory\n");
+		printValue(sb, "Current heap size", maxNameLen, printSizeInKb(mem.getHeapMemoryUsage().getUsed()));
+		printValue(sb, "Maximum heap size", maxNameLen, printSizeInKb(mem.getHeapMemoryUsage().getMax()));
+		printValue(sb, "Committed heap size", maxNameLen, printSizeInKb(mem.getHeapMemoryUsage().getCommitted()));
+		printValue(sb, "Pending objects", maxNameLen, Integer.toString(mem.getObjectPendingFinalizationCount()));
+		for (GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans()) {
+			String val = "Name = '" + gc.getName() + "', Collections = " + gc.getCollectionCount() + ", Time = "
+					+ printDuration(gc.getCollectionTime());
+			printValue(sb, "Garbage collector", maxNameLen, val);
+		}
+
+		if (showMemoryPools) {
+			List<MemoryPoolMXBean> memoryPools = ManagementFactory.getMemoryPoolMXBeans();
+			sb.append("Memory Pools\n");
+			printValue(sb, "Total Memory Pools", maxNameLen, printLong(memoryPools.size()));
+			String spaces4 = "   ";
+			for (MemoryPoolMXBean pool : memoryPools) {
+				String name = pool.getName();
+				MemoryType type = pool.getType();
+				printValue(sb, spaces4 + "Pool (" + type + ")", maxNameLen, name);
+
+				// PeakUsage/CurrentUsage
+				MemoryUsage peakUsage = pool.getPeakUsage();
+				MemoryUsage usage = pool.getUsage();
+
+				if (usage != null && peakUsage != null) {
+					long init = peakUsage.getInit();
+					long used = peakUsage.getUsed();
+					long committed = peakUsage.getCommitted();
+					long max = peakUsage.getMax();
+					sb.append(spaces4 + spaces4 + "Peak Usage\n");
+					printValue(sb, spaces4 + spaces4 + spaces4 + "init", maxNameLen, printLong(init));
+					printValue(sb, spaces4 + spaces4 + spaces4 + "used", maxNameLen, printLong(used));
+					printValue(sb, spaces4 + spaces4 + spaces4 + "committed", maxNameLen, printLong(committed));
+					printValue(sb, spaces4 + spaces4 + spaces4 + "max", maxNameLen, printLong(max));
+
+					init = usage.getInit();
+					used = usage.getUsed();
+					committed = usage.getCommitted();
+					max = usage.getMax();
+					sb.append(spaces4 + spaces4 + "Current Usage\n");
+					printValue(sb, spaces4 + spaces4 + spaces4 + "init", maxNameLen, printLong(init));
+					printValue(sb, spaces4 + spaces4 + spaces4 + "used", maxNameLen, printLong(used));
+					printValue(sb, spaces4 + spaces4 + spaces4 + "committed", maxNameLen, printLong(committed));
+					printValue(sb, spaces4 + spaces4 + spaces4 + "max", maxNameLen, printLong(max));
+				}
+			}
+		}
+
+		sb.append("Classes\n");
+		printValue(sb, "Current classes loaded", maxNameLen, printLong(cl.getLoadedClassCount()));
+		printValue(sb, "Total classes loaded", maxNameLen, printLong(cl.getTotalLoadedClassCount()));
+		printValue(sb, "Total classes unloaded", maxNameLen, printLong(cl.getUnloadedClassCount()));
+
+		sb.append("Operating system\n");
+		printValue(sb, "Name", maxNameLen, os.getName() + " version " + os.getVersion());
+		printValue(sb, "Architecture", maxNameLen, os.getArch());
+		printValue(sb, "Processors", maxNameLen, Integer.toString(os.getAvailableProcessors()));
+		try {
+			printValue(sb, "Total physical memory", maxNameLen,
+					printSizeInKb(getSunOsValueAsLong(os, "getTotalPhysicalMemorySize")));
+			printValue(sb, "Free physical memory", maxNameLen,
+					printSizeInKb(getSunOsValueAsLong(os, "getFreePhysicalMemorySize")));
+			printValue(sb, "Committed virtual memory", maxNameLen,
+					printSizeInKb(getSunOsValueAsLong(os, "getCommittedVirtualMemorySize")));
+			printValue(sb, "Total swap space", maxNameLen,
+					printSizeInKb(getSunOsValueAsLong(os, "getTotalSwapSpaceSize")));
+			printValue(sb, "Free swap space", maxNameLen,
+					printSizeInKb(getSunOsValueAsLong(os, "getFreeSwapSpaceSize")));
+		} catch (Throwable t) {
+		}
+		return sb.toString();
+	}
+
+	private static String getPid() {
+		// In Java 9 the new process API can be used:
+		// long pid = ProcessHandle.current().getPid();
+		String name = ManagementFactory.getRuntimeMXBean().getName();
+		String[] parts = name.split("@");
+		return parts[0];
+	}
+
+	private static long getSunOsValueAsLong(OperatingSystemMXBean os, String name) throws Exception {
+		Method mth = os.getClass().getMethod(name);
+		return (Long) mth.invoke(os);
+	}
+
+	private static long getValueAsLong(Class<?> osImpl, String name) throws Exception {
+		if (osImpl.isInstance(os)) {
+			Method mth = osImpl.getMethod(name);
+			return (Long) mth.invoke(os);
+		}
+		return -1;
+	}
+
+	private static double getValueAsDouble(Class<?> osImpl, String name) throws Exception {
+		if (osImpl.isInstance(os)) {
+			Method mth = osImpl.getMethod(name);
+			return (Double) mth.invoke(os);
+		}
+		return -1;
+	}
+
+	private static String printLong(long i) {
+		return fmtI.format(i);
+	}
+
+	private static String printSizeInKb(double size) {
+		return fmtI.format((long) (size / 1024)) + " kbytes";
+	}
+
+	protected static String printDuration(double uptime) {
+		uptime /= 1000;
+		if (uptime < 60) {
+			return fmtD.format(uptime) + " seconds";
+		}
+		uptime /= 60;
+		if (uptime < 60) {
+			long minutes = (long) uptime;
+			String s = fmtI.format(minutes) + (minutes > 1 ? " minutes" : " minute");
+			return s;
+		}
+		uptime /= 60;
+		if (uptime < 24) {
+			long hours = (long) uptime;
+			long minutes = (long) ((uptime - hours) * 60);
+			String s = fmtI.format(hours) + (hours > 1 ? " hours" : " hour");
+			if (minutes != 0) {
+				s += " " + fmtI.format(minutes) + (minutes > 1 ? " minutes" : " minute");
+			}
+			return s;
+		}
+		uptime /= 24;
+		long days = (long) uptime;
+		long hours = (long) ((uptime - days) * 24);
+		String s = fmtI.format(days) + (days > 1 ? " days" : " day");
+		if (hours != 0) {
+			s += " " + fmtI.format(hours) + (hours > 1 ? " hours" : " hour");
+		}
+		return s;
+	}
+
+	static void printSysValue(StringBuilder sb, String prop, int pad) {
+		printValue(sb, prop, pad, System.getProperty(prop));
+	}
+
+	static void printValue(StringBuilder sb, String name, int pad, String value) {
+		sb.append("  " + // SimpleAnsi.INTENSITY_BOLD +
+				name + // SimpleAnsi.INTENSITY_NORMAL +
+				spaces(pad - name.length()) + "   " + value + "\n");
+	}
+
+	static String spaces(int nb) {
+		StringBuilder sb = new StringBuilder();
+		for (int i = 0; i < nb; i++) {
+			sb.append(' ');
+		}
+		return sb.toString();
+	}
+
+	static String getOsgiFramework() {
+		try {
+			Callable<String> call = new Callable<String>() {
+				@Override
+				public String call() throws Exception {
+					BundleContext context = FrameworkUtil.getBundle(getClass()).getBundleContext();
+					Bundle sysBundle = context.getBundle(0);
+					return sysBundle.getSymbolicName() + "-" + sysBundle.getVersion();
+				}
+			};
+			return call.call();
+		} catch (Throwable t) {
+			// We're not in OSGi, just safely return null
+			return null;
+		}
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/YangFileProvider.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/YangFileProvider.java
new file mode 100644
index 0000000..5e0c470
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/YangFileProvider.java
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.file.Path;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class YangFileProvider {
+
+	private static final Logger LOG = LoggerFactory.getLogger(YangFileProvider.class);
+
+	private static final FilenameFilter yangFilenameFilter = new FilenameFilter() {
+
+		@Override
+		public boolean accept(File dir, String name) {
+			return name.toLowerCase().endsWith(".yang");
+		}
+	};
+
+	private static final int BUFFER_SIZE = 1024;
+
+	private final Path mainSourcePath;
+	private final List<Path> additionalSources;
+
+	public YangFileProvider(String path) {
+		this.mainSourcePath = new File(path).toPath();
+		this.additionalSources = new ArrayList<>();
+	}
+
+	public boolean hasFileForModule(String module, String version) {
+		return this.mainSourcePath.resolve(YangFilename.createFilename(module, version)).toFile().exists();
+	}
+
+	public boolean hasFileForModule(String module) {
+		return this.findYangFiles(module).size() > 0;
+	}
+
+	private List<YangFilename> findYangFiles(String module) {
+		List<YangFilename> list = new ArrayList<>();
+		String[] files = this.mainSourcePath.toFile().list(yangFilenameFilter);
+		YangFilename yangfile;
+		for (String file : files) {
+			files = this.mainSourcePath.toFile().list(yangFilenameFilter);
+			for (String fn : files) {
+				try {
+					yangfile = new YangFilename(this.mainSourcePath.resolve(fn).toString());
+					if (yangfile.getModule().equals(module)) {
+						list.add(yangfile);
+					}
+				} catch (ParseException e) {
+					LOG.warn("unable to handle yangfile {}: {}", file, e);
+				}
+			}
+		}
+		for (Path addPath : this.additionalSources) {
+			files = addPath.toFile().list(yangFilenameFilter);
+			for (String file : files) {
+				try {
+					yangfile = new YangFilename(addPath.resolve(file).toString());
+					if (yangfile.getModule().equals(module)) {
+						list.add(yangfile);
+					}
+				} catch (ParseException e) {
+					LOG.warn("unable to handle yangfile {}: {}", file, e);
+				}
+			}
+		}
+		return list;
+	}
+
+	/**
+	 * get yang file from source with specified version or least newer one if
+	 * version is null then the latest one
+	 * 
+	 * @param module
+	 * @param version
+	 * @return
+	 * @throws ParseException
+	 */
+	private @Nullable YangFilename getYangFile(@Nonnull String module, @Nullable String version) throws ParseException {
+		YangFilename f = null;
+		List<YangFilename> list = this.findYangFiles(module);
+
+		list.sort(SortByDateAscComparator.getInstance());
+
+		// find specific version or nearest oldest
+		if (version != null) {
+			Date rev = YangFilename.parseRevision(version);
+			for (YangFilename item : list) {
+				if (rev.equals(item.getRevision())) {
+					f = item;
+					break;
+				}
+				if (item.getRevision().after(rev)) {
+					f = item;
+					break;
+				}
+			}
+		}
+		// get latest
+		else {
+			f = list.get(list.size() - 1);
+		}
+		return f;
+	}
+
+	/**
+	 * write filestream directly to output stream easier for http handling
+	 * 
+	 * @param module
+	 * @param version
+	 * @param outputStream
+	 * @return
+	 * @throws IOException
+	 * @throws ParseException
+	 */
+	public int writeOutput(@Nonnull String module, @Nullable String version, @Nonnull OutputStream outputStream)
+			throws IOException, ParseException {
+		YangFilename fn = this.getYangFile(module, version);
+		if(fn==null) {
+			return 0;
+		}
+		byte[] buffer = new byte[BUFFER_SIZE];
+		int bytesRead = -1;
+		int sumlen = 0;
+		InputStream inputStream = null ;
+		try {
+			inputStream= new FileInputStream(fn.getFilename());
+
+		while ((bytesRead = inputStream.read(buffer)) != -1) {
+			outputStream.write(buffer, 0, bytesRead);
+			sumlen += bytesRead;
+		}}
+		catch(IOException e) {
+			LOG.warn("problem sending {}: {}",fn.getFilename(),e);
+		}
+		finally {
+			if(inputStream!=null) {
+				inputStream.close();		
+			}
+		}
+		return sumlen;
+	}
+
+	private static class SortByDateAscComparator implements Comparator<YangFilename> {
+
+		private static SortByDateAscComparator instance;
+
+		@Override
+		public int compare(YangFilename o1, YangFilename o2) {
+			return o1.getRevision().compareTo(o2.getRevision());
+		}
+
+		public static Comparator<YangFilename> getInstance() {
+			if (instance == null) {
+				instance = new SortByDateAscComparator();
+			}
+			return instance;
+		}
+
+	}
+
+	public YangFilename getFileForModule(String module, String rev) throws ParseException {
+		return this.getYangFile(module, rev);
+	}
+
+	public YangFilename getFileForModule(String module) throws ParseException {
+		return this.getFileForModule(module, null);
+	}
+
+	public boolean hasFileOrNewerForModule(String module, String version) throws ParseException {
+		return this.getYangFile(module, version) != null;
+	}
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/YangFilename.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/YangFilename.java
new file mode 100644
index 0000000..d46f5d5
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/YangFilename.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.data;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class YangFilename {
+
+	private static final String REGEX = "([^\\/]*)@([0-9]{4}-[0-9]{2}-[0-9]{2}).yang";
+	private static final Pattern pattern = Pattern.compile(REGEX, Pattern.MULTILINE);
+	private final String filename;
+	private final Matcher matcher;
+	private Date revision;
+	private String module; 
+	public static Date parseRevision(String sRevision) throws ParseException {
+		final SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
+		return fmt.parse(sRevision);
+	}
+	public YangFilename(String fn) throws ParseException {
+		this.filename = fn;
+		matcher = pattern.matcher(this.filename);
+		if(!matcher.find()) {
+			throw new ParseException("unknown filename format", 0);
+		}
+		this.module= matcher.group(1);
+		this.revision=parseRevision(matcher.group(2));
+		
+	}
+	public static String createFilename(String module, String rev) {
+		return String.format("%s@%s.yang", module,rev);
+	}
+	public YangFilename(String module, String rev) throws ParseException {
+		this(createFilename(module, rev));
+	}
+	public String getFilename() {
+		return this.filename;
+	}
+	public Date getRevision() {
+		return this.revision;
+	}
+	public String getModule() {
+		return this.module;
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter.java
new file mode 100644
index 0000000..b119b80
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter.java
@@ -0,0 +1,339 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.database;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.List;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.onap.ccsdk.features.sdnr.wt.common.database.DatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchHit;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+/**
+ * Class to rw yang-tool generated objects into elasticsearch database. For "ES _id" exchange the esIdAddAtributteName is used.
+ * This attribute mast be of type String and contains for read and write operations the object id.
+ * The function can be used without id handling.
+ * If id handling is required the parameter needs to be specified by class definition in yang and  setting the name by using setAttributeName()
+ *
+ * @param <T> Yang tools generated class object.
+ */
+public class EsDataObjectReaderWriter<T extends DataObject> {
+
+ 	private final Logger LOG = LoggerFactory.getLogger(EsDataObjectReaderWriter.class);
+
+ 	/** Typename for elastic search data schema **/
+	private String dataTypeName;
+
+	/** Elasticsearch Database client to be used **/
+	private DatabaseClient db;
+
+	/** Mapper with configuration to use opendaylight yang-tools builder pattern for object creation **/
+	private YangToolsMapper yangtoolsMapper;
+
+	/** Class of T as attribute to allow JSON to Class object mapping **/
+	private Class<T> clazz;
+
+	/** Field is used to write id. If null no id handling **/
+	private @Nullable Field field;
+
+	/** Attribute that is used as id field for the database object **/
+	private @Nullable String esIdAddAtributteName;
+
+	/** Interface to be used for write operations. Rule for write: T extends S and  **/
+	private Class<? extends DataObject> writeInterfaceClazz; // == "S"
+
+	/**
+	 * Elasticsearch database read and write for specific class, defined by opendaylight yang-tools.
+	 *
+	 * @param db Database access client
+	 * @param dataTypeName typename in database schema
+	 * @param clazz class of type to be handled
+	 * @throws ClassNotFoundException
+	 */
+	public EsDataObjectReaderWriter(DatabaseClient db, Entity dataTypeName, Class<T> clazz) throws ClassNotFoundException {
+		this(db, dataTypeName.getName(), clazz);
+	}
+	public EsDataObjectReaderWriter(DatabaseClient db, String dataTypeName, Class<T> clazz) throws ClassNotFoundException {
+		LOG.info("Create {} for datatype {} class {}", this.getClass().getName(), dataTypeName, clazz.getName());
+
+		this.esIdAddAtributteName = null;
+		this.field = null;
+		this.writeInterfaceClazz = clazz;
+		this.db = db;
+		this.dataTypeName = dataTypeName;
+		this.yangtoolsMapper = new YangToolsMapper();
+		//this.yangtoolsMapper.assertBuilderClass(clazz);
+		this.clazz = clazz;
+//
+//		if (! db.isExistsIndex(dataTypeName)) {
+//			throw new IllegalArgumentException("Index "+dataTypeName+" not existing.");
+//		}
+	}
+
+	public String getDataTypeName() {
+		return dataTypeName;
+	}
+	public Class<T> getClazz() {
+		return clazz;
+	}
+	/**
+	 * Simlar to {@link #setEsIdAttributeName()}, but adapts the parameter to yangtools attribute naming schema
+	 * @param esIdAttributeName is converted to UnderscoreCamelCase
+	 * @return this for further operations.
+	 */
+	public EsDataObjectReaderWriter<T> setEsIdAttributeNameCamelized(String esIdAttributeName) {
+		return setEsIdAttributeName(YangToolsMapper.toCamelCaseAttributeName(esIdAttributeName));
+	}
+
+	/**
+	 * Attribute name of class that is containing the object id
+	 * @param esIdAttributeName of the implementation class for the yangtools interface.
+	 *        Expected attribute name format is CamelCase with leading underline. @
+	 * @return this for further operations.
+	 * @throws SecurityException if no access or IllegalArgumentException if wrong type or no attribute with this name.
+	 */
+	public EsDataObjectReaderWriter<T> setEsIdAttributeName(String esIdAttributeName) {
+		LOG.debug("Set attribute '{}'", esIdAttributeName);
+		this.esIdAddAtributteName = null; // Reset status
+		this.field = null;
+
+		Field attributeField;
+		try {
+			Builder<T> builder = yangtoolsMapper.getBuilder(clazz);
+			T object = builder.build();
+			attributeField = object.getClass().getDeclaredField(esIdAttributeName);
+			if (attributeField.getType().equals(String.class)) {
+				attributeField.setAccessible(true);
+				this.esIdAddAtributteName = esIdAttributeName; //Set new status if everything OK
+				this.field = attributeField;
+			} else {
+				String msg = "Wrong field type " + attributeField.getType().getName() + " of " + esIdAttributeName;
+				LOG.debug(msg);
+				throw new IllegalArgumentException(msg);
+			}
+		} catch (NoSuchFieldException e) {
+			// Convert to run-time exception
+			String msg = "NoSuchFieldException for '" + esIdAttributeName + "' in class " + clazz.getName();
+			LOG.debug(msg);
+			throw new IllegalArgumentException(msg);
+		} catch (SecurityException e) {
+			LOG.debug("Access problem "+esIdAttributeName,e);
+			throw e;
+		}
+		return this;
+	}
+
+	/**
+	 * Specify subclass of T for write operations.
+	 * @param writeInterfaceClazz
+	 */
+	public EsDataObjectReaderWriter<T> setWriteInterface( @Nonnull Class<? extends DataObject> writeInterfaceClazz ) {
+		LOG.debug("Set write interface to {}", writeInterfaceClazz);
+		if (writeInterfaceClazz == null)
+			throw new IllegalArgumentException("Null not allowed here.");
+
+		this.writeInterfaceClazz = writeInterfaceClazz;
+		return this;
+	}
+
+	/**
+	 * Write child object to database with specific id
+	 * @param object
+	 * @param @Nullable esId use the id or if null generate unique id
+	 * @return String with id or null
+	 */
+	public @Nullable <S extends DataObject> String write(S object, @Nullable String esId) {
+		if (writeInterfaceClazz.isInstance(object)) {
+			try {
+				String json = yangtoolsMapper.writeValueAsString(object);
+				return db.doWriteRaw(dataTypeName, esId, json);
+			} catch (JsonProcessingException e) {
+				LOG.error("Write problem: ", e);
+			}
+		} else {
+			LOG.error("Type {} does not provide interface {}", object!=null?object.getClass().getName():"null",
+					writeInterfaceClazz.getName());
+		}
+		return null;
+	}
+	/**
+	 * Update partial child object to database with match/term query
+	 * @param object
+	 * @param esId
+	 * @return String with esId or null
+	 */
+	public @Nullable <S extends DataObject> String update(S object, QueryBuilder query) {
+		if (writeInterfaceClazz.isInstance(object)) {
+			try {
+				String json = yangtoolsMapper.writeValueAsString(object);
+				return db.doUpdate(this.dataTypeName,json,query);
+			} catch (JsonProcessingException e) {
+				LOG.error("Update problem: ", e);
+			}
+		} else {
+			LOG.error("Type {} does not provide interface {}", object!=null?object.getClass().getName():"null",
+					writeInterfaceClazz.getName());
+		}
+		return null;
+	}
+	/**
+	 * Write/ update partial child object to database with specific id Write if not
+	 * exists, else update
+	 * @param object
+	 * @param esId
+	 * @return String with esId or null
+	 */
+	public @Nullable <S extends DataObject> String update(S object, String esId) {
+		return this.update(object, esId,null);
+	}
+	public @Nullable <S extends DataObject> String update(S object, String esId,List<String> onylForInsert) {
+		if (writeInterfaceClazz.isInstance(object)) {
+			try {
+				String json = yangtoolsMapper.writeValueAsString(object);
+				return db.doUpdateOrCreate(dataTypeName, esId, json,onylForInsert);
+			} catch (JsonProcessingException e) {
+				LOG.error("Update problem: ", e);
+			}
+		} else {
+			LOG.error("Type {} does not provide interface {}", object!=null?object.getClass().getName():"null",
+					writeInterfaceClazz.getName());
+		}
+		return null;
+	}
+
+    /**
+     * Read object from database, by using the id field
+     * @param object
+     * @return
+     */
+    public @Nullable T read(String esId) {
+    	@Nullable T res = (T)null;
+		if (esId != null) {
+			String json = db.doReadJsonData(dataTypeName, esId);
+			try {
+				res = yangtoolsMapper.readValue(json.getBytes(), clazz);
+			} catch (IOException e) {
+				LOG.error("Problem: ", e);
+			}
+		}
+        return res;
+    }
+
+    /**
+     * Remove object
+     * @param esId to identify the object.
+     * @return success
+     */
+    public boolean remove(String esId) {
+    	return db.doRemove(this.dataTypeName, esId);
+    }
+
+	public int remove(QueryBuilder query) {
+		return this.db.doRemove(this.dataTypeName, query);
+	}
+    /**
+     * Get all elements of related type
+     * @return all Elements
+     */
+    public SearchResult<T> doReadAll() {
+        return doReadAll(null);
+    }
+    public SearchResult<T> doReadAll(QueryBuilder query) {
+    	return this.doReadAll(query,false);
+	}
+    /**
+     * Read all existing objects of a type
+     * @param query for the elements
+     * @return the list of all objects
+     */
+
+    public SearchResult<T> doReadAll(QueryBuilder query, boolean ignoreException) {
+
+    	SearchResult<T> res = new SearchResult<T>();
+        int idx = 0;                //Idx for getAll
+        int iterateLength = 100;    //Step width for iterate
+
+        SearchResult<SearchHit> result;
+        List<SearchHit> hits;
+        do {
+            if(query!=null) {
+                LOG.debug("read data in {} with query {}",dataTypeName,query.toJSON());
+                result=db.doReadByQueryJsonData( dataTypeName, query,ignoreException);
+            }
+            else {
+            	result = db.doReadAllJsonData(dataTypeName,ignoreException);
+            }
+            hits=result.getHits();
+            LOG.debug("Read: {} elements: {}  Failures: {}",dataTypeName,hits.size(), yangtoolsMapper.getMappingFailures());
+
+            T object;
+            idx += result.getHits().size();
+			for (SearchHit hit : hits) {
+				object = getT(hit.getSourceAsString());
+				LOG.debug("Mapp Object: {}\nSource: '{}'\nResult: '{}'\n Failures: {}", hit.getId(),
+						hit.getSourceAsString(), object, yangtoolsMapper.getMappingFailures());
+				if (object != null) {
+					setEsId(object, hit.getId());
+					res.add(object);
+				} else {
+					LOG.warn("Mapp result null Object: {}\n Source: '{}'\n : '", hit.getId(), hit.getSourceAsString());
+				}
+			}
+
+		} while (hits.size() == iterateLength); // Do it until end indicated, because less hits than iterateLength
+												// allows.
+        res.setTotal(result.getTotal());
+        return res;
+    }
+
+	/* ---------------------------------------------
+     * Private functions
+     */
+
+	private void setEsId(T object, String esId) {
+		if (field != null) {
+			try {
+				field.set(object, esId);
+			} catch (IllegalArgumentException | IllegalAccessException e) {
+				LOG.debug("Field set problem.", e);			}
+		}
+	}
+
+    private @Nullable T getT(String jsonString) {
+    	try {
+			return yangtoolsMapper.readValue( jsonString, clazz );
+		} catch (IOException e) {
+			LOG.info("Mapping problem", e);
+			return (T)null;
+		}
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter2.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter2.java
new file mode 100644
index 0000000..d097d82
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/EsDataObjectReaderWriter2.java
@@ -0,0 +1,361 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.database;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.List;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.onap.ccsdk.features.sdnr.wt.common.database.DatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchHit;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper2;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+/**
+ * Class to rw yang-tool generated objects into elasticsearch database. For "ES _id" exchange the esIdAddAtributteName is used.
+ * This attribute mast be of type String and contains for read and write operations the object id.
+ * The function can be used without id handling.
+ * If id handling is required the parameter needs to be specified by class definition in yang and  setting the name by using setAttributeName()
+ *
+ * Due to using Jackson base interfaces the org.eclipse.jdt.annotation.NonNull needs to be used here to get rid of warnings
+ *
+ * @param <T> Yang tools generated class object.
+ */
+public class EsDataObjectReaderWriter2<T extends DataObject> {
+
+     private final Logger LOG = LoggerFactory.getLogger(EsDataObjectReaderWriter2.class);
+
+     /** Typename for elastic search data schema **/
+    private String dataTypeName;
+
+    /** Elasticsearch Database client to be used **/
+    private DatabaseClient db;
+
+    /** Mapper with configuration to use opendaylight yang-tools builder pattern for object creation **/
+    private YangToolsMapper2<T> yangtoolsMapper;
+
+    /** Class of T as attribute to allow JSON to Class object mapping **/
+    private Class<T> clazz;
+
+    /** Field is used to write id. If null no id handling **/
+    private @Nullable Field field;
+
+    /** Attribute that is used as id field for the database object **/
+    private @Nullable String esIdAddAtributteName;
+
+    /** Interface to be used for write operations. Rule for write: T extends S and  **/
+    private Class<? extends DataObject> writeInterfaceClazz; // == "S"
+
+    /**
+     * Elasticsearch database read and write for specific class, defined by opendaylight yang-tools.
+     *
+     * @param db Database access client
+     * @param dataTypeName typename in database schema
+     * @param clazz class of type to be handled
+     * @throws ClassNotFoundException
+     */
+    public <X extends T, @NonNull B extends Builder<X>> EsDataObjectReaderWriter2(DatabaseClient db, Entity dataTypeName, @Nonnull Class<T> clazz, @Nullable  Class<B> builderClazz) throws ClassNotFoundException {
+        this(db, dataTypeName.getName(), clazz, builderClazz);
+    }
+    public <X extends T, @NonNull B extends Builder<X>> EsDataObjectReaderWriter2(DatabaseClient db, Entity dataTypeName, @Nonnull Class<T> clazz) throws ClassNotFoundException {
+        this(db, dataTypeName.getName(), clazz, null);
+    }
+    public <X extends T, @NonNull  B extends Builder<X>> EsDataObjectReaderWriter2(DatabaseClient db, String dataTypeName, @Nonnull Class<T> clazz, @Nullable Class<B>  builderClazz) throws ClassNotFoundException {
+        LOG.info("Create {} for datatype {} class {}", this.getClass().getName(), dataTypeName, clazz.getName());
+
+        this.esIdAddAtributteName = null;
+        this.field = null;
+        this.writeInterfaceClazz = clazz;
+        this.db = db;
+        this.dataTypeName = dataTypeName;
+        this.yangtoolsMapper = new YangToolsMapper2<>(clazz, builderClazz);
+        this.clazz = clazz;
+    }
+
+    /**
+     * Simlar to {@link #setEsIdAttributeName()}, but adapts the parameter to yangtools attribute naming schema
+     * @param esIdAttributeName is converted to UnderscoreCamelCase
+     * @return this for further operations.
+     */
+    public EsDataObjectReaderWriter2<T> setEsIdAttributeNameCamelized(String esIdAttributeName) {
+        return setEsIdAttributeName(YangToolsMapper.toCamelCaseAttributeName(esIdAttributeName));
+    }
+
+    /**
+     * Attribute name of class that is containing the object id
+     * @param esIdAttributeName of the implementation class for the yangtools interface.
+     *        Expected attribute name format is CamelCase with leading underline. @
+     * @return this for further operations.
+     * @throws SecurityException if no access or IllegalArgumentException if wrong type or no attribute with this name.
+     */
+    public EsDataObjectReaderWriter2<T> setEsIdAttributeName(String esIdAttributeName) {
+        LOG.debug("Set attribute '{}'", esIdAttributeName);
+        this.esIdAddAtributteName = null; // Reset status
+        this.field = null;
+
+        Field attributeField;
+        try {
+            Builder<T> builder = yangtoolsMapper.getBuilder(clazz);
+            if (builder == null) {
+                String msg = "No builder for " + clazz;
+                LOG.debug(msg);
+                throw new IllegalArgumentException(msg);
+            } else {
+                T object = builder.build();
+                attributeField = object.getClass().getDeclaredField(esIdAttributeName);
+                if (attributeField.getType().equals(String.class)) {
+                    attributeField.setAccessible(true);
+                    this.esIdAddAtributteName = esIdAttributeName; // Set new status if everything OK
+                    this.field = attributeField;
+                } else {
+                    String msg = "Wrong field type " + attributeField.getType().getName() + " of " + esIdAttributeName;
+                    LOG.debug(msg);
+                    throw new IllegalArgumentException(msg);
+                }
+            }
+        } catch (NoSuchFieldException e) {
+            // Convert to run-time exception
+            String msg = "NoSuchFieldException for '" + esIdAttributeName + "' in class " + clazz.getName();
+            LOG.debug(msg);
+            throw new IllegalArgumentException(msg);
+        } catch (SecurityException e) {
+            LOG.debug("Access problem "+esIdAttributeName,e);
+            throw e;
+        }
+        return this;
+    }
+
+    /**
+     * Specify subclass of T for write operations.
+     * @param writeInterfaceClazz
+     */
+    public EsDataObjectReaderWriter2<T> setWriteInterface( @Nonnull Class<? extends DataObject> writeInterfaceClazz ) {
+        LOG.debug("Set write interface to {}", writeInterfaceClazz);
+        if (writeInterfaceClazz == null) {
+            throw new IllegalArgumentException("Null not allowed here.");
+        }
+
+        this.writeInterfaceClazz = writeInterfaceClazz;
+        return this;
+    }
+
+    public interface IdGetter<S extends DataObject> {
+        String getId(S object);
+    }
+
+    public <S extends DataObject> void write(List<S> objectList, IdGetter<S> idGetter) {
+        for (S object : objectList) {
+            write(object, idGetter.getId(object));
+        }
+    }
+
+    /**
+     * Write child object to database with specific id
+     * @param object to be written
+     * @param esId use the id or if null generate unique id
+     * @return String with id or null
+     */
+    public @Nullable <S extends DataObject> String write( S object, @Nullable String esId) {
+        if (object != null && writeInterfaceClazz.isInstance(object)) {
+            try {
+                String json = yangtoolsMapper.writeValueAsString(object);
+                return db.doWriteRaw(dataTypeName, esId, json);
+            } catch (JsonProcessingException e) {
+                LOG.error("Write problem: ", e);
+            }
+        } else {
+            LOG.error("Type {} does not provide interface {}", object!=null?object.getClass().getName():"null",
+                    writeInterfaceClazz.getName());
+        }
+        return null;
+    }
+    /**
+     * Update partial child object to database with match/term query
+     * @param <S> of object
+     * @param object to write
+     * @param query for write of specific attributes
+     * @return json string with new Object
+     */
+    public @Nullable <S extends DataObject> String update(S object, QueryBuilder query) {
+        if (object != null && writeInterfaceClazz.isInstance(object)) {
+            try {
+                String json = yangtoolsMapper.writeValueAsString(object);
+                return db.doUpdate(this.dataTypeName,json,query);
+            } catch (JsonProcessingException e) {
+                LOG.error("Update problem: ", e);
+            }
+        } else {
+            LOG.error("Type {} does not provide interface {}", object!=null?object.getClass().getName():"null",
+                    writeInterfaceClazz.getName());
+        }
+        return null;
+    }
+    /**
+     * Write/ update partial child object to database with specific id Write if not
+     * exists, else update
+     * @param object
+     * @param esId
+     * @return String with esId or null
+     */
+    public @Nullable <S extends DataObject> String update(S object, String esId) {
+        return this.updateOrCreate(object, esId,null);
+    }
+    /**
+     * See {@link doUpdateOrCreate(String dataTypeName, String esId, String json, List<String> doNotUpdateField) }
+     */
+    public @Nullable <S extends DataObject> String updateOrCreate(S object, String esId,List<String> onlyForInsert) {
+        if (object != null && writeInterfaceClazz.isInstance(object)) {
+            try {
+                String json = yangtoolsMapper.writeValueAsString(object);
+                return db.doUpdateOrCreate(dataTypeName, esId, json,onlyForInsert);
+            } catch (JsonProcessingException e) {
+                LOG.error("Update problem: ", e);
+            }
+        } else {
+            LOG.error("Type {} does not provide interface {}", object!=null?object.getClass().getName():"null",
+                    writeInterfaceClazz.getName());
+        }
+        return null;
+    }
+
+    /**
+     * Read object from database, by using the id field
+     * @param object
+     * @return
+     */
+    public @Nullable T read(String esId) {
+        @Nullable
+        T res = null;
+        if (esId != null) {
+            String json = db.doReadJsonData(dataTypeName, esId);
+            if (json != null) {
+                try {
+                    res = yangtoolsMapper.readValue(json.getBytes(), clazz);
+                } catch (IOException e) {
+                    LOG.error("Problem: ", e);
+                }
+            } else {
+                LOG.debug("Can not read from DB id {} type {}", esId, dataTypeName);
+            }
+        }
+        return res;
+    }
+
+    /**
+     * Remove object
+     * @param esId to identify the object.
+     * @return success
+     */
+    public boolean remove(String esId) {
+        return db.doRemove(this.dataTypeName, esId);
+    }
+
+    public int remove(QueryBuilder query) {
+        return this.db.doRemove(this.dataTypeName, query);
+    }
+    /**
+     * Get all elements of related type
+     * @return all Elements
+     */
+    public SearchResult<T> doReadAll() {
+        return doReadAll(null);
+    }
+    public SearchResult<T> doReadAll(QueryBuilder query) {
+        return this.doReadAll(query,false);
+    }
+    /**
+     * Read all existing objects of a type
+     * @param query for the elements
+     * @return the list of all objects
+     */
+
+    public SearchResult<T> doReadAll(QueryBuilder query, boolean ignoreException) {
+
+        SearchResult<T> res = new SearchResult<>();
+        int idx = 0;                //Idx for getAll
+        int iterateLength = 100;    //Step width for iterate
+
+        SearchResult<SearchHit> result;
+        List<SearchHit> hits;
+        do {
+            if(query!=null) {
+                LOG.debug("read data in {} with query {}",dataTypeName,query.toJSON());
+                result=db.doReadByQueryJsonData( dataTypeName, query,ignoreException);
+            }
+            else {
+                result = db.doReadAllJsonData(dataTypeName,ignoreException);
+            }
+            hits=result.getHits();
+            LOG.debug("Read: {} elements: {}  Failures: {}",dataTypeName,hits.size(), yangtoolsMapper.getMappingFailures());
+
+            T object;
+            idx += result.getHits().size();
+            for (SearchHit hit : hits) {
+                object = getT(hit.getSourceAsString());
+                LOG.debug("Mapp Object: {}\nSource: '{}'\nResult: '{}'\n Failures: {}", hit.getId(),
+                        hit.getSourceAsString(), object, yangtoolsMapper.getMappingFailures());
+                if (object != null) {
+                    setEsId(object, hit.getId());
+                    res.add(object);
+                } else {
+                    LOG.warn("Mapp result null Object: {}\n Source: '{}'\n : '", hit.getId(), hit.getSourceAsString());
+                }
+            }
+
+        } while (hits.size() == iterateLength); // Do it until end indicated, because less hits than iterateLength
+                                                // allows.
+        res.setTotal(result.getTotal());
+        return res;
+    }
+
+    /* ---------------------------------------------
+     * Private functions
+     */
+
+    private void setEsId(T object, String esId) {
+        if (field != null) {
+            try {
+                field.set(object, esId);
+            } catch (IllegalArgumentException | IllegalAccessException e) {
+                LOG.debug("Field set problem.", e);            }
+        }
+    }
+
+    private @Nullable T getT(String jsonString) {
+        try {
+            return yangtoolsMapper.readValue( jsonString, clazz );
+        } catch (IOException e) {
+            LOG.info("Mapping problem", e);
+            return null;
+        }
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/AboutHttpServlet.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/AboutHttpServlet.java
new file mode 100644
index 0000000..6c5ed0d
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/AboutHttpServlet.java
@@ -0,0 +1,344 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.http;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.ccsdk.features.sdnr.wt.common.Resources;
+import org.onap.ccsdk.features.sdnr.wt.common.file.PomFile;
+import org.onap.ccsdk.features.sdnr.wt.common.file.PomPropertiesFile;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.ODLVersionLUT;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.SystemInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AboutHttpServlet extends HttpServlet {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private static final Logger LOG = LoggerFactory.getLogger(AboutHttpServlet.class);
+	private static final String UNKNOWN = "unknown";
+	private static final String METAINF_MAVEN = "/META-INF/maven/";
+	private static final String EXCEPTION_FORMAT_UNABLE_TO_READ_INNER_POMFILE = "unable to read inner pom file: {}";
+
+	private static final String URI_PRE = "/about";
+	private static final String RES_BASEPATH = "about/";
+
+	private static final String PLACEHOLDER_ONAP_RELEASENAME = "{release-name}";
+	private static final String PLACEHOLDER_ONAP_RELEASEVERSION = "{release-version}";
+	private static final String PLACEHOLDER_ODL_RELEASENAME = "{odl-version}";
+	private static final String PLACEHOLDER_BUILD_TIMESTAMP = "{build-time}";
+	private static final String PLACEHOLDER_ODLUX_REVISION = "{odlux-revision}";
+	private static final String PLACEHOLDER_PACKAGE_GITHASH = "{package-githash}";
+	private static final String PLACEHOLDER_PACAKGE_VERSION = "{package-version}";
+	private static final String PLACEHOLDER_CCSDK_VERSION = "{ccsdk-version}";
+	private static final String PLACEHOLDER_CLUSTER_SIZE = "{cluster-size}";
+	private static final String PLACEHOLDER_MDSAL_VERSION = "{mdsal-version}";
+	private static final String PLACEHOLDER_YANGTOOLS_VERSION = "{yangtools-version}";
+	private static final String PLACEHOLDER_KARAF_INFO = "{karaf-info}";
+	private static final String README_FILE = "README.md";
+
+	private final String groupId = "org.onap.ccsdk.features.sdnr.wt";
+	private final String artifactId = "sdnr-wt-data-provider-provider";
+
+	private final Map<String, String> data;
+	private final String readmeContent;
+
+	public AboutHttpServlet() {
+
+		this.data = new HashMap<>();
+		this.collectStaticData();
+		this.readmeContent = this.render(this.getResourceFileContent(README_FILE));
+	}
+
+	/**
+	 * collect static versioning data 
+	 */
+	private void collectStaticData() {
+		PomPropertiesFile props = this.getPomProperties();
+		final String ccsdkVersion = this.getPomParentVersion();
+		this.data.put(PLACEHOLDER_ONAP_RELEASENAME, ODLVersionLUT.getONAPReleaseName(ccsdkVersion, UNKNOWN));
+		this.data.put(PLACEHOLDER_ODL_RELEASENAME, ODLVersionLUT.getOdlVersion(ccsdkVersion, UNKNOWN));
+		this.data.put(PLACEHOLDER_BUILD_TIMESTAMP, props != null ? props.getBuildDate().toString() : "");
+		this.data.put(PLACEHOLDER_ODLUX_REVISION, this.getPomProperty("odlux.buildno"));
+		this.data.put(PLACEHOLDER_PACAKGE_VERSION, this.getManifestValue("Bundle-Version"));
+		this.data.put(PLACEHOLDER_CCSDK_VERSION, ccsdkVersion);
+		this.data.put(PLACEHOLDER_ONAP_RELEASEVERSION, "1.8.1-SNAPSHOT");
+		this.data.put(PLACEHOLDER_MDSAL_VERSION, SystemInfo.getMdSalVersion(UNKNOWN));
+		this.data.put(PLACEHOLDER_YANGTOOLS_VERSION, SystemInfo.getYangToolsVersion(UNKNOWN));
+		this.data.put(PLACEHOLDER_PACKAGE_GITHASH, this.getGitHash(UNKNOWN));
+	}
+
+	@Override
+	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+
+		String uri = req.getRequestURI().substring(URI_PRE.length());
+		LOG.debug("request for {}", uri);
+		if (uri.length() <= 0 || uri.equals("/")) {
+			// collect data
+			this.collectData();
+			// render readme
+			String content = this.render();
+			byte[] output = content != null ? content.getBytes() : new byte[0];
+			// output
+			resp.setStatus(HttpServletResponse.SC_OK);
+			resp.setContentLength(output.length);
+			resp.setContentType("text/plain");
+			ServletOutputStream os = null;
+			try{
+				os = resp.getOutputStream();
+				os.write(output);
+			}
+			catch(IOException e) {
+				LOG.warn("problem writing response for {}: {}",uri,e);
+			}
+			finally {
+				if(os!=null) {
+					try{
+						os.close();
+					}
+					catch(IOException e) {
+						LOG.warn("problem closing response stream: {}",e);
+					}
+				}
+			}
+
+		} else {
+			this.doGetFile(uri, resp);
+		}
+	}
+
+	/**
+	 * load git.commit.id from jar /META-INF/git.properties
+	 * 
+	 * @param def
+	 */
+	private String getGitHash(String def) {
+		String content = Resources.getFileContent(AboutHttpServlet.class, "/META-INF/git.properties");
+		if (content == null) {
+			return def;
+		}
+		String lines[] = content.split("\n");
+		for (String line : lines) {
+			if (line.startsWith("git.commit.id")) {
+				def = line.substring("git.commit.id=".length());
+				break;
+			}
+		}
+		return def;
+	}
+
+	private String getResourceFileContent(String filename) {
+		LOG.debug("try ti get content of {}", filename);
+		return Resources.getFileContent(AboutHttpServlet.class, RES_BASEPATH + filename);
+	}
+
+	/**
+	 * collect dynamic data for about.md
+	 */
+	private void collectData() {
+		LOG.info("collecting dynamic data");
+		try {
+			this.data.put(PLACEHOLDER_KARAF_INFO, SystemInfo.get());
+		} catch (Exception e) {
+			LOG.warn("problem collecting system data: {}", e);
+		}
+	}
+
+	/**
+	 * get value for key out of /META-INF/MANIFEST.MF
+	 * @param key
+	 * @return
+	 */
+	private String getManifestValue(String key) {
+		URL url = Resources.getUrlForRessource(AboutHttpServlet.class, "/META-INF/MANIFEST.MF");
+		if (url == null) {
+			return null;
+		}
+		Manifest manifest;
+		try {
+			manifest = new Manifest(url.openStream());
+			Attributes attr = manifest.getMainAttributes();
+			return attr.getValue(key);
+		} catch (IOException e) {
+			LOG.warn("problem reading manifest: {}", e);
+		}
+		return null;
+
+	}
+	/**
+	 * get object representation of /META-INF/maven/groupId/artifactId/pom.properties
+	 * @return
+	 */
+	private PomPropertiesFile getPomProperties() {
+		URL url = Resources.getUrlForRessource(AboutHttpServlet.class,
+				METAINF_MAVEN + groupId + "/" + artifactId + "/pom.properties");
+		PomPropertiesFile propfile;
+		if (url == null) {
+			return null;
+		}
+		try {
+			propfile = new PomPropertiesFile(url.openStream());
+			return propfile;
+		} catch (Exception e) {
+			LOG.warn(EXCEPTION_FORMAT_UNABLE_TO_READ_INNER_POMFILE, e);
+		}
+		return null;
+	}
+	/**
+	 * get value for key out of /META-INF/maven/groupId/artifactId/pom.xml in properties section
+	 * @param key
+	 * @return
+	 */
+	private String getPomProperty(String key) {
+		LOG.info("try to get pom property for {}", key);
+		URL url = Resources.getUrlForRessource(AboutHttpServlet.class,
+				METAINF_MAVEN + groupId + "/" + artifactId + "/pom.xml");
+		if (url == null) {
+			return null;
+		}
+		PomFile pomfile;
+		try {
+			pomfile = new PomFile(url.openStream());
+			return pomfile.getProperty(key);
+		} catch (Exception e) {
+			LOG.warn(EXCEPTION_FORMAT_UNABLE_TO_READ_INNER_POMFILE, e);
+		}
+		return null;
+	}
+	/**
+	 * get parent pom version out of /META-INF/maven/groupId/artifactId/pom.xml 
+	 * @return
+	 */
+	private String getPomParentVersion() {
+		LOG.info("try to get pom parent version");
+		URL url = Resources.getUrlForRessource(AboutHttpServlet.class,
+				METAINF_MAVEN + groupId + "/" + artifactId + "/pom.xml");
+		if (url == null) {
+			return null;
+		}
+		PomFile pomfile;
+		try {
+			pomfile = new PomFile(url.openStream());
+			return pomfile.getParentVersion();
+		} catch (Exception e) {
+			LOG.warn(EXCEPTION_FORMAT_UNABLE_TO_READ_INNER_POMFILE, e);
+		}
+		return null;
+	}
+
+	/**
+	 * get file by uri from resources and write out to response stream 
+	 * @param uri
+	 * @param resp
+	 */
+	private void doGetFile(String uri, HttpServletResponse resp) {
+		String content = this.getResourceFileContent(uri);
+		if (content == null) {
+			try {
+				resp.sendError(HttpServletResponse.SC_NOT_FOUND);
+			} catch (IOException e) {
+				LOG.debug("unable to send error response : {}", e);
+			}
+		} else {
+			byte[] data = content.getBytes();
+			resp.setStatus(HttpServletResponse.SC_OK);
+			resp.setContentType(this.getContentType(uri));
+			try {
+				resp.getOutputStream().write(data);
+			} catch (IOException e) {
+				LOG.debug("unable to send data : {}", e);
+			}
+		}
+
+	}
+
+	/**
+	 * create http response contentType by filename
+	 * @param filename
+	 * @return
+	 */
+	private String getContentType(String filename) {
+		String ext = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();
+		switch (ext) {
+		case "jpg":
+		case "jpeg":
+		case "svg":
+		case "png":
+		case "gif":
+		case "bmp":
+			return "image/" + ext;
+		case "json":
+			return "application/json";
+		case "html":
+		case "htm":
+			return "text/html";
+		case "txt":
+		case "md":
+		default:
+			return "text/plain";
+		}
+	}
+
+	/**
+	 * render this.readmeContent with this.data
+	 * @return
+	 */
+	private String render() {
+		return this.render(null);
+	}
+
+	/**
+	 * render content with this.data
+	 * @param content
+	 * @return
+	 */
+	private String render(String content) {
+		if (content == null) {
+			content = this.readmeContent;
+		}
+		if (content == null) {
+			return null;
+		}
+		for (Entry<String, String> entry : this.data.entrySet()) {
+			if (entry.getValue() != null && content.contains(entry.getKey())) {
+				content = content.replace(entry.getKey(), entry.getValue());
+			}
+		}
+
+		return content;
+	}
+
+	public void setClusterSize(String value) {
+		this.data.put(PLACEHOLDER_CLUSTER_SIZE, value);
+	}
+}
\ No newline at end of file
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/GetYangSchemaRequest.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/GetYangSchemaRequest.java
new file mode 100644
index 0000000..db4faed
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/GetYangSchemaRequest.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.http;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class GetYangSchemaRequest {
+
+	private static final String URI_PREFIX = "/yang-schema/";
+	private final String module;
+	private final String version;
+
+	public String getModule() {
+		return this.module;
+	}
+
+	public String getVersion() {
+		return this.version;
+	}
+
+	public boolean hasVersion() {
+		return this.version != null;
+	}
+
+	public GetYangSchemaRequest(HttpServletRequest req) throws Exception {
+		String uri = req.getRequestURI().substring(URI_PREFIX.length());
+
+		String[] hlp = uri.split("/");
+		if (hlp.length < 1) {
+			throw new Exception("no module request found");
+
+		} else if (hlp.length == 1) {
+			this.module = hlp[0];
+			this.version = null;
+		} else {
+			this.module = hlp[0];
+			this.version = hlp[1];
+		}
+
+	}
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/MsServlet.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/MsServlet.java
new file mode 100644
index 0000000..cdcbb49
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/MsServlet.java
@@ -0,0 +1,102 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : CCSDK.apps.sdnr.wt.apigateway
+ * ================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property.
+ * All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.http;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.ccsdk.features.sdnr.wt.common.http.BaseServlet;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.MediatorServerDataProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MsServlet extends BaseServlet {
+
+	/**
+	 *
+	 */
+	private static Logger LOG = LoggerFactory.getLogger(MsServlet.class);
+	private static final long serialVersionUID = -5361461082028405171L;
+	private static final String OFFLINE_RESPONSE_MESSAGE = "MediatorServer interface is offline";
+	private static boolean trustAll = false;
+	private MediatorServerDataProvider entryProvider;
+	public MsServlet() {
+		super(false);
+	}
+
+	@Override
+	protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+		resp.setStatus(200);
+	}
+	@Override
+	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+		super.doGet(req, resp);
+	}
+	@Override
+	protected String getOfflineResponse() {
+		return OFFLINE_RESPONSE_MESSAGE;
+	}
+
+	public void triggerReloadDatabaseEntries() {
+		LOG.debug("external reload triggered");
+		this.entryProvider.triggerReloadSync();
+	}
+
+	@Override
+	protected boolean isOff() {
+		return false;
+	}
+
+	@Override
+	protected String getRemoteUrl(String uri) {
+		String dbServerId = "0";
+		if (uri == null)
+			uri = "";
+		if (uri.length() > 0) {
+			uri = uri.substring("/ms/".length());
+			int idx= uri.indexOf("/");
+			dbServerId = uri.substring(0,idx);
+			uri=uri.substring(idx);
+		}
+		LOG.debug("request for ms server with id={}",dbServerId);
+		String url= this.getBaseUrl(dbServerId) + uri;
+		LOG.debug("dest-url: {}",url);
+		return url;
+	}
+
+	protected String getBaseUrl(String dbServerId) {
+		return this.entryProvider.getHostUrl(dbServerId);
+	}
+	@Override
+	protected boolean doTrustAll() {
+		return trustAll;
+	}
+	@Override
+	protected void trustAll(boolean trust) {
+		trustAll = trust;
+	}
+
+	public void setDataProvider(MediatorServerDataProvider mediatorServerDataProvider) {
+		this.entryProvider = mediatorServerDataProvider;
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/ReadyHttpServlet.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/ReadyHttpServlet.java
new file mode 100644
index 0000000..96a6fc1
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/ReadyHttpServlet.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.http;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ReadyHttpServlet extends HttpServlet {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private static final Logger LOG = LoggerFactory.getLogger(ReadyHttpServlet.class);
+	private static boolean status;
+
+	@Override
+	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+	
+		if(isReady()) {
+			resp.setStatus(HttpServletResponse.SC_OK);
+		}
+		else {
+		
+			try {
+				resp.sendError(HttpServletResponse.SC_NOT_FOUND);
+			}catch(IOException | IllegalStateException e) {
+				LOG.warn("unable to write out 404 res not found: {}",e);
+			}
+		}
+	}
+
+	private static boolean isReady() {
+		return status;
+	}
+
+	public static void setStatus(boolean s) {
+		status = s;
+		LOG.info("status is set to ready: {}",status);
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/YangSchemaHttpServlet.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/YangSchemaHttpServlet.java
new file mode 100644
index 0000000..1cb3865
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/YangSchemaHttpServlet.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.http;
+
+import java.io.IOException;
+import java.text.ParseException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.YangFileProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class YangSchemaHttpServlet extends HttpServlet {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private static final Logger LOG = LoggerFactory.getLogger(YangSchemaHttpServlet.class);
+
+	private static final String schemaCachePath = "cache/schema/";
+
+	private final YangFileProvider fileProvider;
+
+	public YangSchemaHttpServlet() {
+		this.fileProvider = new YangFileProvider(schemaCachePath);
+	}
+
+	@Override
+	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+
+		GetYangSchemaRequest request = null;
+		try {
+			request = new GetYangSchemaRequest(req);
+		} catch (Exception e) {
+			LOG.warn("bad request for yang-schema: {}", e);
+		}
+		if (request != null) {
+			int len;
+			LOG.debug("request for yang-schema for module {} with version {}", request.getModule(),
+					request.getVersion());
+			if (request.hasVersion()) {
+				boolean has=false;
+				try {
+					has = this.fileProvider.hasFileOrNewerForModule(request.getModule(), request.getVersion());
+				} catch (ParseException e1) {
+					LOG.warn("unable to parse revision: {}" ,e1);
+				}
+				if(has) {
+
+					try {
+						resp.setStatus(HttpServletResponse.SC_OK);
+						resp.setContentType("text/plain");
+						len = this.fileProvider.writeOutput(request.getModule(), request.getVersion(),
+								resp.getOutputStream());
+						resp.setContentLength(len);
+						
+					} catch (ParseException e) {
+						LOG.warn("unable to parse revision: {}", e);
+					}catch (IOException | IllegalStateException e) {
+						LOG.warn("unable to write out module {}@{}: {}",request.getModule(), request.getVersion(), e);
+					}
+				} else {
+					try {
+						resp.sendError(HttpServletResponse.SC_NOT_FOUND);
+					}catch(IOException | IllegalStateException e) {
+						LOG.warn("unable to write out 404 res not found: {}",e);
+					}
+				}
+
+			} else if (this.fileProvider.hasFileForModule(request.getModule())) {
+
+				try {
+					resp.setStatus(HttpServletResponse.SC_OK);
+					resp.setContentType("text/plain");
+					len = this.fileProvider.writeOutput(request.getModule(), null, resp.getOutputStream());
+					resp.setContentLength(len);
+				} catch (ParseException e) {
+					LOG.warn(e.getMessage());
+				}catch(IOException | IllegalStateException e) {
+					LOG.warn("unable to write out module {}: {}",request.getModule(), e);
+				}
+
+			} else {
+				try {
+					resp.sendError(HttpServletResponse.SC_NOT_FOUND);
+				}catch(IOException | IllegalStateException e) {
+					LOG.warn("unable to write out 404 res not found: {}",e);
+				}
+			}
+		} else {
+			try {
+				resp.sendError(HttpServletResponse.SC_BAD_REQUEST);
+			}catch(IOException | IllegalStateException e) {
+				LOG.warn("unable to write out 400 bad request: {}",e);
+			}
+		}
+
+	}
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderImpl.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderImpl.java
new file mode 100644
index 0000000..e29e7f4
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderImpl.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.impl;
+
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.AboutHttpServlet;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.MsServlet;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.ReadyHttpServlet;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.IEntityDataProvider;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.IEsConfig;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.StatusChangedHandler.StatusKey;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataProviderImpl implements IEntityDataProvider, AutoCloseable {
+
+    private static final Logger LOG = LoggerFactory.getLogger(DataProviderImpl.class);
+
+    private static final String APPLICATION_NAME = "data-provider";
+    private RpcProviderService rpcProviderService = null;
+    private MsServlet mediatorServerServlet;
+    private DataProviderServiceImpl rpcApiService;
+    private AboutHttpServlet aboutServlet;
+    private HtDatabaseClient dbClient;
+
+
+    // Blueprint 1
+    public DataProviderImpl() {
+        super();
+        LOG.info("Creating provider for {}", APPLICATION_NAME);
+    }
+
+    public void setRpcProviderService(RpcProviderService rpcProviderService) {
+        this.rpcProviderService = rpcProviderService;
+    }
+    public void setMediatorServerServlet(MsServlet servlet) {
+        this.mediatorServerServlet = servlet;
+    }
+    public void setAboutServlet(AboutHttpServlet aboutServlet) {
+        this.aboutServlet = aboutServlet;
+    }
+    public void init() throws Exception {
+
+        LOG.info("Session Initiated start {}", APPLICATION_NAME);
+
+        // Start RPC Service
+        this.rpcApiService = new DataProviderServiceImpl(rpcProviderService,this.mediatorServerServlet);
+        // Get configuration
+
+        LOG.info("Session Initiated end. Initialization done");
+    }
+
+    @Override
+    public void close() throws Exception {
+        LOG.info("DeviceManagerImpl closing ...");
+
+        close(dbClient);
+        close(rpcApiService);
+        LOG.info("DeviceManagerImpl closing done");
+    }
+
+    /**
+     * Used to close all Services, that should support AutoCloseable Pattern
+     *
+     * @param toClose
+     * @throws Exception
+     */
+    private void close(AutoCloseable... toCloseList) throws Exception {
+        for (AutoCloseable element : toCloseList) {
+            if (element != null) {
+                element.close();
+            }
+        }
+    }
+
+    @Override
+    public DataProvider getDataProvider() {
+        return rpcApiService.getDataProvider();
+    }
+
+    @Override
+    public HtDatabaseMaintenance getHtDatabaseMaintenance() {
+        return rpcApiService.getHtDatabaseMaintenance();
+    }
+
+    @Override
+    public IEsConfig getEsConfig() {
+        return rpcApiService.getEsConfig();
+    }
+
+    @Override
+    public NetconfTimeStamp getConverter() {
+        return NetconfTimeStampImpl.getConverter();
+    }
+
+    @Override
+    public void setReadyStatus(boolean status) {
+            ReadyHttpServlet.setStatus(status);
+    }
+
+    @Override
+    public void setStatus(StatusKey key, String value) {
+        if(this.aboutServlet!=null) {
+            if(key==StatusKey.CLUSTER_SIZE) {
+                this.aboutServlet.setClusterSize(value);
+            }
+        }
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java
new file mode 100644
index 0000000..c20263c
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java
@@ -0,0 +1,360 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.impl;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.ElasticSearchDataProvider;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.MediatorServerDataProvider;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.MsServlet;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.HtDatabaseMaintenance;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.IEsConfig;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DataProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadStatusInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadStatusOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionOutput;
+import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+public class DataProviderServiceImpl implements DataProviderService, AutoCloseable {
+
+    private static final Logger LOG = LoggerFactory.getLogger(DataProviderServiceImpl.class);
+    public static final String CONFIGURATIONFILE = "etc/dataprovider.properties";
+    private static final long DATABASE_TIMEOUT_MS = 120*1000L;
+
+    private final ObjectRegistration<@NonNull DataProviderServiceImpl> rpcReg;
+    private final ElasticSearchDataProvider dataProvider;
+    private final ConfigurationFileRepresentation configuration;
+    private final EsConfig esConfig;
+	private final MediatorServerDataProvider mediatorServerDataProvider;
+
+    DataProviderServiceImpl(final RpcProviderService rpcProviderService,MsServlet mediatorServerServlet) throws Exception {
+        this.configuration = new ConfigurationFileRepresentation(CONFIGURATIONFILE);
+        this.esConfig = new EsConfig(configuration);
+        this.dataProvider = new ElasticSearchDataProvider(esConfig.getHosts(),esConfig.getBasicAuthUsername(),esConfig.getBasicAuthPassword());
+        this.dataProvider.waitForYellowDatabaseStatus(DATABASE_TIMEOUT_MS,TimeUnit.MILLISECONDS);
+        this.mediatorServerDataProvider = new MediatorServerDataProvider(esConfig.getHosts(),esConfig.getBasicAuthUsername(),esConfig.getBasicAuthPassword());
+        mediatorServerServlet.setDataProvider(this.mediatorServerDataProvider);
+        // Register ourselves as the REST API RPC implementation
+        LOG.info("Register RPC Service " + DataProviderServiceImpl.class.getSimpleName());
+        this.rpcReg = rpcProviderService.registerRpcImplementation(DataProviderService.class, this);
+    }
+    private void sendResyncCallbackToApiGateway() {
+    	mediatorServerDataProvider.triggerReloadSync();
+    }
+    /**
+     * @return dataProvider
+     */
+    public DataProvider getDataProvider() {
+        return dataProvider.getDataProvider();
+    }
+
+    /**
+     * @return data provider for Maintenance()
+     */
+    public HtDatabaseMaintenance getHtDatabaseMaintenance() {
+        return dataProvider.getHtDatabaseMaintenance();
+    }
+
+    /**
+     * @return configuration object
+     */
+    public IEsConfig getEsConfig() {
+        return esConfig;
+    }
+
+
+    @Override
+    public void close() throws Exception {
+        LOG.info("Close RPC Service");
+        if (rpcReg != null) {
+            rpcReg.close();
+        }
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadFaultcurrentListOutput>> readFaultcurrentList(ReadFaultcurrentListInput input) {
+        LOG.debug("RPC Request: getFaultCurrentEntityList with input {}", input);
+        RpcResultBuilder<ReadFaultcurrentListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readFaultCurrentList(input));
+        return result.buildFuture();
+    }
+    @Override
+    public ListenableFuture<RpcResult<ReadFaultlogListOutput>> readFaultlogList(ReadFaultlogListInput input) {
+        LOG.debug("RPC Request: getFaultCurrentEntityList with input {}", input);
+        RpcResultBuilder<ReadFaultlogListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readFaultLogList(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadMaintenanceListOutput>> readMaintenanceList(ReadMaintenanceListInput input) {
+        LOG.debug("RPC Request: getMaintenanceEntityList with input {}", input);
+        RpcResultBuilder<ReadMaintenanceListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readMaintenanceList(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadMediatorServerListOutput>> readMediatorServerList(
+            ReadMediatorServerListInput input) {
+        LOG.debug("RPC Request: getMediatorServerEntityList with input {}", input);
+        RpcResultBuilder<ReadMediatorServerListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readMediatorServerList(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadNetworkElementConnectionListOutput>> readNetworkElementConnectionList(
+            ReadNetworkElementConnectionListInput input) {
+        LOG.debug("RPC Request: getNetworkElementConnectionEntityList with input {}", input);
+        RpcResultBuilder<ReadNetworkElementConnectionListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readNetworkElementConnectionList(input));
+        return result.buildFuture();
+
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadPmdata15mListOutput>> readPmdata15mList(ReadPmdata15mListInput input) {
+        LOG.debug("RPC Request: getNetworkElementConnectionEntityList with input {}", input);
+        RpcResultBuilder<ReadPmdata15mListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readPmdata15mList(input));
+        return result.buildFuture();
+
+    }
+    @Override
+    public ListenableFuture<RpcResult<ReadPmdata24hListOutput>> readPmdata24hList(ReadPmdata24hListInput input) {
+        LOG.debug("RPC Request: getNetworkElementConnectionEntityList with input {}", input);
+        RpcResultBuilder<ReadPmdata24hListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readPmdata24hList(input));
+        return result.buildFuture();
+
+    }
+    @Override
+    public ListenableFuture<RpcResult<ReadStatusOutput>> readStatus(ReadStatusInput input) {
+        LOG.debug("RPC Request: getStatusEntityList with input {}", input);
+        RpcResultBuilder<ReadStatusOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readStatus());
+        return result.buildFuture();
+
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadInventoryListOutput>> readInventoryList(ReadInventoryListInput input) {
+        LOG.debug("RPC Request: getInventoryEntityList with input {}", input);
+        RpcResultBuilder<ReadInventoryListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readInventoryList(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadPmdata15mLtpListOutput>> readPmdata15mLtpList(ReadPmdata15mLtpListInput input) {
+        LOG.debug("RPC Request: readPmdataLtpList with input {}", input);
+        RpcResultBuilder<ReadPmdata15mLtpListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readPmdata15mLtpList(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadPmdata15mDeviceListOutput>> readPmdata15mDeviceList(ReadPmdata15mDeviceListInput input) {
+            LOG.debug("RPC Request: readPmdataDeviceList with input {}", input);
+            RpcResultBuilder<ReadPmdata15mDeviceListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readPmdata15mDeviceList(input));
+            return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadPmdata24hLtpListOutput>> readPmdata24hLtpList(ReadPmdata24hLtpListInput input) {
+        LOG.debug("RPC Request: readPmdataLtpList with input {}", input);
+        RpcResultBuilder<ReadPmdata24hLtpListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readPmdata24hLtpList(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadPmdata24hDeviceListOutput>> readPmdata24hDeviceList(ReadPmdata24hDeviceListInput input) {
+            LOG.debug("RPC Request: readPmdataDeviceList with input {}", input);
+            RpcResultBuilder<ReadPmdata24hDeviceListOutput> result = read(()-> DataProviderServiceImpl.this.dataProvider.readPmdata24hDeviceList(input));
+            return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadConnectionlogListOutput>> readConnectionlogList(
+            ReadConnectionlogListInput input) {
+        LOG.debug("RPC Request: readConnectionlogList with input {}", input);
+        RpcResultBuilder<ReadConnectionlogListOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.readConnectionlogList(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<CreateNetworkElementConnectionOutput>> createNetworkElementConnection(
+            CreateNetworkElementConnectionInput input) {
+        LOG.debug("RPC Request: createNetworkElementConnection with input {}", input);
+        RpcResultBuilder<CreateNetworkElementConnectionOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.createNetworkElementConnection(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<UpdateNetworkElementConnectionOutput>> updateNetworkElementConnection(
+            UpdateNetworkElementConnectionInput input) {
+        LOG.debug("RPC Request: updateNetworkElementConnection with input {}", input);
+        RpcResultBuilder<UpdateNetworkElementConnectionOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.updateNetworkElementConnection(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<DeleteNetworkElementConnectionOutput>> deleteNetworkElementConnection(
+            DeleteNetworkElementConnectionInput input) {
+        RpcResultBuilder<DeleteNetworkElementConnectionOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.deleteNetworkElementConnection(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<DeleteMediatorServerOutput>> deleteMediatorServer(
+            DeleteMediatorServerInput input) {
+        LOG.debug("RPC Request: deleteMediatorServer with input {}", input);
+        RpcResultBuilder<DeleteMediatorServerOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.deleteMediatorServer(input));
+        this.sendResyncCallbackToApiGateway();
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<CreateMediatorServerOutput>> createMediatorServer(
+            CreateMediatorServerInput input) {
+        LOG.debug("RPC Request: createMediatorServer with input {}", input);
+        RpcResultBuilder<CreateMediatorServerOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.createMediatorServer(input));
+        this.sendResyncCallbackToApiGateway();
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<CreateMaintenanceOutput>> createMaintenance(CreateMaintenanceInput input) {
+        LOG.debug("RPC Request: createMaintenance with input {}", input);
+        RpcResultBuilder<CreateMaintenanceOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.createMaintenance(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<DeleteMaintenanceOutput>> deleteMaintenance(DeleteMaintenanceInput input) {
+        LOG.debug("RPC Request: deleteMaintenance with input {}", input);
+        RpcResultBuilder<DeleteMaintenanceOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.deleteMaintenance(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<UpdateMediatorServerOutput>> updateMediatorServer(
+            UpdateMediatorServerInput input) {
+        LOG.debug("RPC Request: updateMediatorServer with input {}", input);
+        RpcResultBuilder<UpdateMediatorServerOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.updateMediatorServer(input));
+        this.sendResyncCallbackToApiGateway();
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<UpdateMaintenanceOutput>> updateMaintenance(UpdateMaintenanceInput input) {
+        LOG.debug("RPC Request: updateMaintenance with input {}", input);
+        RpcResultBuilder<UpdateMaintenanceOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.updateMaintenance(input));
+        return result.buildFuture();
+    }
+
+    @Override
+    public ListenableFuture<RpcResult<ReadEventlogListOutput>> readEventlogList(ReadEventlogListInput input) {
+        LOG.debug("RPC Request: readEventlogList with input {}", input);
+        RpcResultBuilder<ReadEventlogListOutput> result = read(() -> DataProviderServiceImpl.this.dataProvider.readEventlogList(input));
+        return result.buildFuture();
+    }
+
+    // -- private classes and functions
+
+    private static String assembleExceptionMessage(Exception e) {
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        e.printStackTrace(pw);
+
+        StringBuffer buf = new StringBuffer();
+        buf.append("Exception: ");
+        buf.append(sw.toString());
+        return buf.toString();
+    }
+
+    private interface GetEntityInput<O extends DataObject> {
+        Builder<O> get() throws IOException;
+    }
+
+    private static <O extends DataObject,I extends DataObject> RpcResultBuilder<O> read(GetEntityInput<O> inputgetter ) {
+        RpcResultBuilder<O> result;
+        try {
+            Builder<O> outputBuilder = inputgetter.get();
+            result = RpcResultBuilder.success(outputBuilder);
+        } catch (Exception e) {
+            LOG.info("Exception", e);
+            result = RpcResultBuilder.failed();
+            result.withError(ErrorType.APPLICATION, assembleExceptionMessage(e));
+        }
+        return result;
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/EsConfig.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/EsConfig.java
new file mode 100644
index 0000000..fc9ae50
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/EsConfig.java
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.impl;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.filechange.IConfigChangedListener;
+import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
+import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo.Protocol;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.IEsConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class EsConfig implements Configuration, IEsConfig {
+
+    private static final Logger LOG = LoggerFactory.getLogger(EsConfig.class);
+
+    public static final String SECTION_MARKER_ES = "es";
+
+    private static final String PROPERTY_KEY_DBHOSTS = "esHosts";
+    private static final String PROPERTY_KEY_ARCHIVE_LIMIT = "esArchiveLifetimeSeconds";
+    private static final String PROPERTY_KEY_CLUSTER = "esCluster";
+    private static final String PROPERTY_KEY_ARCHIVE_INTERVAL = "esArchiveCheckIntervalSeconds";
+    private static final String PROPERTY_KEY_NODE = "esNode";
+    private static final String PROPERTY_KEY_AUTH_USERNAME = "esAuthUsername";
+    private static final String PROPERTY_KEY_AUTH_PASSWORD = "esAuthPassword";
+
+    
+    private static String defaultHostinfo = printHosts(new HostInfo[] { new HostInfo("sdnrdb", 9200, Protocol.HTTP) });
+    private static final String DEFAULT_VALUE_CLUSTER = "";
+    /** check db data in this interval [in seconds] 0 deactivated */
+    private static final String DEFAULT_ARCHIVE_INTERVAL_SEC = "0";
+    /** keep data for this time [in seconds] 30 days */
+    private static final String DEFAULT_ARCHIVE_LIMIT_SEC = String.valueOf(60L * 60L * 24L * 30L);
+    private static final String DEFAULT_KEY_NODE = "elasticsearchnode";
+
+    private final ConfigurationFileRepresentation configuration;
+
+    public EsConfig(ConfigurationFileRepresentation configuration) {
+
+        this.configuration = configuration;
+        this.configuration.addSection(SECTION_MARKER_ES);
+        defaults();
+    }
+
+    /*
+     * Setter
+     */
+
+    public void setNode(String nodeName) {
+        configuration.setProperty(SECTION_MARKER_ES, PROPERTY_KEY_NODE, nodeName);
+    }
+
+    /*
+     * Getter
+     */
+
+    public String getNode() {
+        return configuration.getProperty(SECTION_MARKER_ES, PROPERTY_KEY_NODE);
+    }
+
+    public HostInfo[] getHosts() {
+        String dbHosts = configuration.getProperty(SECTION_MARKER_ES, PROPERTY_KEY_DBHOSTS);
+        return parseHosts(dbHosts);
+    }
+    public void setHosts(HostInfo[] hosts) {
+        this.configuration.setProperty(SECTION_MARKER_ES, PROPERTY_KEY_DBHOSTS, printHosts(hosts));
+    }
+    @Override
+    public String getCluster() {
+        return configuration.getProperty(SECTION_MARKER_ES, PROPERTY_KEY_ARCHIVE_INTERVAL);
+    }
+
+    public void setCluster(String cluster) {
+        configuration.setProperty(SECTION_MARKER_ES, PROPERTY_KEY_CLUSTER, cluster);
+    }
+
+    public boolean hasBasicAuthCredentials() {
+    	return this.getBasicAuthUsername()!=null && this.getBasicAuthPassword()!=null &&
+    			this.getBasicAuthUsername()!="" && this.getBasicAuthPassword()!="" ;
+    }
+    public String getBasicAuthUsername() {
+    	return this.configuration.getProperty(SECTION_MARKER_ES, PROPERTY_KEY_AUTH_USERNAME);
+    }
+    public String getBasicAuthPassword() {
+    	return this.configuration.getProperty(SECTION_MARKER_ES, PROPERTY_KEY_AUTH_PASSWORD);
+    }
+    @Override
+    public long getArchiveCheckIntervalSeconds() {
+        return configuration.getPropertyLong(SECTION_MARKER_ES, PROPERTY_KEY_ARCHIVE_INTERVAL).orElse(0L);
+    }
+
+    public void setArchiveCheckIntervalSeconds(long seconds) {
+        configuration.setProperty(SECTION_MARKER_ES, PROPERTY_KEY_ARCHIVE_INTERVAL, seconds);
+    }
+
+    @Override
+    public long getArchiveLifetimeSeconds() {
+        return configuration.getPropertyLong(SECTION_MARKER_ES, PROPERTY_KEY_ARCHIVE_LIMIT).orElse(0L);
+    }
+
+    public void setArchiveLimit(long seconds) {
+        configuration.setProperty(SECTION_MARKER_ES, PROPERTY_KEY_ARCHIVE_LIMIT, seconds);
+    }
+
+    @Override
+    public String getSectionName() {
+        return SECTION_MARKER_ES;
+    }
+
+    @Override
+    public void defaults() {
+        // Add default if not available
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_ES, PROPERTY_KEY_DBHOSTS, defaultHostinfo);
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_ES, PROPERTY_KEY_ARCHIVE_LIMIT,
+                DEFAULT_ARCHIVE_LIMIT_SEC);
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_ES, PROPERTY_KEY_CLUSTER, DEFAULT_VALUE_CLUSTER);
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_ES, PROPERTY_KEY_ARCHIVE_INTERVAL,
+                DEFAULT_ARCHIVE_INTERVAL_SEC);
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_ES, PROPERTY_KEY_NODE, DEFAULT_KEY_NODE);
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_ES, PROPERTY_KEY_AUTH_USERNAME, "");
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_ES, PROPERTY_KEY_AUTH_PASSWORD, "");
+    }
+
+    @Override
+    public void unregisterConfigChangedListener(IConfigChangedListener archiveCleanService) {
+        configuration.unregisterConfigChangedListener(archiveCleanService);
+    }
+
+    @Override
+    public void registerConfigChangedListener(IConfigChangedListener archiveCleanService) {
+        configuration.registerConfigChangedListener(archiveCleanService);
+    }
+
+    /** @TODO Shift to own class **/
+    private static String printHosts(HostInfo[] h) {
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < h.length; i++) {
+            sb.append(h[i].toUrl());
+            if (i != h.length - 1) {
+                sb.append(",");
+            }
+        }
+        return sb.toString();
+    }
+
+    /** @TODO Shift to own class **/
+    private static HostInfo[] parseHosts(String string) {
+        List<HostInfo> infos = new ArrayList<>();
+        String[] list = string.split(",");
+        if (list.length > 0) {
+            for (String item : list) {
+                try {
+                    URL url = new URL(item);
+                    infos.add(new HostInfo(url.getHost(), url.getPort(), Protocol.getValueOf(url.getProtocol())));
+                } catch (MalformedURLException e) {
+                    LOG.warn("problem parsing url {} : {}", item, e.getMessage());
+                }
+            }
+        }
+        HostInfo[] a = new HostInfo[infos.size()];
+        return infos.toArray(a);
+    }
+
+    @Override
+    public String toString() {
+        return "EsConfig [getNode()=" + getNode() + ", getHosts()=" + Arrays.toString(getHosts()) + ", getCluster()="
+                + getCluster() + ", getArchiveCheckIntervalSeconds()=" + getArchiveCheckIntervalSeconds()
+                + ", getArchiveLifetimeSeconds()=" + getArchiveLifetimeSeconds() + ", getSectionName()="
+                + getSectionName() + "]";
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsCloner.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsCloner.java
new file mode 100644
index 0000000..013a638
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsCloner.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Nullable;
+import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class YangToolsCloner {
+
+    private static YangToolsMapper yangtoolsMapper = new YangToolsMapper();
+    private static final Logger LOG = LoggerFactory.getLogger(YangToolsCloner.class);
+    public static final int ACCESSOR_FIELD = 0;
+    public static final int ACCESSOR_METHOD = 1;
+
+
+    private final int accessor;
+
+    private YangToolsCloner(int ac) {
+        this.accessor = ac;
+    }
+    public static YangToolsCloner instance() {
+        return instance(ACCESSOR_METHOD);
+    }
+    public static YangToolsCloner instance(int ac) {
+        return new YangToolsCloner(ac);
+    }
+    /**
+     *
+     * @param source source object
+     * @param clazz Class of return object
+     * @return list of cloned object
+     * @return
+     */
+    public <S extends DataObject, T extends DataObject> List<T> cloneList(List<S> source, Class<T> clazz) {
+        return cloneList(source, clazz, null);
+    }
+
+    /**
+     *
+     * @param source source object
+     * @param clazz Class of return object
+     * @attrList filter for attribute Names to clone
+     * @return list of cloned object
+     */
+    public <S extends DataObject, T extends DataObject> List<T> cloneList(List<S> source, Class<T> clazz,
+            @Nullable List<String> attrList) {
+        if (source == null) {
+            return null;
+        }
+        List<T> list = new ArrayList<>();
+        for (S s : source) {
+            list.add(clone(s, clazz, attrList));
+        }
+        return list;
+    }
+
+    /**
+     *
+     * @param source source object
+     * @param clazz Class of return object
+     * @return cloned object
+     */
+    public <S , T extends DataObject> T clone(S source, Class<T> clazz) {
+        return clone(source, clazz, null);
+    }
+    /**
+     *
+     * @param source source object
+     * @param clazz Class of return object
+     * @attrList if empty copy all else list of attribute Names to clone
+     * @return cloned object
+     */
+    public <S, T extends DataObject> T clone(S source, Class<T> clazz,
+            @Nullable List<String> attrList) {
+        if (source == null) {
+            return (T)null;
+        }
+        Field[] attributeFields;
+        Field sourceField;
+        Method m;
+        Builder<T> builder = yangtoolsMapper.getBuilder(clazz);
+        T object = builder.build();
+        attributeFields = object.getClass().getDeclaredFields();
+        for (Field attributeField : attributeFields) {
+            // check if attr is in inclusion list
+            if (attrList != null && !attrList.contains(attributeField.getName())) {
+                continue;
+            }
+            // ignore QNAME
+            if (attributeField.getName().equals("QNAME")) {
+                continue;
+            }
+
+            attributeField.setAccessible(true);
+            try {
+                if(accessor==ACCESSOR_FIELD) {
+                    sourceField = source.getClass().getDeclaredField(attributeField.getName());
+                    sourceField.setAccessible(true);
+                    if (attributeField.getType().equals(String.class) && !sourceField.getType().equals(String.class)) {
+                        attributeField.set(object, String.valueOf(sourceField.get(source)));
+                    } else {
+                        attributeField.set(object, sourceField.get(source));
+                    }
+                }
+                else if(accessor==ACCESSOR_METHOD) {
+                    String getter = getter(attributeField.getName());
+                    System.out.println("getter="+getter);
+                    m = source.getClass().getDeclaredMethod(getter);
+                    m.setAccessible(true);
+                    if (attributeField.getType().equals(String.class) && !m.getReturnType().equals(String.class)) {
+                        attributeField.set(object, String.valueOf(m.invoke(source)));
+                    } else {
+                        attributeField.set(object, m.invoke(source));
+                    }
+                }
+
+            } catch (NoSuchMethodException | NoSuchFieldException e) {
+                // Convert to run-time exception
+                String msg = "no such field " + attributeField.getName() + " in class " + source.getClass().getName();
+                LOG.debug(msg);
+                // throw new IllegalArgumentException(msg);
+            } catch (IllegalAccessException|SecurityException e) {
+                LOG.debug("Access problem " + attributeField.getName(), e);
+            } catch (IllegalArgumentException e) {
+                LOG.debug("argument problem " + attributeField.getName(), e);
+            } catch (InvocationTargetException e) {
+                LOG.debug("invocation problem " + attributeField.getName(), e);
+            }
+        }
+
+        return object;
+    }
+
+    private static String getter(String name) {
+        return String.format("%s%s%s","get",name.substring(1, 2).toUpperCase(),name.substring(2));
+    }
+    public <S extends DataObject, T extends DataObject,B extends Builder<T>> B cloneToBuilder(S source, B builder){
+        return cloneToBuilder(source, builder,null);
+    }
+    public <S extends DataObject, T extends DataObject,B extends Builder<T>> B  cloneToBuilder(S source, B builder,
+            @Nullable List<String> attrList) {
+        Field[] attributeFields;
+        Field sourceField;
+        Method m;
+        attributeFields = builder.getClass().getDeclaredFields();
+        for (Field attributeField : attributeFields) {
+            // check if attr is in inclusion list
+            if (attrList != null && !attrList.contains(attributeField.getName())) {
+                continue;
+            }
+            // ignore QNAME
+            if (attributeField.getName().equals("QNAME")) {
+                continue;
+            }
+
+            attributeField.setAccessible(true);
+            try {
+                if(accessor==ACCESSOR_FIELD) {
+                    sourceField = source.getClass().getDeclaredField(attributeField.getName());
+                    sourceField.setAccessible(true);
+                    if (attributeField.getType().equals(String.class) && !sourceField.getType().equals(String.class)) {
+                        attributeField.set(builder, String.valueOf(sourceField.get(source)));
+                    } else {
+                        attributeField.set(builder, sourceField.get(source));
+                    }
+                }
+                else if(accessor==ACCESSOR_METHOD) {
+                    m = source.getClass().getDeclaredMethod(getter(attributeField.getName()));
+                    m.setAccessible(true);
+                    if (attributeField.getType().equals(String.class) && !m.getReturnType().equals(String.class)) {
+                        attributeField.set(builder, String.valueOf(m.invoke(source)));
+                    } else {
+                        attributeField.set(builder, m.invoke(source));
+                    }
+                }
+
+            } catch (NoSuchMethodException | NoSuchFieldException e) {
+                // Convert to run-time exception
+                String msg = "no such field " + attributeField.getName() + " in class " + source.getClass().getName();
+                LOG.debug(msg);
+                // throw new IllegalArgumentException(msg);
+            } catch (IllegalAccessException|SecurityException e) {
+                LOG.debug("Access problem " + attributeField.getName(), e);
+            } catch (IllegalArgumentException e) {
+                LOG.debug("argument problem " + attributeField.getName(), e);
+            } catch (InvocationTargetException e) {
+                LOG.debug("invocation problem " + attributeField.getName(), e);
+            }
+        }
+        return builder;
+    }
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper.java
new file mode 100644
index 0000000..3d74a12
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools;
+
+import java.io.IOException;
+import javax.annotation.Nullable;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.Credentials;
+import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder.Value;
+import com.fasterxml.jackson.databind.introspect.AnnotatedClass;
+import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+/**
+ * YangToolsMapper is a specific Jackson mapper configuration for opendaylight yangtools serialization or deserialization of DataObject to/from JSON
+ * TODO ChoiceIn and Credentials deserialization only for LoginPasswordBuilder
+ */
+public class YangToolsMapper extends ObjectMapper {
+
+ 	private final Logger LOG = LoggerFactory.getLogger(YangToolsMapper.class);
+	private static final long serialVersionUID = 1L;
+	private static BundleContext context;
+
+	public YangToolsMapper() {
+		super();
+		configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+		setPropertyNamingStrategy(PropertyNamingStrategy.KEBAB_CASE);
+		setSerializationInclusion(Include.NON_NULL);
+		setAnnotationIntrospector(new YangToolsBuilderAnnotationIntrospector());
+		SimpleModule dateAndTimeSerializerModule = new SimpleModule();
+		dateAndTimeSerializerModule.addSerializer(DateAndTime.class,new CustomDateAndTimeSerializer());
+		registerModule(dateAndTimeSerializerModule );
+		Bundle bundle = FrameworkUtil.getBundle(YangToolsMapper.class);
+		context = bundle != null ? bundle.getBundleContext() : null;
+	}
+
+	@Override
+	public String writeValueAsString(Object value) throws JsonProcessingException {
+		// TODO Auto-generated method stub
+		return super.writeValueAsString(value);
+	}
+	/**
+	 * Get Builder object for yang tools interface.
+	 * @param <T> yang-tools base datatype
+	 * @param clazz class with interface.
+	 * @return builder for interface or null if not existing
+	 */
+	@SuppressWarnings("unchecked")
+	public @Nullable <T extends DataObject> Builder<T> getBuilder(Class<T> clazz) {
+		String builder = clazz.getName() + "Builder";
+		try {
+			Class<?> clazzBuilder = findClass(builder);
+			return (Builder<T>) clazzBuilder.newInstance();
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			LOG.debug("Problem ", e);
+			return null;
+		}
+	}
+
+	/**
+	 * Callback for handling mapping failures.
+	 * @return
+	 */
+	public int getMappingFailures() {
+		return 0;
+	}
+
+	/**
+	 * Provide mapping of string to attribute names, generated by yang-tools.
+	 * "netconf-id" converted to "_netconfId"
+	 * @param name with attribute name, not null or empty
+	 * @return converted string or null if name was empty or null
+	 */
+	public @Nullable static String toCamelCaseAttributeName(final String name) {
+		if (name == null || name.isEmpty())
+			return null;
+
+		final StringBuilder ret = new StringBuilder(name.length());
+		if (!name.startsWith("_"))
+			ret.append('_');
+		int start = 0;
+		for (final String word : name.split("-")) {
+			if (!word.isEmpty()) {
+				if (start++ == 0) {
+					ret.append(Character.toLowerCase(word.charAt(0)));
+				} else {
+					ret.append(Character.toUpperCase(word.charAt(0)));
+				}
+				ret.append(word.substring(1));
+			}
+		}
+		return ret.toString();
+	}
+
+	/**
+	 * Adapted Builder callbacks
+	 */
+	private static class YangToolsBuilderAnnotationIntrospector extends JacksonAnnotationIntrospector {
+		private static final long serialVersionUID = 1L;
+
+		@Override
+        public Class<?> findPOJOBuilder(AnnotatedClass ac) {
+        		try {
+            		String builder = null;
+            		if (ac.getRawType().equals(Credentials.class)) {
+            			builder = "org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder";
+            			//System.out.println(DataContainer.class.isAssignableFrom(ac.getRawType()));
+            			//System.out.println(ChoiceIn.class.isAssignableFrom(ac.getRawType()));
+
+            		} 
+            		else if(ac.getRawType().equals(DateAndTime.class)) {
+            			builder = DateAndTimeBuilder.class.getName();
+            		}
+                	
+            		else {
+        	        	if (ac.getRawType().isInterface()) 	{
+        	        		builder = ac.getName()+"Builder";
+        	        	}
+            		}
+            		if (builder != null) {
+		            	//System.out.println("XX1: "+ac.getRawType());
+		            	//System.out.println("XX2: "+builder);
+            			//Class<?> innerBuilder = Class.forName(builder);
+            			Class<?> innerBuilder = findClass(builder);
+	            	    //System.out.println("Builder found: "+ innerBuilder);
+	            	    return innerBuilder;
+            		}
+            	} catch( ClassNotFoundException e ) {
+    	            // No problem .. try next
+            	}
+           return super.findPOJOBuilder(ac);
+        }
+
+		@Override
+		public Value findPOJOBuilderConfig(AnnotatedClass ac) {
+			if (ac.hasAnnotation(JsonPOJOBuilder.class)) {
+				return super.findPOJOBuilderConfig(ac);
+			}
+			return new JsonPOJOBuilder.Value("build", "set");
+		}
+	}
+
+	private static Class<?> findClass(String name) throws ClassNotFoundException {
+		// Try to find in other bundles
+		if (context != null) {
+			//OSGi environment
+			for (Bundle b : context.getBundles()) {
+				try {
+					return b.loadClass(name);
+				} catch (ClassNotFoundException e) {
+					// No problem, this bundle doesn't have the class
+				}
+			}
+			throw new ClassNotFoundException("Can not find Class in OSGi context.");
+		} else {
+			return Class.forName(name);
+		}
+	    // not found in any bundle
+	}
+	public static class DateAndTimeBuilder{
+		
+		private final String _value;
+	
+		public DateAndTimeBuilder(String v) {
+			this._value= v;
+		}
+		
+		public DateAndTime build() {
+			return new DateAndTime(_value);
+		}
+		
+	}
+	public static class CustomDateAndTimeSerializer extends StdSerializer<DateAndTime>{
+
+		/**
+		 * 
+		 */
+		private static final long serialVersionUID = 1L;
+
+		public CustomDateAndTimeSerializer() {
+			this(null);
+		}
+		protected CustomDateAndTimeSerializer(Class<DateAndTime> t) {
+			super(t);
+		}
+
+		@Override
+		public void serialize(DateAndTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
+			gen.writeString(value.getValue());
+		}
+		
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper2.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper2.java
new file mode 100644
index 0000000..c492691
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/YangToolsMapper2.java
@@ -0,0 +1,263 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools;
+
+import java.io.IOException;
+import javax.annotation.Nullable;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.Credentials;
+import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder.Value;
+import com.fasterxml.jackson.databind.introspect.AnnotatedClass;
+import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+/**
+ * YangToolsMapper is a specific Jackson mapper configuration for opendaylight yangtools serialization or deserialization of DataObject to/from JSON
+ * TODO ChoiceIn and Credentials deserialization only for LoginPasswordBuilder
+ */
+public class YangToolsMapper2<T extends DataObject> extends ObjectMapper {
+
+ 	private final Logger LOG = LoggerFactory.getLogger(YangToolsMapper2.class);
+	private static final long serialVersionUID = 1L;
+	private static String ENTITY = "Entity";
+	private static String BUILDER = "Builder";
+
+	private @Nullable Class<T> clazz;
+	private @Nullable Class<? extends Builder<? extends T>> builderClazz;
+
+	private BundleContext context;
+
+	public <X extends T, B extends Builder<X>> YangToolsMapper2(Class<T> clazz, Class<B> builderClazz) throws ClassNotFoundException {
+		super();
+		configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+		setPropertyNamingStrategy(PropertyNamingStrategy.KEBAB_CASE);
+		setSerializationInclusion(Include.NON_NULL);
+		setAnnotationIntrospector(new YangToolsBuilderAnnotationIntrospector());
+		SimpleModule dateAndTimeSerializerModule = new SimpleModule();
+		dateAndTimeSerializerModule.addSerializer(DateAndTime.class, new CustomDateAndTimeSerializer());
+		registerModule(dateAndTimeSerializerModule );
+		Bundle bundle = FrameworkUtil.getBundle(YangToolsMapper2.class);
+
+		this.clazz = clazz;
+		this.builderClazz = builderClazz != null ? builderClazz : getBuilderClass(getBuilderClassName(clazz)) ;
+		context = bundle != null ? bundle.getBundleContext() : null;
+	}
+
+	public YangToolsMapper2() throws ClassNotFoundException {
+		this(null, null);
+	}
+
+
+	@Override
+	public String writeValueAsString(Object value) throws JsonProcessingException {
+		return super.writeValueAsString(value);
+	}
+	/**
+	 * Get Builder object for yang tools interface.
+	 * @param <T> yang-tools base datatype
+	 * @param clazz class with interface.
+	 * @return builder for interface or null if not existing
+	 */
+	@SuppressWarnings("unchecked")
+	public @Nullable <T extends DataObject> Builder<T> getBuilder(Class<T> clazz) {
+		try {
+			//Class<?> clazzBuilder = getBuilderClass(getBuilderClassName(clazz));
+			return (Builder<T>) builderClazz.newInstance();
+		} catch (InstantiationException | IllegalAccessException e) {
+			LOG.debug("Problem ", e);
+			return null;
+		}
+	}
+
+	/**
+	 * Callback for handling mapping failures.
+	 * @return
+	 */
+	public int getMappingFailures() {
+		return 0;
+	}
+
+	/**
+	 * Provide mapping of string to attribute names, generated by yang-tools.
+	 * "netconf-id" converted to "_netconfId"
+	 * @param name with attribute name, not null or empty
+	 * @return converted string or null if name was empty or null
+	 */
+	public @Nullable static String toCamelCaseAttributeName(final String name) {
+		if (name == null || name.isEmpty())
+			return null;
+
+		final StringBuilder ret = new StringBuilder(name.length());
+		if (!name.startsWith("_"))
+			ret.append('_');
+		int start = 0;
+		for (final String word : name.split("-")) {
+			if (!word.isEmpty()) {
+				if (start++ == 0) {
+					ret.append(Character.toLowerCase(word.charAt(0)));
+				} else {
+					ret.append(Character.toUpperCase(word.charAt(0)));
+				}
+				ret.append(word.substring(1));
+			}
+		}
+		return ret.toString();
+	}
+
+	/** Verify if builder is available
+	 * @throws ClassNotFoundException **/
+	public Class<?> assertBuilderClass(Class<?> clazz) throws ClassNotFoundException {
+		return getBuilderClass(getBuilderClassName(clazz));
+	}
+
+	// --- Private functions
+
+	/**
+	 * Create name of builder class
+	 * @param <T>
+	 * @param clazz
+	 * @return builders class name
+	 * @throws ClassNotFoundException
+	 */
+	private static String getBuilderClassName(Class<?> clazz) {
+		return clazz.getName() + BUILDER;
+//		String clazzName = clazz.getName();
+//		if (clazzName.endsWith(ENTITY)) {
+//			return clazzName.replace(ENTITY, BUILDER);
+//		} else {
+//			return clazzName + BUILDER;
+//		}
+	}
+
+	/**
+	 * Search builder in context
+	 * @param name
+	 * @return
+	 * @throws ClassNotFoundException
+	 */
+	@SuppressWarnings("unchecked")
+	private <X extends T, B extends Builder<X>> Class<B> getBuilderClass(String name) throws ClassNotFoundException {
+		// Try to find in other bundles
+		if (context != null) {
+			//OSGi environment
+			for (Bundle b : context.getBundles()) {
+				try {
+					return (Class<B>) b.loadClass(name);
+				} catch (ClassNotFoundException e) {
+					// No problem, this bundle doesn't have the class
+				}
+			}
+			throw new ClassNotFoundException("Can not find Class in OSGi context.");
+		} else {
+			return (Class<B>) Class.forName(name);
+		}
+	    // not found in any bundle
+	}
+
+	// --- Classes
+
+	/**
+	 * Adapted Builder callbacks
+	 */
+	private class YangToolsBuilderAnnotationIntrospector extends JacksonAnnotationIntrospector {
+		private static final long serialVersionUID = 1L;
+
+		@Override
+		public Class<?> findPOJOBuilder(AnnotatedClass ac) {
+
+			if (ac.getRawType().equals(Credentials.class)) {
+				return org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder.class;
+
+			} else if (ac.getRawType().equals(DateAndTime.class)) {
+				return DateAndTimeBuilder.class;
+
+			} else if (ac.getRawType().equals(clazz)) {
+				return builderClazz;
+			}
+
+			if (ac.getRawType().isInterface()) {
+				String builder = getBuilderClassName(ac.getRawType());
+				try {
+					Class<?> innerBuilder = getBuilderClass(builder);
+					return innerBuilder;
+				} catch (ClassNotFoundException e) {
+					// No problem .. try next
+				}
+			}
+			return super.findPOJOBuilder(ac);
+		}
+
+		@Override
+		public Value findPOJOBuilderConfig(AnnotatedClass ac) {
+			if (ac.hasAnnotation(JsonPOJOBuilder.class)) {
+				return super.findPOJOBuilderConfig(ac);
+			}
+			return new JsonPOJOBuilder.Value("build", "set");
+		}
+	}
+
+	public static class DateAndTimeBuilder{
+
+		private final String _value;
+
+		public DateAndTimeBuilder(String v) {
+			this._value= v;
+		}
+
+		public DateAndTime build() {
+			return new DateAndTime(_value);
+		}
+
+	}
+	public static class CustomDateAndTimeSerializer extends StdSerializer<@NonNull DateAndTime>{
+
+		private static final long serialVersionUID = 1L;
+
+		public CustomDateAndTimeSerializer() {
+			this(null);
+		}
+		protected CustomDateAndTimeSerializer(Class<DateAndTime> t) {
+			super(t);
+		}
+
+		@Override
+		public void serialize(DateAndTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
+			gen.writeString(value.getValue());
+		}
+
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/main/resources/about/README.md b/sdnr/wt/data-provider/provider/src/main/resources/about/README.md
new file mode 100644
index 0000000..81c8c6c
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/resources/about/README.md
@@ -0,0 +1,17 @@
+
+|  |  |
+| --- | ----- |
+| ONAP release | {release-name} |
+| ONAP release version | {release-version} |
+| Opendaylight release | {odl-version} |
+| ONAP CCSDK version | {ccsdk-version} |
+| Build timestamp | {build-time} |
+| Yangtools version | {yangtools-version}  |
+| MD-SAL version | {mdsal-version} |
+| SDN-R packages version | {package-version} ({package-githash}) |
+| ODLUX version | {odlux-revision} |
+| Cluster size | {cluster-size} |
+
+```
+{karaf-info}
+```
\ No newline at end of file
diff --git a/sdnr/wt/data-provider/provider/src/main/resources/about/test.bmp b/sdnr/wt/data-provider/provider/src/main/resources/about/test.bmp
new file mode 100644
index 0000000..d049ea5
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/resources/about/test.bmp
Binary files differ
diff --git a/sdnr/wt/data-provider/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/wt/data-provider/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
new file mode 100644
index 0000000..54575ad
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+============LICENSE_START=======================================================
+ONAP : ccsdk feature sdnr wt data-provider
+ ================================================================================
+Copyright (C) 2019 highstreet technologies GmbH Intellectual Property.
+All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+============LICENSE_END=========================================================
+ -->
+
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+  xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0" odl:use-default-for-reference-types="true">
+
+	<reference id="rpcProviderService"
+		interface="org.opendaylight.mdsal.binding.api.RpcProviderService"
+		odl:type="default" />
+		
+	<bean id="readyServlet"
+		class="org.onap.ccsdk.features.sdnr.wt.dataprovider.http.ReadyHttpServlet">
+	</bean>
+	<service interface="javax.servlet.http.HttpServlet"
+		ref="readyServlet">
+		<service-properties>
+			<entry key="alias" value="/ready" />
+		</service-properties>
+	</service>
+
+	<bean id="aboutServlet"
+		class="org.onap.ccsdk.features.sdnr.wt.dataprovider.http.AboutHttpServlet">
+	</bean>
+	<service interface="javax.servlet.http.HttpServlet"
+		ref="aboutServlet">
+		<service-properties>
+			<entry key="alias" value="/about" />
+		</service-properties>
+	</service>
+    
+    <bean id="msServlet"
+        class="org.onap.ccsdk.features.sdnr.wt.dataprovider.http.MsServlet">
+    </bean>
+   <service interface="javax.servlet.http.HttpServlet" ref="msServlet">
+        <service-properties>
+            <entry key="alias" value="/ms" />
+        </service-properties>
+    </service>
+    
+	<bean id="provider"
+		class="org.onap.ccsdk.features.sdnr.wt.dataprovider.impl.DataProviderImpl"
+		init-method="init" destroy-method="close">
+		<property name="rpcProviderService" ref="rpcProviderService" />
+		<property name="aboutServlet" ref="aboutServlet" />
+		<property name="mediatorServerServlet" ref="msServlet" />
+	</bean>
+	
+	<bean id="yangServlet"
+		class="org.onap.ccsdk.features.sdnr.wt.dataprovider.http.YangSchemaHttpServlet">
+	</bean>
+	<service interface="javax.servlet.http.HttpServlet"
+		ref="yangServlet">
+		<service-properties>
+			<entry key="alias" value="/yang-schema" />
+		</service-properties>
+	</service>
+
+   	<service ref="provider"
+		interface="org.onap.ccsdk.features.sdnr.wt.dataprovider.model.IEntityDataProvider" />
+
+</blueprint>
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestAbout.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestAbout.java
new file mode 100644
index 0000000..01dc8fc
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestAbout.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.AboutHttpServlet;
+
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.nio.file.Files;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class TestAbout {
+
+	private static final String REPO_MDSAL_DIR = "system/org/opendaylight/mdsal/mdsal-binding-api/3.0.9/";
+	private static final String REPO_YANGTOOLS_DIR = "system/org/opendaylight/yangtools/odl-yangtools-common/2.1.11";
+	@BeforeClass
+	public static void before() throws IOException {
+		//create temporary odl folder structure in tmp
+		Files.createDirectories(new File(REPO_MDSAL_DIR).toPath() );
+		Files.createDirectories(new File(REPO_YANGTOOLS_DIR).toPath() );
+	}
+	@AfterClass
+	public static void after() throws IOException {
+		//delete created dirs
+		delete(new File("system/"));
+	}
+	private static void delete(File file) throws IOException {
+ 
+		for (File childFile : file.listFiles()) {
+ 
+			if (childFile.isDirectory()) {
+				delete(childFile);
+			} else {
+				if (!childFile.delete()) {
+					throw new IOException();
+				}
+			}
+		}
+ 
+		if (!file.delete()) {
+			throw new IOException();
+		}
+	}
+	@Test
+	public void testReadmeRequest() throws IOException, ServletException {
+		AboutHelperServlet servlet =new AboutHelperServlet();
+		HttpServletRequest request = mock(HttpServletRequest.class);
+		HttpServletResponse response =  mock(HttpServletResponse.class);
+		when(request.getRequestURI()).thenReturn("/about");
+		StringWriter out = new StringWriter();
+		ServletOutputStream printOut = new ServletOutputStream() {
+
+			@Override
+			public void write(int arg0) throws IOException {
+				out.write(arg0);
+			}
+		};
+		when(response.getOutputStream()).thenReturn(printOut);
+		servlet.doGet(request,response);
+		verify(response).setStatus(200);
+		verify(response).setContentType("text/plain");
+		System.out.println(out.getBuffer().toString());
+		assertTrue(out.getBuffer().length()>0);
+	}
+
+	@Test
+	public void testReadmeResourceRequest() throws IOException, ServletException {
+		AboutHelperServlet servlet =new AboutHelperServlet();
+		HttpServletRequest request = mock(HttpServletRequest.class);
+		HttpServletResponse response =  mock(HttpServletResponse.class);
+		when(request.getRequestURI()).thenReturn("/about/test.bmp");
+		ByteArrayOutputStream out = new ByteArrayOutputStream();
+		ServletOutputStream printOut = new ServletOutputStream() {
+
+			@Override
+			public void write(int arg0) throws IOException {
+				out.write(arg0);
+			}
+		};
+		when(response.getOutputStream()).thenReturn(printOut);
+		servlet.doGet(request,response);
+		verify(response).setStatus(200);
+		verify(response).setContentType("image/bmp");
+		assertTrue(out.size()>0);
+	}
+
+	
+
+	private class AboutHelperServlet extends AboutHttpServlet{
+
+		/**
+		 *
+		 */
+		private static final long serialVersionUID = 1L;
+
+		@Override
+		public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+			super.doGet(req, resp);
+		}
+
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java
new file mode 100644
index 0000000..748ad51
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestCRUDforDatabase.java
@@ -0,0 +1,1450 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchHit;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.BaseRequest;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.ElasticSearchDataProvider;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMaintenanceOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateNetworkElementConnectionOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMaintenanceInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteMediatorServerInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.DeleteNetworkElementConnectionInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.GranularityPeriodType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadConnectionlogListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadEventlogListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultcurrentListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadFaultlogListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadInventoryListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMaintenanceListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadMediatorServerListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadNetworkElementConnectionListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mDeviceListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mLtpListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hDeviceListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata24hLtpListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMaintenanceOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateMediatorServerOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.UpdateNetworkElementConnectionOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.FilterBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Pagination;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.PaginationBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data;
+
+public class TestCRUDforDatabase {
+
+    private static ElasticSearchDataProvider dbProvider;
+    private static HtDatabaseClient dbRawProvider;
+    private static HostInfo[] hosts = new HostInfo[] { new HostInfo("localhost", Integer
+            .valueOf(System.getProperty("databaseport") != null ? System.getProperty("databaseport") : "49200")) };
+
+    @BeforeClass
+    public static void init() throws Exception {
+
+        dbProvider = new ElasticSearchDataProvider(hosts);
+        dbProvider.waitForYellowDatabaseStatus(30, TimeUnit.SECONDS);
+        dbRawProvider = new HtDatabaseClient(hosts);
+    }
+
+    private static void trySleep(long ms) {
+        try {
+            Thread.sleep(ms);
+        } catch (Exception e) {
+            Thread.currentThread().interrupt();
+        }
+    }
+
+    private static void trySleep() {
+        trySleep(0);
+    }
+
+    @Test
+    public void testStatus() throws IOException {
+
+        //== CLEAR AND CREATE ================================
+        clearAndCreatefaultEntity("1", Entity.Faultcurrent.getName(), "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", SeverityType.Critical);
+        createFaultEntity("Lorem Ipsum", Entity.Faultcurrent.getName(), "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", SeverityType.Major);
+        createFaultEntity("3", Entity.Faultcurrent.getName(), "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", SeverityType.Minor);
+        createFaultEntity("4", Entity.Faultcurrent.getName(), "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", SeverityType.Warning);
+
+        //== READ ================================
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.status.output.Data> readOutput = dbProvider.readStatus().getData();
+        System.out.println(readOutput);
+
+        assertEquals(1,readOutput.get(0).getFaults().getMajors().intValue());
+        assertEquals(1,readOutput.get(0).getFaults().getMinors().intValue());
+        assertEquals(1,readOutput.get(0).getFaults().getWarnings().intValue());
+        assertEquals(1,readOutput.get(0).getFaults().getCriticals().intValue());
+
+        //== DELETE ================================
+
+         System.out.println("try to delete entries");
+         try {
+             dbRawProvider.doRemove(Entity.Faultcurrent.getName(), QueryBuilders.matchAllQuery());
+         } catch (Exception e) {
+             fail("problem deleting entry: " + e.getMessage());
+         }
+
+       //== VERIFY DELETE ===========================
+         System.out.println("verify entries were deleted");
+         readOutput = dbProvider.readStatus().getData();
+         assertEquals(0,readOutput.get(0).getFaults().getMajors().intValue());
+         assertEquals(0,readOutput.get(0).getFaults().getMinors().intValue());
+         assertEquals(0,readOutput.get(0).getFaults().getWarnings().intValue());
+         assertEquals(0,readOutput.get(0).getFaults().getCriticals().intValue());
+    }
+
+     @Test
+    public void testMediatorServer() {
+        final String NAME = "ms1";
+        final String URL = "http://11.23.45.55:4599";
+        final String NAME2 = "ms1-nu";
+        final String URL2 = "http://11.23.45.56:4599";
+
+        // ==CLEAR BEFORE TEST============================
+        System.out.println("try to clear entry");
+        try {
+            dbRawProvider.doRemove(Entity.MediatorServer.getName(), QueryBuilders.matchAllQuery());
+        } catch (Exception e) {
+            fail("problem deleting entry: " + e.getMessage());
+        }
+        trySleep();
+        // ==CREATE============================
+        System.out.println("try to create entry");
+        CreateMediatorServerOutputBuilder createOutput = null;
+        CreateMediatorServerInput input = new CreateMediatorServerInputBuilder().setName(NAME).setUrl(URL).build();
+        String dbId = null;
+
+        try {
+            createOutput = dbProvider.createMediatorServer(input);
+            dbId = createOutput.getId();
+            System.out.println(createOutput);
+        } catch (Exception e) {
+            fail("failed to create " + input.toString() + ":" + e.getMessage());
+        }
+        assertNotNull(createOutput);
+        assertNotNull(dbId);
+        trySleep();
+        // ==READ===========================
+        System.out.println("try to read entry");
+        ReadMediatorServerListInput readinput = new ReadMediatorServerListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
+        ReadMediatorServerListOutputBuilder readoutput = dbProvider.readMediatorServerList(readinput);
+        List<Data> data = readoutput.getData();
+        assertNotNull(data);
+        assertEquals("no entry found", 1, data.size());
+        assertEquals(NAME, data.get(0).getName());
+        assertEquals(URL, data.get(0).getUrl());
+        String dbId2 = data.get(0).getId();
+        assertEquals(dbId, dbId2);
+        System.out.println(data);
+        // ==UPDATE============================
+        System.out.println("try to update entry");
+        UpdateMediatorServerInput updateInput = new UpdateMediatorServerInputBuilder().setId(dbId2).setName(NAME2)
+                .setUrl(URL2).build();
+        UpdateMediatorServerOutputBuilder updateOutput = null;
+        try {
+            updateOutput = dbProvider.updateMediatorServer(updateInput);
+            System.out.println(updateOutput);
+        } catch (Exception e) {
+            fail("problem updating entry:" + e.getMessage());
+        }
+        assertNotNull(updateOutput);
+        trySleep();
+        // ==READ============================
+        System.out.println("try to read entry");
+        readinput = new ReadMediatorServerListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("name").setFiltervalue(NAME2).build()))
+                .setPagination(getPagination(20, 1)).build();
+        readoutput = dbProvider.readMediatorServerList(readinput);
+        data = readoutput.getData();
+        System.out.println(data);
+        assertNotNull("no update response", data);
+        assertEquals("update not verifiied", 1, data.size());
+        assertEquals("update not verifiied", NAME2, data.get(0).getName());
+        assertEquals("update not verifiied", URL2, data.get(0).getUrl());
+        assertEquals("update not verifiied", dbId, data.get(0).getId());
+        // ==DELETE============================
+        System.out.println("try to delete entry");
+        DeleteMediatorServerInput deleteInput = new DeleteMediatorServerInputBuilder().setId(dbId).build();
+        try {
+            dbProvider.deleteMediatorServer(deleteInput);
+        } catch (Exception e) {
+            fail("problem deleting entry: " + e.getMessage());
+        }
+
+        trySleep();
+        // ==READ/VERIFY DELETE============================
+        System.out.println("try to read entry");
+        readinput = new ReadMediatorServerListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("name").setFiltervalue(NAME2).build()))
+                .setPagination(getPagination(20, 1)).build();
+        readoutput = dbProvider.readMediatorServerList(readinput);
+        data = readoutput.getData();
+        assertNotNull("delete not verifiied", data);
+        assertEquals("delete not verifiied", 0, data.size());
+    }
+
+     @Test
+    public void testNetworkElementConnectionCurrent() {
+
+        System.out.println("networkElementConnection test start");
+
+        // ==CLEAR BEFORE TEST============================
+        System.out.println("try to clear entry");
+        try {
+            dbRawProvider.doRemove(Entity.NetworkelementConnection.getName(), QueryBuilders.matchAllQuery());
+        } catch (Exception e) {
+            fail("problem deleting entry: " + e.getMessage());
+        }
+
+        // ==CREATE============================
+        System.out.println("try to create");
+        final String name = "sim87";
+        final String url = "10.5.10.1";
+        final long port = 5959;
+
+        CreateNetworkElementConnectionOutputBuilder create = null;
+        CreateNetworkElementConnectionInput input = new CreateNetworkElementConnectionInputBuilder().setNodeId(name)
+                .setIsRequired(true).setHost(url).setPort(port).build();
+        String dbId = null;
+
+        try {
+            create = dbProvider.createNetworkElementConnection(input);
+            dbId = create.getId();
+        } catch (Exception e) {
+            fail("networkElementConnection create failed" + e.getMessage());
+        }
+
+        assertNotNull(dbId);
+        assertNotNull(create);
+
+        // ==READ===========================
+
+        ReadNetworkElementConnectionListInput readInput = new ReadNetworkElementConnectionListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
+
+        ReadNetworkElementConnectionListOutputBuilder readOperation = dbProvider
+                .readNetworkElementConnectionList(readInput);
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.network.element.connection.list.output.Data> data = readOperation
+                .getData();
+
+        assertNotNull(data);
+        assertEquals(dbId, data.get(0).getId());
+        assertEquals(name, data.get(0).getNodeId());
+        assertEquals(url, data.get(0).getHost());
+        assertEquals(port, data.get(0).getPort().longValue());
+
+        // ==UPDATE============================
+        System.out.println("Trying to update...");
+        final String name2 = "sim88";
+        final String url2 = "10.5.10.2";
+        final long port2 = 5960;
+
+        UpdateNetworkElementConnectionInput updateInput = new UpdateNetworkElementConnectionInputBuilder().setId(dbId).setHost(url2).setPort(port2).setIsRequired(false).build();
+        UpdateNetworkElementConnectionOutputBuilder updateOutput = null;
+        try {
+            updateOutput = dbProvider.updateNetworkElementConnection(updateInput);
+        } catch (Exception e) {
+            fail("update failed: " + e.getMessage());
+        }
+
+        assertNotNull(updateOutput);
+
+        // == Verify UPDATE============================
+        System.out.println("Verfiying update...");
+
+        readOperation = dbProvider.readNetworkElementConnectionList(readInput);
+        data = readOperation.getData();
+
+        assertNotNull(data);
+        assertEquals(url2, data.get(0).getHost());
+        assertEquals(port2, data.get(0).getPort().longValue());
+
+        // ==PARTIAL UPDATE============================
+        System.out.println("Try partial update...");
+        assertEquals(false, data.get(0).isIsRequired());
+        updateInput = new UpdateNetworkElementConnectionInputBuilder().setId(dbId).setIsRequired(true).build();
+        try {
+            updateOutput = dbProvider.updateNetworkElementConnection(updateInput);
+        } catch (Exception e) {
+            fail("update failed: " + e.getMessage());
+        }
+
+        assertNotNull(updateOutput);
+
+        readOperation = dbProvider.readNetworkElementConnectionList(readInput);
+        data = readOperation.getData();
+
+        assertEquals(true, data.get(0).isIsRequired());
+        assertEquals(url2, data.get(0).getHost());
+        assertEquals(port2, data.get(0).getPort().longValue());
+
+        // ==DELETE============================
+        System.out.println("Try delete...");
+
+        DeleteNetworkElementConnectionInput deleteInput = new DeleteNetworkElementConnectionInputBuilder().setId(dbId)
+                .build();
+        try {
+            dbProvider.deleteNetworkElementConnection(deleteInput);
+        } catch (Exception e) {
+            fail("problem deleting "+e.getMessage());
+        }
+
+        readInput = new ReadNetworkElementConnectionListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
+        readOperation = dbProvider.readNetworkElementConnectionList(readInput);
+        data = readOperation.getData();
+        assertEquals(0, data.size());
+
+    }
+
+     @Test
+    public void testMaintenance() {
+        System.out.println("Starting Maintenance tests...");
+
+        // ==CLEAR BEFORE TEST============================
+        System.out.println("try to clear entry");
+        try {
+            dbRawProvider.doRemove(Entity.Maintenancemode.getName(), QueryBuilders.matchAllQuery());
+        } catch (Exception e) {
+            fail("problem deleting entry: " + e.getMessage());
+        }
+
+        // ==CREATE============================
+
+        final String nodeId = "Lorem Ipsum";
+        final boolean isActive = true;
+
+        CreateMaintenanceOutputBuilder create = null;
+        CreateMaintenanceInput input = new CreateMaintenanceInputBuilder().setNodeId(nodeId).setActive(isActive)
+                .build();
+        String dbId = null;
+        try {
+            create = dbProvider.createMaintenance(input);
+            dbId = create.getId();
+        } catch (Exception e) {
+            fail("Failed to create:" + e.getMessage());
+        }
+
+        System.out.println(dbId);
+        assertNotNull(create);
+        assertNotNull(dbId);
+
+        // ==READ===========================
+        System.out.println("Try read...");
+
+        ReadMaintenanceListInput readinput = new ReadMaintenanceListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
+        ReadMaintenanceListOutputBuilder readResult = dbProvider.readMaintenanceList(readinput);
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.maintenance.list.output.Data> data = readResult
+                .getData();
+
+        assertNotEquals(0, data.size());
+        assertNotNull(data);
+        assertEquals(nodeId, data.get(0).getNodeId());
+        assertEquals(isActive, data.get(0).isActive());
+
+        // ==UPDATE============================
+
+        System.out.println("Trying to update...");
+        final String nodeId2 = "Name2";
+        final boolean isActive2 = false;
+
+        UpdateMaintenanceInput updateInput = new UpdateMaintenanceInputBuilder().setId(dbId).setNodeId(nodeId2)
+                .setActive(isActive2).build();
+        UpdateMaintenanceOutputBuilder updateResult = null;
+        try {
+            updateResult = dbProvider.updateMaintenance(updateInput);
+        } catch (Exception e) {
+            fail("maintenance update failed..." + e.getMessage());
+        }
+
+        assertNotNull(updateResult);
+
+        // == VERIFY UPDATE============================
+        System.out.println("Verfify update...");
+        readResult = dbProvider.readMaintenanceList(readinput);
+        data = readResult.getData();
+
+        assertNotNull(data);
+        assertEquals(nodeId2, data.get(0).getNodeId());
+        assertEquals(isActive2, data.get(0).isActive());
+
+        // ==DELETE================================
+        System.out.println("Trying to delete...");
+
+        DeleteMaintenanceInput deleteInput = new DeleteMaintenanceInputBuilder().setId(dbId).build();
+        try {
+            dbProvider.deleteMaintenance(deleteInput);
+        } catch (Exception e) {
+            fail("Maintenance entry couldn't be deleted" + e.getMessage());
+        }
+
+        readResult = dbProvider.readMaintenanceList(readinput);
+        data = readResult.getData();
+
+        assertEquals(0, data.size());
+    }
+
+    @Test
+    public void testFaultLog() {
+
+        System.out.println("Starting fault log tests...");
+        String dbId = clearAndCreatefaultEntity("1", Entity.Faultlog.getName(), "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultlogInput", SeverityType.Critical);
+
+        // ==READ===========================
+        System.out.println("try to read entry");
+
+        ReadFaultlogListInput readinput = new ReadFaultlogListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
+
+        ReadFaultlogListOutputBuilder readResult = null;
+        try {
+            readResult = dbProvider.readFaultLogList(readinput);
+
+        } catch (Exception e) {
+            fail("Fault log not read: " + e.getMessage());
+        }
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data> data = readResult
+                .getData();
+
+        assertNotNull(data);
+        assertEquals(1, data.size());
+        assertEquals("signalIsLost", data.get(0).getProblem());
+        assertEquals("Critical", data.get(0).getSeverity().toString());
+        assertEquals("s1", data.get(0).getNodeId());
+
+      //== UPDATE ================================
+        System.out.println("try to update entry");
+
+        dbRawProvider.doUpdateOrCreate(Entity.Faultlog.getName(), "1", "{'problem': 'CableLOS', 'severity': 'Major', 'node-id': 'test4657-78'}");
+
+        System.out.println("try to search entry 1");
+        readinput = new ReadFaultlogListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-id").setFiltervalue("test").build()))
+                .setPagination(getPagination(20, 1)).build();
+
+      //== VERIFY UPDATE ================================
+        readResult = dbProvider.readFaultLogList(readinput);
+        data = readResult.getData();
+
+
+        assertNotNull(data);
+        System.out.println(data);
+        assertEquals(0, data.size());
+
+        System.out.println("try to search entry 2");
+
+        readinput = new ReadFaultlogListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-id").setFiltervalue("test*").build()))
+                .setPagination(getPagination(20, 1)).build();
+
+        readResult = dbProvider.readFaultLogList(readinput);
+        data = readResult.getData();
+
+
+        assertNotNull(data);
+        assertEquals(1, data.size());
+        assertEquals("CableLOS", data.get(0).getProblem());
+        assertEquals("Major", data.get(0).getSeverity().toString());
+        assertEquals("test4657-78", data.get(0).getNodeId());
+
+      //== DELETE ================================
+
+        System.out.println("try to clear entry");
+        try {
+            dbRawProvider.doRemove(Entity.Faultlog.getName(), dbId);
+        } catch (Exception e) {
+            fail("problem deleting entry: " + e.getMessage());
+        }
+
+      //== VERIFY DELETE ===========================
+        System.out.println("verify entries deleted");
+        readResult = dbProvider.readFaultLogList(new ReadFaultlogListInputBuilder().setPagination(getPagination(20, 1)).build());
+        data = readResult.getData();
+        assertEquals(0, data.size());
+    }
+
+    @Test
+    public void testFaultCurrent() {
+        System.out.println("Starting faultCurrent test...");
+         String dbId = null;
+         dbId = clearAndCreatefaultEntity("1", Entity.Faultcurrent.getName(), "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", SeverityType.NonAlarmed);
+         assertEquals("1", dbId);
+
+        // ==READ===========================
+         System.out.println("Trying to read...");
+
+
+        ReadFaultcurrentListInput readinput = new ReadFaultcurrentListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
+
+        ReadFaultcurrentListOutputBuilder readResult = null;
+        try {
+            readResult = dbProvider.readFaultCurrentList(readinput);
+
+        } catch (Exception e) {
+            fail("Fault log not read: " + e.getMessage());
+        }
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data> data = readResult
+                .getData();
+
+
+        assertNotNull(data);
+        assertEquals(1, data.size());
+        assertEquals("signalIsLost", data.get(0).getProblem());
+        assertEquals("NonAlarmed", data.get(0).getSeverity().toString());
+        assertEquals("s1", data.get(0).getNodeId());
+        assertEquals(4340, data.get(0).getCounter().intValue());
+        assertEquals(new DateAndTime("2019-10-28T11:55:58.3Z"), data.get(0).getTimestamp());
+        assertEquals(4340, data.get(0).getCounter().intValue());
+        assertEquals("LP-MWPS-RADIO", data.get(0).getObjectId());
+
+
+        // ==UPDATE============================
+        System.out.println("Trying to update...");
+
+        String json = "{\n" +
+                "\"timestamp\": \"2019-12-28T11:55:58.3Z\",\n" +
+                "\"node-id\": \"SDN-Controller-0\",\n" +
+                "\"counter\": 75,\n" +
+                "\"problem\": \"connectionLossNeOAM\",\n" +
+                "}";
+
+        String updatedDbId = dbRawProvider.doUpdateOrCreate(Entity.Faultcurrent.getName(), dbId, json);
+        assertEquals(dbId, updatedDbId);
+
+        // ==READ============================
+
+        try {
+            readResult = dbProvider.readFaultCurrentList(readinput);
+
+        } catch (Exception e) {
+            fail("Fault log not read: " + e.getMessage());
+        }
+
+        data = readResult.getData();
+
+        assertNotNull(data);
+        assertEquals(1, data.size());
+        assertEquals("connectionLossNeOAM", data.get(0).getProblem());
+        assertEquals("SDN-Controller-0", data.get(0).getNodeId());
+        assertEquals(75, data.get(0).getCounter().intValue());
+        assertEquals("LP-MWPS-RADIO", data.get(0).getObjectId());
+
+        // ==DELETE============================
+        try {
+            dbRawProvider.doRemove(Entity.Faultcurrent.getName(), QueryBuilders.matchAllQuery());
+        } catch (Exception e) {
+            fail("problem deleting: " + e.getMessage());
+        }
+
+        // ==READ/VERIFY DELETE============================
+
+        try {
+            readResult = dbProvider.readFaultCurrentList(readinput);
+
+        } catch (Exception e) {
+            fail("Fault log not read: " + e.getMessage());
+        }
+
+        data = readResult.getData();
+
+        assertNotNull(data);
+        assertEquals(0, data.size());
+    }
+
+    @Test
+    public void testConnectionLog() {
+
+        // ==CLEAR================================
+        System.out.println("Clear before test");
+         try {
+             dbRawProvider.doRemove(Entity.Connectionlog.getName(), QueryBuilders.matchAllQuery());
+         } catch (Exception e) {
+             fail("problem deleting: " + e.getMessage());
+         }
+
+        // ==CREATE================================
+
+        System.out.println("Try create entry");
+        final String initialDbId = "1";
+        String dbId = null;
+        String json ="{\n" +
+                "\"timestamp\": \"2019-11-01T11:28:34.7Z\",\n" +
+                "\"status\": \"Connecting\",\n" +
+                "\"node-id\": \"sim2230\",\n" +
+                "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateConnectionlogInput\"\n" +
+                "}";
+
+        dbId = dbRawProvider.doUpdateOrCreate(Entity.Connectionlog.getName(), initialDbId, json);
+
+        assertEquals(initialDbId, dbId);
+
+        // ==READ================================
+        System.out.println("Try read entry");
+
+        ReadConnectionlogListInput readinput = new ReadConnectionlogListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
+
+        ReadConnectionlogListOutputBuilder readResult = null;
+        try {
+            readResult = dbProvider.readConnectionlogList(readinput);
+
+        } catch (Exception e) {
+            fail("Connection log not read: " + e.getMessage());
+        }
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.connectionlog.list.output.Data> data = readResult
+                .getData();
+
+        assertNotNull(data);
+        assertEquals(1, data.size());
+        assertEquals("Connecting", data.get(0).getStatus().toString());
+        assertEquals("sim2230", data.get(0).getNodeId());
+
+
+        // ==UPDATE================================
+        System.out.println("Try update entry");
+
+        dbRawProvider.doUpdateOrCreate(Entity.Connectionlog.getName(), dbId, "{'status' : 'Connected'}");
+
+        // ==READ 2================================
+        System.out.println("Try read updated entry");
+
+        readinput = new ReadConnectionlogListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("status").setFiltervalue("Connected").build()))
+                .setPagination(getPagination(20, 1)).build();
+
+        try {
+            readResult = dbProvider.readConnectionlogList(readinput);
+
+        } catch (Exception e) {
+            fail("Connection log not read: " + e.getMessage());
+        }
+
+        data = readResult.getData();
+
+        assertNotNull(data);
+        assertEquals(1, data.size());
+        assertEquals("Connected", data.get(0).getStatus().toString());
+        assertEquals("sim2230", data.get(0).getNodeId());
+
+      //== DELETE ================================
+
+           System.out.println("try to clear entry");
+           try {
+               dbRawProvider.doRemove(Entity.Connectionlog.getName(), dbId);
+           } catch (Exception e) {
+               fail("problem deleting entry: " + e.getMessage());
+           }
+
+         //== VERIFY DELETE ===========================
+           System.out.println("verify entries deleted");
+           readResult = dbProvider.readConnectionlogList(new ReadConnectionlogListInputBuilder().setPagination(getPagination(20, 1)).build());
+           data = readResult.getData();
+           assertEquals(0, data.size());
+
+    }
+
+     @Test
+    public void testEventLog() {
+        System.out.println("Test event log starting...");
+
+        // ==CLEAR================================
+        System.out.println("Clear before test");
+         try {
+             dbRawProvider.doRemove(Entity.Eventlog.getName(), QueryBuilders.matchAllQuery());
+         } catch (Exception e) {
+             fail("problem deleting: " + e.getMessage());
+         }
+        // ==CREATE============================
+
+         String dbId = null;
+        String json = " {\n" +
+                "\"timestamp\": \"2019-11-08T16:39:23.0Z\",\n" +
+                "\"new-value\": \"done\",\n" +
+                "\"object-id\": \"SDN-Controller-0\",\n" +
+                "\"attribute-name\": \"startup\",\n" +
+                "\"counter\": 0,\n" +
+                "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Eventlog\",\n" +
+                "\"node-id\": \"SDN-Controller-0\"\n" +
+                "}";
+
+        dbId = dbRawProvider.doUpdateOrCreate(Entity.Eventlog.getName(), "1", json);
+        assertNotNull(dbId);
+
+        // ==READ===========================
+
+        ReadEventlogListInput readinput = new ReadEventlogListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
+        ReadEventlogListOutputBuilder readResult = null;
+        try {
+             readResult = dbProvider.readEventlogList(readinput);
+
+        } catch (Exception e) {
+            fail("problem reading eventlog");
+        }
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.eventlog.list.output.Data> data = readResult.getData();
+        assertEquals(1,data.size());
+
+        //== DELETE ================================
+
+          System.out.println("try to clear entry");
+          try {
+              dbRawProvider.doRemove(Entity.Eventlog.getName(), dbId);
+          } catch (Exception e) {
+              fail("problem deleting entry: " + e.getMessage());
+          }
+
+        //== VERIFY DELETE ===========================
+          System.out.println("verify entries deleted");
+          try {
+            readResult = dbProvider.readEventlogList(new ReadEventlogListInputBuilder().setPagination(getPagination(20, 1)).build());
+        } catch (IOException e) {
+            fail("problem reading eventlog");
+        }
+          data = readResult.getData();
+          assertEquals(0, data.size());
+
+    }
+
+     @Test
+    public void testInventory() {
+
+         System.out.println("Test inventory starting...");
+
+         // ==CLEAR================================
+         System.out.println("Clear before test");
+          try {
+              dbRawProvider.doRemove(Entity.Inventoryequipment.getName(), QueryBuilders.matchAllQuery());
+          } catch (Exception e) {
+              fail("problem deleting: " + e.getMessage());
+          }
+
+
+        // ==CREATE============================
+
+         String dbId = null;
+         String json = " {\"tree-level\": 1,\n" +
+                 "    \"parent-uuid\": \"SHELF-1.1.0.0\",\n" +
+                 "    \"node-id\": \"sim2\",\n" +
+                 "    \"uuid\": \"CARD-1.1.8.0\",\n" +
+                 "    \"contained-holder\": [ ],\n" +
+                 "    \"manufacturer-name\": \"Lorem Ipsum\",\n" +
+                 "    \"manufacturer-identifier\": \"ONF-Wireless-Transport\",\n" +
+                 "    \"serial\": \"sd-dsa-eqw\",\n" +
+                 "    \"date\": \"2008-10-21T00:00:00.0Z\",\n" +
+                 "\"implemented-interface\": \"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory\",\n" +
+                 "    \"version\": \"unknown\",\n" +
+                 "    \"description\": \"WS/DS3\",\n" +
+                 "    \"part-type-id\": \"unknown\",\n" +
+                 "    \"model-identifier\": \"model-id-s3s\",\n" +
+                 "    \"type-name\": \"p4.module\"}";
+
+         dbId = dbRawProvider.doUpdateOrCreate(Entity.Inventoryequipment.getName(), "1 1", json);
+         assertNotNull(dbId);
+
+        // ==READ===========================
+         ReadInventoryListInput readinput = new ReadInventoryListInputBuilder()
+                .setFilter(Arrays.asList(new FilterBuilder().setProperty("id").setFiltervalue(dbId).build()))
+                .setPagination(getPagination(20, 1)).build();
+        ReadInventoryListOutputBuilder readResult = null;
+        try {
+             readResult = dbProvider.readInventoryList(readinput);
+
+        } catch (Exception e) {
+            fail("Problem reading inventory list"+e.getMessage());
+        }
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data> data = readResult.getData();
+        assertEquals(1,data.size());
+        assertEquals("Lorem Ipsum", data.get(0).getManufacturerName());
+        assertEquals("ONF-Wireless-Transport", data.get(0).getManufacturerIdentifier());
+        assertEquals("sim2", data.get(0).getNodeId());
+        assertEquals("unknown", data.get(0).getVersion());
+        assertEquals("WS/DS3", data.get(0).getDescription());
+        assertEquals("2008-10-21T00:00:00.0Z", data.get(0).getDate());
+        assertEquals("sd-dsa-eqw", data.get(0).getSerial());
+        System.out.println(data.get(0).getDate());
+
+        // ==UPDATE============================
+        String updatedDbId=null;
+        final String[] holderArray = {"Lorem Ipsum 1", "Lorem Ipsum 2", "Lorem Ipsum &%/$_2"};
+        String updatejson = " {" +
+                 "    \"node-id\": \"sim5\",\n" +
+                 "    \"contained-holder\": [ \"Lorem Ipsum 1\", \"Lorem Ipsum 2\", \"Lorem Ipsum &%/$_2\" ],\n" +
+                 "    \"serial\": \"sd-dsa-eww\",\n" +
+                 "    \"date\": \"2008-11-21T00:00:00.0Z\",\n" +
+                 "    \"part-type-id\": \"not unknown\",\n" +
+                 "}";
+
+        updatedDbId = dbRawProvider.doUpdateOrCreate(Entity.Inventoryequipment.getName(), dbId, updatejson);
+        assertEquals(dbId, updatedDbId);
+
+        try {
+            readResult = dbProvider.readInventoryList(readinput);
+
+        } catch (Exception e) {
+            fail("Problem reading inventory list"+e.getMessage());
+        }
+
+        data = readResult.getData();
+
+        assertEquals(1,data.size());
+        assertEquals("Lorem Ipsum", data.get(0).getManufacturerName());
+        assertEquals("ONF-Wireless-Transport", data.get(0).getManufacturerIdentifier());
+        assertEquals("sim5", data.get(0).getNodeId());
+        assertEquals("not unknown", data.get(0).getPartTypeId());
+        assertEquals("WS/DS3", data.get(0).getDescription());
+        assertEquals("2008-11-21T00:00:00.0Z", data.get(0).getDate());
+        assertEquals("sd-dsa-eww", data.get(0).getSerial());
+        assertEquals(holderArray.length,data.get(0).getContainedHolder().size());
+        assertEquals(holderArray[0],data.get(0).getContainedHolder().get(0));
+        assertEquals(holderArray[1],data.get(0).getContainedHolder().get(1));
+        assertEquals(holderArray[2],data.get(0).getContainedHolder().get(2));
+
+        // ==DELETE============================
+
+        System.out.println("delete after test");
+        try {
+            dbRawProvider.doRemove(Entity.Inventoryequipment.getName(), QueryBuilders.matchAllQuery());
+        } catch (Exception e) {
+            fail("problem deleting: " + e.getMessage());
+        }
+
+     // ==VERIFY DELETE ============================
+
+        try {
+               readResult = dbProvider.readInventoryList(readinput);
+
+           } catch (Exception e) {
+               fail("Problem reading inventory list"+e.getMessage());
+           }
+
+           data = readResult.getData();
+           assertEquals(0,data.size());
+
+    }
+
+     @Test
+     public void test15MinPerformanceReadLtpListWithoutNodeIdSetThrowsException() {
+
+         System.out.println("Reading 15m ltp list without node id filter set throws an exception test start...");
+
+         try {
+             dbRawProvider.doRemove(Entity.Historicalperformance15min.getName(), QueryBuilders.matchAllQuery());
+         } catch (Exception e) {
+             fail("problem deleting: " + e.getMessage());
+         }
+
+         System.out.println("create entries...");
+
+         createPerformanceData("1", GranularityPeriodType.Period15Min, "PM_RADIO_15M_6", "LP-MWPS-TTP-02", "a2");
+         createPerformanceData("2", GranularityPeriodType.Period15Min, "PM_RADIO_15M_4", "LP-MWPS-TTP-01", "a2");
+
+         createPerformanceData("4", GranularityPeriodType.Period15Min, "PM_RADIO_15M_6", "LP-MWPS-TTP-02", "a3");
+         createPerformanceData("5", GranularityPeriodType.Period15Min, "PM_RADIO_15M_4", "LP-MWPS-TTP-01", "a3");
+         createPerformanceData("6", GranularityPeriodType.Period15Min, "PM_RADIO_15M_7", "LP-MWPS-TTP-03", "a3");
+         createPerformanceData("3", GranularityPeriodType.Period15Min, "PM_RADIO_15M_7", "LP-MWPS-TTP-05", "a3");
+
+         System.out.println("trying to read, should throw exception...");
+
+
+         ReadPmdata15mLtpListInput readLtp = new ReadPmdata15mLtpListInputBuilder()
+                 .setPagination(getPagination(20, 1)).build();
+
+         ReadPmdata15mLtpListOutputBuilder readltpResult = null;
+
+         try {
+            readltpResult = dbProvider.readPmdata15mLtpList(readLtp);
+            fail("No exception thrown!");
+        } catch (Exception e) {
+            System.out.println(e);
+            assertTrue(e instanceof IllegalArgumentException);
+            assertEquals("no nodename in filter found ", e.getMessage());
+        }
+
+         assertNull(readltpResult);
+
+          //== DELETE ================================
+
+            System.out.println("try to clear entry");
+            try {
+                dbRawProvider.doRemove(Entity.Historicalperformance15min.getName(), QueryBuilders.matchAllQuery());
+            } catch (Exception e) {
+                fail("problem deleting entry: " + e.getMessage());
+            }
+
+          //== VERIFY DELETE ===========================
+            System.out.println("verify entries deleted");
+            List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> data = dbProvider.readPmdata15mList(new ReadPmdata15mListInputBuilder()
+                    .setPagination(getPagination(20, 1)).build()).getData();
+
+            assertEquals(0, data.size());
+     }
+
+     @Test
+     public void test15MinPerformanceData() {
+        // == CLEAR BEFORE TESTS ============================
+         System.out.println("Test 15 min performance...");
+
+         try {
+             dbRawProvider.doRemove(Entity.Historicalperformance15min.getName(), QueryBuilders.matchAllQuery());
+         } catch (Exception e) {
+             fail("problem deleting: " + e.getMessage());
+         }
+
+        // == CREATE ============================
+
+         System.out.println("create entries...");
+
+         createPerformanceData("1", GranularityPeriodType.Period15Min, "PM_RADIO_15M_6", "LP-MWPS-TTP-02", "a2");
+         createPerformanceData("2", GranularityPeriodType.Period15Min, "PM_RADIO_15M_4", "LP-MWPS-TTP-01", "a2");
+
+         createPerformanceData("4", GranularityPeriodType.Period15Min, "PM_RADIO_15M_6", "LP-MWPS-TTP-02", "a3");
+         createPerformanceData("5", GranularityPeriodType.Period15Min, "PM_RADIO_15M_4", "LP-MWPS-TTP-01", "a3");
+         createPerformanceData("6", GranularityPeriodType.Period15Min, "PM_RADIO_15M_7", "LP-MWPS-TTP-03", "a3");
+         createPerformanceData("3", GranularityPeriodType.Period15Min, "PM_RADIO_15M_7", "LP-MWPS-TTP-05", "a3");
+
+        // == READ ============================
+         System.out.println("read list entries...");
+
+         ReadPmdata15mListInput read = new ReadPmdata15mListInputBuilder()
+                 .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build()))
+                 .setPagination(getPagination(20, 1)).build();
+
+         ReadPmdata15mListOutputBuilder readResult = null;
+
+         try {
+             readResult = dbProvider.readPmdata15mList(read);
+        } catch (Exception e) {
+            fail("Problem reading 15m data");
+        }
+
+          List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> data = readResult
+                  .getData();
+
+          assertNotNull(data);
+          assertEquals(2, data.size());
+
+          System.out.println("read ltp entries with node name set...");
+
+          ReadPmdata15mLtpListInput readLtp = new ReadPmdata15mLtpListInputBuilder()
+                  .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build()))
+                  .setPagination(getPagination(20, 1)).build();
+
+          ReadPmdata15mLtpListOutputBuilder readltpResult = null;
+
+          try {
+             readltpResult = dbProvider.readPmdata15mLtpList(readLtp);
+         } catch (Exception e) {
+             fail("Problem reading 15m ltp data");
+         }
+
+          List<String> dataLtp = readltpResult.getData();
+
+          assertNotNull(dataLtp);
+         assertEquals(2, dataLtp.size());
+         assertTrue(dataLtp.contains("LP-MWPS-TTP-02"));
+         assertTrue(dataLtp.contains("LP-MWPS-TTP-01"));
+
+         System.out.println("read device entries...");
+
+         ReadPmdata15mDeviceListInput readDevices = new ReadPmdata15mDeviceListInputBuilder()
+                   .setPagination(getPagination(20, 1)).build();
+
+           ReadPmdata15mDeviceListOutputBuilder readDeviceResult = null;
+
+           try {
+              readDeviceResult = dbProvider.readPmdata15mDeviceList(readDevices);
+          } catch (Exception e) {
+              fail("Problem reading 15m device data");
+          }
+
+            List<String> dataDevice = readDeviceResult.getData();
+
+            assertNotNull(dataDevice);
+          assertEquals(2, dataDevice.size());
+          assertTrue(dataDevice.contains("a2"));
+          assertTrue(dataDevice.contains("a3"));
+
+          //== DELETE ================================
+
+            System.out.println("try to clear entry");
+            try {
+                dbRawProvider.doRemove(Entity.Historicalperformance15min.getName(), QueryBuilders.matchAllQuery());
+            } catch (Exception e) {
+                fail("problem deleting entry: " + e.getMessage());
+            }
+
+          //== VERIFY DELETE ===========================
+            System.out.println("verify entries deleted");
+            readResult = dbProvider.readPmdata15mList(new ReadPmdata15mListInputBuilder()
+                    .setPagination(getPagination(20, 1)).build());
+            data = readResult.getData();
+            assertEquals(0, data.size());
+
+     }
+
+     @Test
+     public void test24hPerformanceData() {
+         System.out.println("Test 24h performance...");
+
+         try {
+             dbRawProvider.doRemove(Entity.Historicalperformance24h.getName(), QueryBuilders.matchAllQuery());
+         } catch (Exception e) {
+             fail("problem deleting: " + e.getMessage());
+         }
+
+         System.out.println("create entries...");
+         GranularityPeriodType timeInterval = GranularityPeriodType.Period24Hours;
+         createPerformanceData("1", timeInterval, "PM_RADIO_15M_6", "LP-MWPS-TTP-02", "a2");
+         createPerformanceData("2", timeInterval, "PM_RADIO_15M_4", "LP-MWPS-TTP-01", "a2");
+         String aDbId = createPerformanceData("4", timeInterval, "PM_RADIO_15M_6", "LP-MWPS-TTP-06", "a2");
+
+         createPerformanceData("5", timeInterval, "PM_RADIO_15M_4", "LP-MWPS-TTP-01", "a3");
+         createPerformanceData("6", timeInterval, "PM_RADIO_15M_7", "LP-MWPS-TTP-03", "a3");
+         createPerformanceData("3", timeInterval, "PM_RADIO_15M_7", "LP-MWPS-TTP-05", "a3");
+
+         System.out.println("read all list entries...");
+
+         ReadPmdata24hListInput read = new ReadPmdata24hListInputBuilder()
+                 .setPagination(getPagination(20, 1)).build();
+
+         ReadPmdata24hListOutputBuilder readResult = null;
+
+         try {
+             readResult = dbProvider.readPmdata24hList(read);
+        } catch (Exception e) {
+            fail("Problem reading 24h data");
+        }
+
+         List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._24h.list.output.Data> data = readResult
+                 .getData();
+
+         assertNotNull(data);
+         assertEquals(6, data.size());
+
+
+         System.out.println("filter list entries...");
+
+          read = new ReadPmdata24hListInputBuilder()
+                 .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build()))
+                 .setPagination(getPagination(20, 1)).build();
+
+          readResult = null;
+
+         try {
+             readResult = dbProvider.readPmdata24hList(read);
+        } catch (Exception e) {
+            fail("Problem reading 24h data");
+        }
+
+         data = readResult.getData();
+
+          assertNotNull(data);
+          assertEquals(3, data.size());
+
+          System.out.println("read ltp entries with node name set...");
+
+          ReadPmdata24hLtpListInput readLtp = new ReadPmdata24hLtpListInputBuilder()
+                   .setFilter(Arrays.asList(new FilterBuilder().setProperty("node-name").setFiltervalue("a2").build()))
+                   .setPagination(getPagination(20, 1)).build();
+
+           ReadPmdata24hLtpListOutputBuilder readltpResult = null;
+
+           try {
+              readltpResult = dbProvider.readPmdata24hLtpList(readLtp);
+          } catch (Exception e) {
+              fail("Problem reading 24h ltp data");
+          }
+
+           List<String> dataLtp = readltpResult.getData();
+
+            assertNotNull(dataLtp);
+            assertEquals(3, dataLtp.size());
+            assertTrue(dataLtp.contains("LP-MWPS-TTP-02"));
+            assertTrue(dataLtp.contains("LP-MWPS-TTP-01"));
+            assertTrue(dataLtp.contains("LP-MWPS-TTP-06"));
+
+
+            System.out.println("read device entries...");
+
+            ReadPmdata24hDeviceListInput readDevices = new ReadPmdata24hDeviceListInputBuilder()
+                       .setPagination(getPagination(20, 1)).build();
+
+               ReadPmdata24hDeviceListOutputBuilder readDeviceResult = null;
+
+               try {
+                  readDeviceResult = dbProvider.readPmdata24hDeviceList(readDevices);
+              } catch (Exception e) {
+                  fail("Problem reading 24h device data");
+              }
+
+                List<String> dataDevice = readDeviceResult.getData();
+
+                assertNotNull(dataDevice);
+              assertEquals(2, dataDevice.size());
+              assertTrue(dataDevice.contains("a2"));
+              assertTrue(dataDevice.contains("a3"));
+
+              // == UPDATE ==============================
+
+              String shouldbeEmpty = dbRawProvider.doUpdate(Entity.Historicalperformance24h.getName(), "{'uuid-interface':'LTP-TEST-MWP-097'}", QueryBuilders.termQuery("_id", aDbId));
+              assertEquals("",shouldbeEmpty);
+              try {
+              readltpResult = dbProvider.readPmdata24hLtpList(readLtp);
+        } catch (Exception e) {
+            fail("Problem reading 24h ltp data");
+        }
+
+              // == VERIFY UPDATE ==============================
+
+              dataLtp = readltpResult.getData();
+
+              assertNotNull(dataLtp);
+             assertEquals(3, dataLtp.size());
+             assertTrue(dataLtp.contains("LP-MWPS-TTP-02"));
+             assertTrue(dataLtp.contains("LP-MWPS-TTP-01"));
+             assertTrue(dataLtp.contains("LTP-TEST-MWP-097"));
+
+
+
+              //== DELETE ===========================
+
+              System.out.println("try to clear entries");
+              try {
+                  dbRawProvider.doRemove(Entity.Historicalperformance24h.getName(), QueryBuilders.matchAllQuery());
+              } catch (Exception e) {
+                  fail("problem deleting entry: " + e.getMessage());
+              }
+
+            //== VERIFY DELETE ===========================
+              System.out.println("verify entries deleted");
+              readResult = dbProvider.readPmdata24hList(new ReadPmdata24hListInputBuilder()
+                      .setPagination(getPagination(20, 1)).build());
+              data = readResult.getData();
+              assertEquals(0, data.size());
+     }
+
+     @Test
+     public void test24hPerformanceDataReadLtpListWithoutNodeIdSetThrowsException() {
+         System.out.println("Test 24 hour tp list without node id filter set throws an exception test start...\"...");
+
+         try {
+             dbRawProvider.doRemove(Entity.Historicalperformance24h.getName(), QueryBuilders.matchAllQuery());
+         } catch (Exception e) {
+             fail("problem deleting: " + e.getMessage());
+         }
+
+         System.out.println("create entries...");
+
+         GranularityPeriodType timeInterval = GranularityPeriodType.Period24Hours;
+         createPerformanceData("1", timeInterval, "PM_RADIO_15M_6", "LP-MWPS-TTP-02", "a2");
+         createPerformanceData("2", timeInterval, "PM_RADIO_15M_4", "LP-MWPS-TTP-01", "a2");
+
+         createPerformanceData("4", timeInterval, "PM_RADIO_15M_6", "LP-MWPS-TTP-02", "a3");
+         createPerformanceData("5", timeInterval, "PM_RADIO_15M_4", "LP-MWPS-TTP-01", "a3");
+         createPerformanceData("6", timeInterval, "PM_RADIO_15M_7", "LP-MWPS-TTP-03", "a3");
+         createPerformanceData("3", timeInterval, "PM_RADIO_15M_7", "LP-MWPS-TTP-05", "a3");
+
+         System.out.println("trying to read, should throw exception...");
+
+
+         ReadPmdata24hLtpListInput readLtp = new ReadPmdata24hLtpListInputBuilder()
+                 .setPagination(getPagination(20, 1)).build();
+
+         ReadPmdata24hLtpListOutputBuilder readltpResult = null;
+
+         try {
+            readltpResult = dbProvider.readPmdata24hLtpList(readLtp);
+            fail("No exception thrown!");
+        } catch (Exception e) {
+            System.out.println(e);
+            assertTrue(e instanceof IllegalArgumentException);
+            assertEquals("no nodename in filter found ", e.getMessage());
+        }
+
+         assertNull(readltpResult);
+
+         try {
+             dbRawProvider.doRemove(Entity.Historicalperformance24h.getName(), QueryBuilders.matchAllQuery());
+         } catch (Exception e) {
+             fail("problem deleting: " + e.getMessage());
+         }
+     }
+
+    @Test
+    public void testUrlEncoding() {
+        System.out.println("Testing url encding");
+
+        final String test = "Lorem Ipsum";
+        final String test1 = "Lorem/Ipsum";
+        final String test2 = "Lorem_Ipsum";
+        final String test3 = "Lorem%Ipsum";
+
+        assertEquals("Lorem%20Ipsum", BaseRequest.urlEncodeValue(test));
+        assertEquals("Lorem%2FIpsum", BaseRequest.urlEncodeValue(test1));
+        assertEquals("Lorem_Ipsum", BaseRequest.urlEncodeValue(test2));
+        assertEquals("Lorem%25Ipsum", BaseRequest.urlEncodeValue(test3));
+    }
+
+    @Test
+    public void testDoUpdateOrCreateWithNullId() {
+        System.out.println("Test DoUpdateOrCreate doesn't create new database entry if null is passed");
+
+        String dbId = clearAndCreatefaultEntity(null, Entity.Faultlog.getName(), "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultlogInput", SeverityType.Critical);
+        assertNull(dbId);
+    }
+
+    @Test
+    public void readTestFaultCurrentViaRawDbProvider() {
+        System.out.println("Starting faultCurrent test...");
+        String dbId = null;
+        dbId = clearAndCreatefaultEntity("1", Entity.Faultcurrent.getName(), "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput", SeverityType.Critical);
+        assertEquals("1", dbId);
+
+       // ==READ===========================
+        System.out.println("Trying to read...");
+
+       String readResult = null;
+       try {
+           readResult = dbRawProvider.doReadJsonData(Entity.Faultcurrent.getName(), dbId);
+
+       } catch (Exception e) {
+           fail("Fault log not read: " + e.getMessage());
+       }
+
+
+       String expectedDbResult ="{\"severity\":\"Critical\",\"node-id\":\"s1\",\"problem\":\"signalIsLost\",\"counter\":4340,\"object-id\":\"LP-MWPS-RADIO\",\"implemented-interface\":\"org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateFaultcurrentInput\",\"type\":\"ProblemNotificationXml\",\"timestamp\":\"2019-10-28T11:55:58.3Z\"}";
+
+       System.out.println(readResult);
+       assertNotNull(readResult);
+       assertEquals(expectedDbResult, readResult);
+
+       SearchResult<SearchHit> searchResult = dbRawProvider.doReadAllJsonData(Entity.Faultcurrent.getName());
+       assertNotNull(searchResult);
+
+       List<SearchHit> hits = searchResult.getHits();
+
+       assertNotNull(hits);
+       assertEquals(1, searchResult.getTotal());
+       assertEquals(expectedDbResult, hits.get(0).getSourceAsString());
+
+       //== DELETE ==============================
+       try {
+           dbRawProvider.doRemove(Entity.Faultcurrent.getName(), QueryBuilders.matchAllQuery());
+       } catch (Exception e) {
+           fail("problem deleting: " + e.getMessage());
+       }
+       //== VERIFY DELETE ========================
+       searchResult = dbRawProvider.doReadAllJsonData(Entity.Faultcurrent.getName());
+        hits = searchResult.getHits();
+        assertNotNull(hits);
+        assertEquals(0, searchResult.getTotal());
+
+    }
+
+
+    private Pagination getPagination(long pageSize, int page) {
+        return new PaginationBuilder().setPage(BigInteger.valueOf(page)).setSize(pageSize).build();
+    }
+
+
+    private String clearAndCreatefaultEntity(String initialDbId,  String entityType, String implementedInterface, SeverityType severity) {
+        // ==CLEAR BEFORE TEST============================
+        System.out.println("try to clear entry");
+        try {
+            dbRawProvider.doRemove(entityType, QueryBuilders.matchAllQuery());
+        } catch (Exception e) {
+            fail("problem deleting: " + e.getMessage());
+        }
+
+
+        return createFaultEntity(initialDbId, entityType, implementedInterface, severity);
+    }
+
+    private String createFaultEntity(String initialDbId,  String entityType, String implementedInterface, SeverityType severity) {
+         // ==CREATE============================
+        System.out.println("try to create entry");
+        String dbId = null;
+
+        try {
+
+            dbId = dbRawProvider.doUpdateOrCreate(entityType, initialDbId,"{\n" +
+                    "\"timestamp\": \"2019-10-28T11:55:58.3Z\",\n" +
+                    "\"object-id\": \"LP-MWPS-RADIO\",\n" +
+                    "\"severity\": \""+severity.toString()+"\",\n" +
+                    "\"node-id\": \"s1\",\n" +
+                    "\"implemented-interface\": \""+implementedInterface+"\",\n" +
+                    "\"counter\": 4340,\n" +
+                    "\"problem\": \"signalIsLost\",\n" +
+                    "\"type\": \"ProblemNotificationXml\"\n" +
+                    "}");
+
+
+
+        } catch (Exception e) {
+            fail("Problem creating fault log entry" + e.getMessage());
+        }
+
+        return dbId;
+    }
+
+    private String createPerformanceData(String initialDbId, GranularityPeriodType timeInterval, String scannerId, String uuidInterface, String nodename) {
+
+        String json = "{\n" +
+                "\"node-name\": \""+nodename+"\",\n" +
+                "\"uuid-interface\": \""+uuidInterface+"\",\n" +
+                "\"layer-protocol-name\": \"MWPS\",\n" +
+                "\"radio-signal-id\": \"Test8\",\n" +
+                "\"time-stamp\": \"2017-03-01T06:15:00.0Z\",\n" +
+                "\"granularity-period\": \""+timeInterval.toString()+"\",\n" +
+                "\"scanner-id\": \""+scannerId+"\",\n" +
+                "\"performance-data\": {\n" +
+                "\"cses\": 0,\n" +
+                "\"ses\": 0,\n" +
+                "\"es\": 0,\n" +
+                "\"tx-level-max\": 3,\n" +
+                "\"tx-level-avg\": 3,\n" +
+                "\"rx-level-min\": -44,\n" +
+                "\"rx-level-max\": -45,\n" +
+                "\"rx-level-avg\": -44,\n" +
+                "\"time2-states\": 0,\n" +
+                "\"time4-states-s\": 0,\n" +
+                "\"time4-states\": 0,\n" +
+                "\"time8-states\": -1,\n" +
+                "\"time16-states-s\": -1,\n" +
+                "\"time16-states\": 0,\n" +
+                "\"time32-states\": -1,\n" +
+                "\"time64-states\": 900,\n" +
+                "\"time128-states\": -1,\n" +
+                "\"time256-states\": -1,\n" +
+                "\"time512-states\": -1,\n" +
+                "\"time512-states-l\": -1,\n" +
+                "\"unavailability\": 0,\n" +
+                "\"tx-level-min\": 3,\n" +
+                "\"time1024-states\": -1,\n" +
+                "\"time1024-states-l\": -1,\n" +
+                "\"time2048-states\": -1,\n" +
+                "\"time2048-states-l\": -1,\n" +
+                "\"time4096-states\": -1,\n" +
+                "\"time4096-states-l\": -1,\n" +
+                "\"time8192-states\": -1,\n" +
+                "\"time8192-states-l\": -1,\n" +
+                "\"snir-min\": -99,\n" +
+                "\"snir-max\": -99,\n" +
+                "\"snir-avg\": -99,\n" +
+                "\"xpd-min\": -99,\n" +
+                "\"xpd-max\": -99,\n" +
+                "\"xpd-avg\": -99,\n" +
+                "\"rf-temp-min\": -99,\n" +
+                "\"rf-temp-max\": -99,\n" +
+                "\"rf-temp-avg\": -99,\n" +
+                "\"defect-blocks-sum\": -1,\n" +
+                "\"time-period\": 900\n" +
+                "},\n" +
+                "\"suspect-interval-flag\": false\n" +
+                "}";
+
+        if(timeInterval.equals(GranularityPeriodType.Period15Min)) {
+            return dbRawProvider.doUpdateOrCreate(Entity.Historicalperformance15min.getName(), initialDbId, json);
+        }else {
+            return dbRawProvider.doUpdateOrCreate(Entity.Historicalperformance24h.getName(), initialDbId, json);
+        }
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestConfig.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestConfig.java
new file mode 100644
index 0000000..7ff547f
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestConfig.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.impl.EsConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TestConfig {
+
+    private static final Logger LOG = LoggerFactory.getLogger(TestConfig.class);
+
+    private static final String TESTFILENAME = "testconfig.properties";
+
+    @After
+    @Before
+    public void afterAndBefore() {
+        File f=new File(TESTFILENAME);
+        if(f.exists()) {
+            LOG.info("Remove {}", f.getAbsolutePath());
+            f.delete();
+        }
+    }
+    @Test
+    public void test() {
+        ConfigurationFileRepresentation configuration=new ConfigurationFileRepresentation(TESTFILENAME);
+
+        EsConfig esConfig = new EsConfig(configuration);
+        LOG.info("Defaultconfiguration: {}", esConfig.toString());
+        assertEquals("http", esConfig.getHosts()[0].protocol.getValue());
+        assertEquals(9200, esConfig.getHosts()[0].port);
+        assertEquals("sdnrdb", esConfig.getHosts()[0].hostname);
+
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestConfiguration.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestConfiguration.java
new file mode 100644
index 0000000..62d2bb5
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestConfiguration.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * ============LICENSE_START======================================================= ONAP : ccsdk
+ * feature sdnr wt ================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * ================================================================================ Licensed under
+ * the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License. ============LICENSE_END=========================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.exception.ConfigurationException;
+import org.onap.ccsdk.features.sdnr.wt.common.util.ResourceFileLoader;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.impl.EsConfig;
+
+public class TestConfiguration {
+
+    private static final String CONFIGURATIONTESTFILE = "test.properties"; // for
+
+    @Test
+    public void test1() throws ConfigurationException {
+
+        System.out.println("Configuration file " + CONFIGURATIONTESTFILE);
+
+        File testConfigurationFile = ResourceFileLoader.getFile(this, CONFIGURATIONTESTFILE);
+        System.out.println("Located at: "+testConfigurationFile.getAbsolutePath());
+
+        ConfigurationFileRepresentation configuration = new ConfigurationFileRepresentation(testConfigurationFile);
+
+        System.out.println("Configuration: " + configuration.getSection(EsConfig.SECTION_MARKER_ES));
+        EsConfig esConfig1 = new EsConfig(configuration);
+
+        System.out.println("ES config getArchiveLifetimeSeconds: "+esConfig1.getArchiveLifetimeSeconds());
+
+
+        // fail("Not yet implemented");
+    }
+
+    @Test
+    public void test2() {
+
+    }
+
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestDataMappings.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestDataMappings.java
new file mode 100644
index 0000000..5171aed
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestDataMappings.java
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import java.io.IOException;
+import java.util.List;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.database.DatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchHit;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.SearchResponse;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.EsDataObjectReaderWriter;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+
+public class TestDataMappings {
+
+	private static final HostInfo[] HOSTINFOS = new HostInfo[] {HostInfo.getDefault()};
+	//public static final String ESDATATYPENAME = "faultcurrent";
+
+	private static class HtDatabaseClientHelper extends HtDatabaseClient {
+
+		private final String json;
+
+		public HtDatabaseClientHelper(String jsonResponse, HostInfo[] hosts) {
+			super(hosts);
+			this.json = jsonResponse;
+
+		}
+
+		@Override
+		public SearchResult<SearchHit> doReadByQueryJsonData(String dataTypeName, QueryBuilder qb) {
+			return new SearchResult<>(new SearchResponse(this.json).getHits());
+		}
+	}
+
+	private static class MapResult<T extends DataObject> {
+		public final List<T> mappedData;
+		public MapResult(String dataType, Class<T> cls, String dbJson) throws ClassNotFoundException {
+			System.out.println(dbJson);
+			DatabaseClient db = new HtDatabaseClientHelper(dbJson,HOSTINFOS);
+			EsDataObjectReaderWriter<T> dbrw=new EsDataObjectReaderWriter<>(db,dataType,cls);
+			this.mappedData=dbrw.doReadAll().getHits();
+		}
+	}
+
+	private static final String SEARCHJSON_FORMAT = "{\n" +
+			"\"took\": 0,\n" +
+			"\"timed_out\": false,\n" +
+			"\"_shards\": {\n" +
+			"\"total\": 5,\n" +
+			"\"successful\": 5,\n" +
+			"\"skipped\": 0,\n" +
+			"\"failed\": 0\n" +
+			"},\n" +
+			"\"hits\": {\n" +
+			"\"total\": 1,\n" +
+			"\"max_score\": 1,\n" +
+			"\"hits\": [\n" +
+			"{\n" +
+			"\"_index\": \"%s\",\n" +
+			"\"_type\": \"%s\",\n" +
+			"\"_id\": \"%s\",\n" +
+			"\"_score\": 1,\n" +
+			"\"_source\": %s}\n" +
+			"]\n" +
+			"}\n" +
+			"}";
+
+	private static final String MEDIATORSERVER_DB_ID="LumwSG0BFvcE3yf8MBM5";
+	private static final String MEDIATOR_SERVERDB_JSON = "{\"url\":\"https://10.45.44.223:7590\",\"name\":\"test mediator server\"}";
+
+	private static final String FAULTCURRENT_DB_ID="LumwSG0BFvcE3yf8MBM5";
+	private static final String FAULTCURRENT_DB_NODEID = "sim1";
+	private static final int FAULTCURRENT_DB_COUNTER = 3;
+	private static final String FAULTCURRENT_DB_OBJECTID = "LPS-MWT-01";
+	private static final String FAULTCURRENT_DB_PROBLEM = "rlsExceeded";
+	private static final String FAULTCURRENT_DB_SEVERITY = "critical";
+	private static final DateAndTime FAULTCURRENT_DB_TIMESTAMP = DateAndTime.getDefaultInstance("2019-09-18T13:07:05.8Z");
+
+	private static final String FAULTCURRENT_SERVERDB_JSON = "{\"node-id\":\""+FAULTCURRENT_DB_NODEID+"\","+
+			"\"counter\":"+FAULTCURRENT_DB_COUNTER+","+
+			"\"object-id\":\""+FAULTCURRENT_DB_OBJECTID+"\","+
+			"\"problem\":\""+FAULTCURRENT_DB_PROBLEM+"\","+
+			"\"timestamp\":\""+FAULTCURRENT_DB_TIMESTAMP.getValue()+"\","+
+			"\"severity\":\""+FAULTCURRENT_DB_SEVERITY+"\""+
+	"}";
+
+
+	private static final String PMDATA15M_SERVERDB_JSON="{\n" +
+			"\"node-name\": \"sim2\",\n" +
+			"\"uuid-interface\": \"LP-MWPS-TTP-01\",\n" +
+			"\"layer-protocol-name\": \"MWPS\",\n" +
+			"\"radio-signal-id\": \"Test11\",\n" +
+			"\"time-stamp\": \"2017-07-04T14:00:00.0Z\",\n" +
+			"\"granularity-period\": \"PERIOD_15MIN\",\n" +
+			"\"scanner-id\": \"PM_RADIO_15M_9\",\n" +
+			"\"performance-data\": {\n" +
+			"\"es\": 0,\n" +
+			"\"rx-level-avg\": -41,\n" +
+			"\"time2-states\": -1,\n" +
+			"\"time4-states-s\": 0,\n" +
+			"\"time4-states\": 0,\n" +
+			"\"time8-states\": 0,\n" +
+			"\"time16-states-s\": -1,\n" +
+			"\"time16-states\": 0,\n" +
+			"\"time32-states\": 0,\n" +
+			"\"time64-states\": 0,\n" +
+			"\"time128-states\": 0,\n" +
+			"\"time256-states\": 900,\n" +
+			"\"time512-states\": -1,\n" +
+			"\"time512-states-l\": -1,\n" +
+			"\"time1024-states\": -1,\n" +
+			"\"time1024-states-l\": -1,\n" +
+			"\"time2048-states\": -1,\n" +
+			"\"time2048-states-l\": -1,\n" +
+			"\"time4096-states\": -1,\n" +
+			"\"time4096-states-l\": -1,\n" +
+			"\"time8192-states\": -1,\n" +
+			"\"time8192-states-l\": -1,\n" +
+			"\"snir-min\": -99,\n" +
+			"\"snir-max\": -99,\n" +
+			"\"snir-avg\": -99,\n" +
+			"\"xpd-min\": -99,\n" +
+			"\"xpd-max\": -99,\n" +
+			"\"xpd-avg\": -99,\n" +
+			"\"rf-temp-min\": -99,\n" +
+			"\"rf-temp-max\": -99,\n" +
+			"\"rf-temp-avg\": -99,\n" +
+			"\"defect-blocks-sum\": -1,\n" +
+			"\"time-period\": 900,\n" +
+			"\"tx-level-min\": 25,\n" +
+			"\"tx-level-max\": 25,\n" +
+			"\"tx-level-avg\": 25,\n" +
+			"\"rx-level-min\": -41,\n" +
+			"\"rx-level-max\": -41,\n" +
+			"\"unavailability\": 0,\n" +
+			"\"ses\": 0,\n" +
+			"\"cses\": 0\n" +
+			"},\n" +
+			"\"suspect-interval-flag\": false\n" +
+			"}";
+
+	//@Test
+//	public void testMediatorServer() throws ClassNotFoundException {
+//
+//		MapResult<EsMediatorServer> result = new MapResult<EsMediatorServer>(EsMediatorServer.ESDATATYPENAME,
+//				EsMediatorServer.class,
+//				getSearchJson(EsMediatorServer.ESDATATYPENAME,MEDIATORSERVER_DB_ID,MEDIATOR_SERVERDB_JSON));
+//		assertEquals("test mediator server", result.mappedData.get(0).getName());
+//		assertEquals("https://10.45.44.223:7590", result.mappedData.get(0).getUrl());
+//		assertEquals(MEDIATORSERVER_DB_ID, result.mappedData.get(0).getId());
+//
+//	}
+	//@Test
+//	public void testFaultCurrent() {
+//
+//		MapResult<FaultcurrentEntity> result = new MapResult<FaultcurrentEntity>(ESDATATYPENAME, EsFaultCurrent.class,
+//				getSearchJson(ESDATATYPENAME, FAULTCURRENT_DB_ID, FAULTCURRENT_SERVERDB_JSON));
+//		assertEquals(FAULTCURRENT_DB_ID, result.mappedData.get(0).getId());
+//		assertEquals(FAULTCURRENT_DB_NODEID, result.mappedData.get(0).getNodeId());
+//		assertEquals(FAULTCURRENT_DB_COUNTER, result.mappedData.get(0).getCounter().intValue());
+//		assertEquals(FAULTCURRENT_DB_OBJECTID, result.mappedData.get(0).getObjectId());
+//		assertEquals(FAULTCURRENT_DB_PROBLEM, result.mappedData.get(0).getProblem());
+//		assertEquals(FAULTCURRENT_DB_SEVERITY, result.mappedData.get(0).getSeverity());
+//		assertEquals(FAULTCURRENT_DB_TIMESTAMP, result.mappedData.get(0).getTimestamp());
+//	}
+//
+	@Test
+	public void testPmData15m() {
+
+		YangToolsMapper mapper = new YangToolsMapper();
+		try {
+			Data data =mapper.readValue(PMDATA15M_SERVERDB_JSON.getBytes(), Data.class);
+			System.out.println(data);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+
+	}
+	private String getSearchJson(String dataType,String dbId, String source) {
+		return String.format(SEARCHJSON_FORMAT,dataType,dataType, dbId,source);
+	}
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestFilterConversion.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestFilterConversion.java
new file mode 100644
index 0000000..94381b6
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestFilterConversion.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.QueryByFilter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.FilterBuilder;
+
+public class TestFilterConversion {
+
+	private static final String PROPERTY = "node-id";
+
+	@Test
+	public void testQuestionMark() {
+		 List<Filter> filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY).setFiltervalue("si?ba").build());
+		QueryBuilder query = QueryByFilter.fromFilter(filters );
+		System.out.println(query.toJSON());
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestInitalMaintenanceObjectInDatabase.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestInitalMaintenanceObjectInDatabase.java
new file mode 100644
index 0000000..6339125
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestInitalMaintenanceObjectInDatabase.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+/**
+ * - Handling of inital values for Maintenance mode.
+ */
+public class TestInitalMaintenanceObjectInDatabase {
+
+	//@Test
+	public void test() {
+		fail("Not yet implemented");
+	}
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfNodeBuilder.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfNodeBuilder.java
new file mode 100644
index 0000000..0f502f8
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfNodeBuilder.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.Credentials;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPassword;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder;
+
+public class TestNetconfNodeBuilder {
+
+    @SuppressWarnings("deprecation")
+    //@Test
+    public void test() {
+
+        NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder();
+
+        LoginPasswordBuilder loginPasswordBuilder = new LoginPasswordBuilder();
+        loginPasswordBuilder.setUsername("myTestUsername");
+        loginPasswordBuilder.setPassword("myTestPassword");
+        netconfNodeBuilder.setCredentials(loginPasswordBuilder.build());
+
+        NetconfNode netconfNode = netconfNodeBuilder.build();
+        System.out.println(netconfNode);
+
+        Credentials credentials = netconfNode.getCredentials();
+        System.out.println("Class: "+credentials.getClass()+"\nContent: "+credentials);
+
+        if (credentials instanceof LoginPassword) {
+            LoginPassword loginPassword = (LoginPassword)credentials;
+            System.out.println("User: "+loginPassword.getUsername()+" Password"+loginPassword.getPassword());
+        } else {
+            System.out.println("Not expected class");
+        }
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfTimestamp.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfTimestamp.java
new file mode 100644
index 0000000..d125af1
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfTimestamp.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import static org.junit.Assert.*;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl;
+
+public class TestNetconfTimestamp {
+
+
+    private static final String regex = "[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.?[0-9]?Z";
+    private static final String NETCONF_DEF_MILLIS_STRING = "2020-01-09T05:40:41.1Z";
+    private static final String NETCONF_DEF_MILLIS_STRING_MALFORMAED = "2020-01-09T05:40:41:0Z";
+    private static final String NETCONF_DEF2_MILLIS_STRING = "2020-01-09T05:40:41.111Z";
+    private static final String NETCONF_DEF3_MILLIS_STRING = "2020-01-09T05:40:41Z";
+    private static final String NETCONF_DEF3_MILLIS_STRING_CORRECTED = "2020-01-09T05:40:41.0Z";
+    private static final String NETCONF_DEF4_MILLIS_STRING_MALFORMAED = "2020-01-09T05:40:41.0000Z";
+    private static final long NETCONF_DEF_MILLIS_LONG = 1578548441100L;
+
+     private static NetconfTimeStamp converter =NetconfTimeStampImpl.getConverter();
+
+     @Test
+    public void test() {
+        String ts = converter.getTimeStampAsNetconfString();
+        final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
+        final Matcher matcher = pattern.matcher(ts);
+        assertTrue(matcher.find());
+    }
+     @Test
+     public void testMillis() {
+         long millis=converter.getTimeStampFromNetconfAsMilliseconds(NETCONF_DEF_MILLIS_STRING);
+         assertEquals(NETCONF_DEF_MILLIS_LONG,millis);
+
+     }
+     @Test(expected = IllegalArgumentException.class)
+     public void testMillisMalformed() {
+         long millis=converter.getTimeStampFromNetconfAsMilliseconds(NETCONF_DEF_MILLIS_STRING_MALFORMAED);
+
+     }
+
+     @Test
+     public void test2() {
+         assertEquals(NETCONF_DEF_MILLIS_STRING,converter.getTimeStampFromNetconf(NETCONF_DEF2_MILLIS_STRING));
+         assertEquals(NETCONF_DEF3_MILLIS_STRING_CORRECTED,converter.getTimeStampFromNetconf(NETCONF_DEF3_MILLIS_STRING));
+         assertTrue(converter.getTimeStampFromNetconf(NETCONF_DEF4_MILLIS_STRING_MALFORMAED).startsWith("Malformed"));
+     }
+
+     @Test
+     public void test3() {
+         Date dt = converter.getDateFromNetconf(NETCONF_DEF_MILLIS_STRING);
+         final Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
+         c.setTime(dt);
+         assertEquals(2020,c.get(Calendar.YEAR));
+         assertEquals(0,c.get(Calendar.MONTH));
+         assertEquals(9,c.get(Calendar.DAY_OF_MONTH));
+         assertEquals(5,c.get(Calendar.HOUR_OF_DAY));
+         assertEquals(40,c.get(Calendar.MINUTE));
+         assertEquals(41,c.get(Calendar.SECOND));
+         assertEquals(100,c.get(Calendar.MILLISECOND));
+
+
+         assertEquals(NETCONF_DEF_MILLIS_STRING,converter.getTimeStampAsNetconfString(dt));
+     }
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNuMappings.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNuMappings.java
new file mode 100644
index 0000000..7f7c971
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNuMappings.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import java.io.IOException;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Faultcurrent;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SeverityType;
+
+public class TestNuMappings {
+
+    @Test
+    public void test33() {
+        Faultcurrent c = new FaultcurrentBuilder().setSeverity(SeverityType.Critical).build();
+        YangToolsMapper mapper = new YangToolsMapper();
+        try {
+            System.out.println(mapper.writeValueAsString(c)+"<=>"+SeverityType.Critical.getName());
+        } catch (JsonProcessingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        try {
+            Faultcurrent f=mapper.readValue( "{\"severity\":\"Critical\"}", Faultcurrent.class);
+            System.out.println(f);
+            System.out.println(mapper.writeValueAsString(f));
+        } catch (JsonParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (JsonMappingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTimestampFilter.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTimestampFilter.java
new file mode 100644
index 0000000..c32149b
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestTimestampFilter.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.json.JSONObject;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.QueryByFilter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.FilterBuilder;
+
+public class TestTimestampFilter {
+
+
+	
+	@Test
+	public void testTimestampRange() {
+		final String PROPERTY_TIMESTAMP = "timestamp";
+		List<Filter> filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2017*").build());
+		QueryBuilder query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2017-01-01T00:00:00.0Z", "2018-01-01T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2000-01-01T00:00:00.0Z", "3000-01-01T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("20*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2000-01-01T00:00:00.0Z", "2100-01-01T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("205*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-01-01T00:00:00.0Z", "2060-01-01T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-01-01T00:00:00.0Z", "2051-01-01T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-01-01T00:00:00.0Z", "2051-01-01T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-1*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-01T00:00:00.0Z", "2051-01-01T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-01T00:00:00.0Z", "2050-11-01T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-01T00:00:00.0Z", "2050-11-01T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-0*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-01T00:00:00.0Z", "2050-10-10T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-02*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-02T00:00:00.0Z", "2050-10-03T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T00:00:00.0Z", "2050-10-15T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T00:00:00.0Z", "2050-10-15T00:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T1*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T10:00:00.0Z", "2050-10-14T20:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:00:00.0Z", "2050-10-14T13:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:00:00.0Z", "2050-10-14T13:00:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:4*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:40:00.0Z", "2050-10-14T12:50:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:42*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:42:00.0Z", "2050-10-14T12:43:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:42:*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:42:00.0Z", "2050-10-14T12:43:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:42:5*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:42:50.0Z", "2050-10-14T12:43:00.0Z");
+		
+		filters = Arrays.asList(new FilterBuilder().setProperty(PROPERTY_TIMESTAMP).setFiltervalue("2050-10-14T12:42:56*").build());
+		query=  QueryByFilter.fromFilter(filters );
+		assertRange(query.getInner(), PROPERTY_TIMESTAMP, "2050-10-14T12:42:56.0Z", "2050-10-14T12:42:57.0Z");
+	}
+	private void assertRange(JSONObject rangeQuery,String property,String lower,String upper) {
+		System.out.println("==test for "+rangeQuery.toString());
+		assertTrue(rangeQuery.has("range"));
+		assertTrue(rangeQuery.getJSONObject("range").has(property));
+		JSONObject o=rangeQuery.getJSONObject("range").getJSONObject(property);
+		assertNotNull(o);
+		assertTrue(o.has("lt"));
+		assertEquals(upper, o.getString("lt"));
+		assertTrue(o.has("gte"));
+		assertEquals(lower, o.getString("gte"));
+		System.out.println("succeeded");
+	}
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangCloning.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangCloning.java
new file mode 100644
index 0000000..95e9c0b
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangCloning.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import java.util.Arrays;
+
+import org.junit.Test;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Faultcurrent;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.InventoryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.InventoryEntity;
+
+public class TestYangCloning {
+/*
+    @Test
+    public void testEquipment() {
+        EquipmentBuilder equipmentBuilder = new EquipmentBuilder();
+        equipmentBuilder.setUuid( new UniversalId("EquipmentId"));
+        equipmentBuilder.setContainedHolder(Arrays.asList(new ContainedHolderBuilder()
+                .setUuid(new UniversalId("HolderId"))
+                .setAdministrativeState(AdministrativeState.Locked)
+                .setSupportedEquipment(Arrays.asList("eq1"))
+                .build()));
+        Equipment equipment = equipmentBuilder.build();
+        InventoryEntity output = YangToolsCloner.instance().cloneToBuilder(equipment,  new InventoryBuilder())
+                .setNodeId("node1").setUuid("a.a.a").setId("node1"+"/"+"a.a.a").build();
+
+
+        System.out.println("source:");
+        System.out.println(equipment);
+        System.out.println("result:");
+        System.out.println(output);
+
+
+    }
+    @Test
+    public void testFaultCurrent() {
+        ProblemNotificationXml source = new ProblemNotificationXml("node", "uuid", "problem", InternalSeverity.Critical,54,InternalDateAndTime.getTestpattern());
+        FaultcurrentEntity output = YangToolsCloner.instance().clone(source,Faultcurrent.class);
+
+          System.out.println("source:");
+            System.out.println(source);
+            System.out.println("result:");
+            System.out.println(output);
+    }
+    */
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java
new file mode 100644
index 0000000..271b268
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java
@@ -0,0 +1,406 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import java.io.IOException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.json.JSONObject;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.database.DatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
+import org.onap.ccsdk.features.sdnr.wt.common.database.SearchResult;
+import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
+import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo.Protocol;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.BoolQueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
+import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.EsDataObjectReaderWriter;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
+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.netconf.node.topology.rev150114.NetconfNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.parameters.OdlHelloMessageCapabilitiesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.CreateMediatorServerInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Entity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EntityInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ReadPmdata15mListOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SortOrder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Filter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.PaginationBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.entity.input.Sortorder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.pmdata15m.entity.PerformanceDataBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.DataBuilder;
+import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+
+public class TestYangGenSalMapping {
+
+    // Create mapper for serialization and deserialization
+    YangToolsMapper mapper = new YangToolsMapper();
+
+    @Test
+    public void test1() throws IOException {
+
+        // Create test object
+        NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder();
+        netconfNodeBuilder.setConnectedMessage("ConnMessage");
+
+        LoginPasswordBuilder loginPasswordBuilder = new LoginPasswordBuilder();
+        loginPasswordBuilder.setUsername("myTestUsername");
+        loginPasswordBuilder.setPassword("myTestPassword");
+        netconfNodeBuilder.setCredentials(loginPasswordBuilder.build());
+
+        OdlHelloMessageCapabilitiesBuilder odlHelloMessageCapabilitiesBuilder = new OdlHelloMessageCapabilitiesBuilder();
+        List<Uri> uriList = new ArrayList<>();
+        uriList.add( new Uri("test.uri") );
+        odlHelloMessageCapabilitiesBuilder.setCapability(uriList);
+        netconfNodeBuilder.setOdlHelloMessageCapabilities(odlHelloMessageCapabilitiesBuilder.build());
+
+        NetconfNode netconfNode = netconfNodeBuilder.build();
+        out(netconfNode.toString());
+
+        // Map Object to JSON String
+        String res = mapper.writeValueAsString(netconfNode);
+        JSONObject json = new JSONObject(res); // Convert text to object
+        out(json.toString(4)); // Print it with specified indentation
+
+        // Map to JSON String to Object
+        NetconfNode generatedNode = mapper.readValue(res.getBytes(), NetconfNode.class);
+        out(generatedNode.toString()); // Print it with specified indentation
+        // Compare result
+        out("Equal?  "+netconfNode.equals(generatedNode));
+    }
+
+    static class TestDataObjectBuilder implements Builder<TestDataObject> {
+        @Override
+        public @NonNull TestDataObject build() throws IllegalArgumentException {
+            return new TestDataObject();
+        }
+    }
+
+    static class TestDataObject implements DataObject {
+        String test;
+
+        @Override
+        public Class<? extends DataContainer> getImplementedInterface() {
+            return null;
+        }
+    }
+
+    @Test
+    public void test2() throws ClassNotFoundException    {
+
+        int databasePort = Integer.valueOf(System.getProperty("databaseport")!=null?System.getProperty("databaseport"):"49200");
+        System.out.println("DB Port: "+databasePort);
+
+        HostInfo[] HOSTINFOS = new HostInfo[] { new HostInfo("localhost", databasePort ,Protocol.HTTP)};
+        DatabaseClient db = new HtDatabaseClient(HOSTINFOS);
+
+        EsDataObjectReaderWriter<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data> dataRW =
+            new EsDataObjectReaderWriter<>(db, "inventorytest", org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data.class);
+
+        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data d1;
+        d1 = getInventoryDataBuilder("MyDescription", 23L).build();
+        String id = dataRW.write(d1,null);
+
+        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.Data d2;
+        d2 = dataRW.read(id);
+
+        out(d2.toString());
+
+    }
+
+    @Test
+    public void test3() throws IOException    {
+
+        PerformanceDataBuilder performanceBuilder = new PerformanceDataBuilder();
+        performanceBuilder.setEs(99);
+        DataBuilder pmData15MinutesBuilder = new DataBuilder();
+        pmData15MinutesBuilder.setLayerProtocolName("fdsaf");
+        pmData15MinutesBuilder.setTimeStamp(new DateAndTime("2017-03-01T09:15:00.0Z"));
+        pmData15MinutesBuilder.setPerformanceData(performanceBuilder.build());
+
+        // Map Object to JSON String
+        String res = mapper.writeValueAsString(pmData15MinutesBuilder.build());
+        JSONObject json = new JSONObject(res); // Convert text to object
+        out(json.toString(4)); // Print it with specified indentation
+
+        // Map to JSON String to Object
+        Data generatedNode = mapper.readValue(res.getBytes(), Data.class);
+        out(generatedNode.toString()); // Print it with specified indentation
+    }
+
+    @Test
+    public void test4() throws IOException {
+
+        String jsonString = "{\n" + "\"node-name\": \"Sim2230\",\n" + "\"uuid-interface\": \"LP-MWPS-TTP-RADIO\",\n"
+                + "\"layer-protocol-name\": \"MWPS\",\n" + "\"radio-signal-id\": \"Test8\",\n"
+                + "\"time-stamp\": \"2017-03-01T09:15:00.0Z\",\n" + "\"granularity-period\": \"Period15Min\",\n"
+                + "\"scanner-id\": \"PM_RADIO_15M_4\",\n" + "\"performance-data\": {\n" + "\"unavailability\": 0,\n"
+                + "\"tx-level-max\": 3,\n" + "\"tx-level-avg\": 3,\n" + "\"rx-level-min\": -44,\n"
+                + "\"rx-level-max\": -45,\n" + "\"rx-level-avg\": -44,\n" + "\"time2-states\": 0,\n"
+                + "\"time4-states-s\": 0,\n" + "\"time4-states\": 0,\n" + "\"time8-states\": -1,\n"
+                + "\"time16-states-s\": -1,\n" + "\"time16-states\": 0,\n" + "\"time32-states\": -1,\n"
+                + "\"time64-states\": 900,\n" + "\"time128-states\": -1,\n" + "\"time256-states\": -1,\n"
+                + "\"time512-states\": -1,\n" + "\"time512-states-l\": -1,\n" + "\"time1024-states\": -1,\n"
+                + "\"time1024-states-l\": -1,\n" + "\"time8192-states-l\": -1,\n" + "\"time8192-states\": -1,\n"
+                + "\"time2048-states\": -1,\n" + "\"snir-min\": -99,\n" + "\"snir-max\": -99,\n"
+                + "\"snir-avg\": -99,\n" + "\"xpd-min\": -99,\n" + "\"xpd-max\": -99,\n" + "\"xpd-avg\": -99,\n"
+                + "\"rf-temp-min\": -99,\n" + "\"rf-temp-max\": -99,\n" + "\"rf-temp-avg\": -99,\n"
+                + "\"defect-blocks-sum\": -1,\n" + "\"time-period\": 900,\n" + "\"cses\": 0,\n"
+                + "\"time4096-states-l\": -1,\n" + "\"tx-level-min\": 3,\n" + "\"es\": 0,\n"
+                + "\"time2048-states-l\": -1,\n" + "\"time4096-states\": -1,\n" + "\"ses\": 0\n" + "},\n"
+                + "\"suspect-interval-flag\": false\n" + "}\n" + "}";
+        // Map to JSON String to Object
+        Data generatedNode = mapper.readValue(jsonString.getBytes(), Data.class);
+        out(generatedNode.toString()); // Print it with specified indentation
+
+    }
+
+
+    @Test
+    public void test5() throws IOException {
+        String jsonString = "{\n" +
+                "    \"time-stamp\": \"2017-03-01T06:45:00.0Z\",\n" +
+                "    \"node-name\": \"Sim2230\",\n" +
+                "    \"uuid-interface\": \"LP-MWPS-TTP-RADIO\",\n" +
+                "    \"scanner-id\": \"PM_RADIO_15M_14\",\n" +
+                "    \"layer-protocol-name\": \"MWPS\",\n" +
+                "    \"granularity-period\": \"Period15Min\",\n" +
+                "    \"radio-signal-id\": \"Test8\",\n" +
+                "    \"suspect-interval-flag\": false,\n" +
+                "    \"performance-data\": {\n" +
+                "        \"time4096-states-l\": -1,\n" +
+                "        \"time16-states-s\": -1,\n" +
+                "        \"tx-level-max\": 3,\n" +
+                "        \"snir-max\": -99,\n" +
+                "        \"time16-states\": 0,\n" +
+                "        \"time64-states\": 900,\n" +
+                "        \"unavailability\": 0,\n" +
+                "        \"time8192-states-l\": -1,\n" +
+                "        \"time512-states\": -1,\n" +
+                "        \"xpd-min\": -99,\n" +
+                "        \"xpd-avg\": -99,\n" +
+                "        \"tx-level-avg\": 3,\n" +
+                "        \"tx-level-min\": 3,\n" +
+                "        \"rf-temp-min\": -99,\n" +
+                "        \"rf-temp-avg\": -99,\n" +
+                "        \"snir-avg\": -99,\n" +
+                "        \"snir-min\": -99,\n" +
+                "        \"time-period\": 900,\n" +
+                "        \"time2-states\": 0,\n" +
+                "        \"time4-states\": 0,\n" +
+                "        \"time8-states\": -1,\n" +
+                "        \"ses\": 0,\n" +
+                "        \"time2048-states-l\": -1,\n" +
+                "        \"time2048-states\": -1,\n" +
+                "        \"xpd-max\": -99,\n" +
+                "        \"rf-temp-max\": -99,\n" +
+                "        \"time8192-states\": -1,\n" +
+                "        \"time128-states\": -1,\n" +
+                "        \"time256-states\": -1,\n" +
+                "        \"rx-level-min\": -44,\n" +
+                "        \"rx-level-avg\": -44,\n" +
+                "        \"time1024-states-l\": -1,\n" +
+                "        \"es\": 0,\n" +
+                "        \"cses\": 0,\n" +
+                "        \"time4-states-s\": 0,\n" +
+                "        \"time1024-states\": -1,\n" +
+                "        \"time512-states-l\": -1,\n" +
+                "        \"time4096-states\": -1,\n" +
+                "        \"rx-level-max\": -45,\n" +
+                "        \"defect-blocks-sum\": -1,\n" +
+                "        \"time32-states\": -1\n" +
+                "    }\n" +
+                "}";
+
+        // Map to JSON String to Object
+        Data generatedNode = mapper.readValue(jsonString.getBytes(), Data.class);
+        out(generatedNode.toString()); // Print it with specified indentation
+
+    }
+
+
+    @Test
+    public void test6() throws IOException, ClassNotFoundException {
+        out(method());
+        HtDatabaseClient dbClient = new HtDatabaseClient(new HostInfo[] { new HostInfo("sdnrdb", 9200, Protocol.HTTP) });
+        String PMDATA15M_TYPE = "historicalperformance15min";
+
+        EsDataObjectReaderWriter<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> pm15mRW =
+                new EsDataObjectReaderWriter<>(dbClient, PMDATA15M_TYPE, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data.class);
+        pm15mRW.setEsIdAttributeName("_nodeName");
+
+        ReadPmdata15mListInputBuilder inputBuilder = new ReadPmdata15mListInputBuilder();
+        PaginationBuilder paginationBuilder = new PaginationBuilder();
+        paginationBuilder.setPage(new BigInteger("1"));
+        paginationBuilder.setSize(20L);
+        inputBuilder.setPagination(paginationBuilder.build());
+
+        ReadPmdata15mListInput input = inputBuilder.build();
+
+
+        ReadPmdata15mListOutputBuilder outputBuilder = new ReadPmdata15mListOutputBuilder();
+        long page = getPage(input);
+        long pageSize = getPageSize(input);
+
+        QueryBuilder query = fromFilter(input.getFilter()).from((page - 1) * pageSize).size(pageSize);
+        setSortOrder(query, input.getSortorder());
+
+        SearchResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Data> result=pm15mRW.doReadAll(query);
+
+        out("Found: "+result.getHits().size());
+        int t=0;
+        for (Data hit : result.getHits()) {
+            out("Hit "+t+++":"+hit);
+        }
+        setPagination(outputBuilder, page, pageSize, result.getTotal());
+        outputBuilder.setData(result.getHits());
+    }
+
+    @Test
+    public void test7() throws IOException, ClassNotFoundException {
+        out(method());
+        String ESDATATYPE_MEDIATORSERVER = Entity.MediatorServer.getName();
+        HtDatabaseClient dbClient = new HtDatabaseClient(new HostInfo[] { new HostInfo("sdnrdb", 9200, Protocol.HTTP) });
+        EsDataObjectReaderWriter<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data> mediatorserverRW;
+
+        mediatorserverRW = new EsDataObjectReaderWriter<>(dbClient, ESDATATYPE_MEDIATORSERVER,
+                org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data.class)
+                .setWriteInterface(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MediatorServerEntity.class)
+                .setEsIdAttributeName("_id");
+
+        CreateMediatorServerInputBuilder inputBuilder = new CreateMediatorServerInputBuilder();
+        inputBuilder.setName("Hans");
+        inputBuilder.setUrl("MyGreatUrl");
+
+        String id = mediatorserverRW.write(inputBuilder.build(),"testid");
+        System.out.println(id);
+
+    }
+
+    @Test
+    public void test8() throws IOException {
+        out(method());
+        String input;
+        input = "id-dd-dd";
+        System.out.println("Map " + input + " to "+YangToolsMapper.toCamelCaseAttributeName(input));
+        input = "idDdGg";
+        System.out.println("Map " + input + " to "+YangToolsMapper.toCamelCaseAttributeName(input));
+        input = "_idDdGg";
+        System.out.println("Map " + input + " to "+YangToolsMapper.toCamelCaseAttributeName(input));
+        input = "--ff--gfg";
+        System.out.println("Map " + input + " to "+YangToolsMapper.toCamelCaseAttributeName(input));
+        input = "";
+        System.out.println("Map " + input + " to "+YangToolsMapper.toCamelCaseAttributeName(input));
+    }
+
+    /* ---------------------------------
+     * Private
+     */
+    private static String method() {
+        String nameofCurrMethod = new Throwable().getStackTrace()[1].getMethodName();
+        return nameofCurrMethod;
+    }
+
+    private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.DataBuilder getInventoryDataBuilder(String description, long treeLevel) {
+        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.DataBuilder dataBuilder =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.inventory.list.output.DataBuilder();
+        dataBuilder.setDescription(description);
+        dataBuilder.setTreeLevel(treeLevel);
+        return dataBuilder;
+    }
+
+
+    private static void out(String text) {
+        System.out.println("----------------------");
+        System.out.println(text);
+    }
+
+    private static long getPage(EntityInput input) {
+        return getPage(input, 1);
+    }
+
+    private static long getPage(EntityInput input, long defaultValue) {
+        return input.getPagination() != null ? input.getPagination().getPage().longValue() : defaultValue;
+    }
+
+    private static long getPageSize(EntityInput input) {
+        return getPageSize(input, 1);
+    }
+
+    private static long getPageSize(EntityInput input, long defaultValue) {
+        return input.getPagination() != null ? input.getPagination().getSize().longValue() : defaultValue;
+    }
+
+    private static QueryBuilder fromFilter(@Nullable List<Filter> filters) {
+        return fromFilter(filters, "");
+    }
+
+    private static QueryBuilder fromFilter(@Nullable List<Filter> filters, String prefix) {
+        if (filters == null || filters.size() == 0) {
+            return QueryBuilders.matchAllQuery();
+
+        } else if(filters.size()==1){
+            return QueryBuilders.matchQuery(filters.get(0).getProperty(), filters.get(0).getFiltervalue());
+        }
+        else {
+            BoolQueryBuilder query = new BoolQueryBuilder();
+            for (Filter fi : filters) {
+                query.must(QueryBuilders.matchQuery((prefix != null ? prefix : "") + fi.getProperty(),
+                        fi.getFiltervalue()));
+            }
+            return query;
+        }
+
+    }
+    private static QueryBuilder setSortOrder(QueryBuilder query, @Nullable List<Sortorder> sortorder) {
+        return setSortOrder(query, sortorder, "");
+    }
+
+    private static QueryBuilder setSortOrder(QueryBuilder query, @Nullable List<Sortorder> sortorder, String prefix) {
+        if (sortorder != null && sortorder.size() > 0) {
+            for (Sortorder so : sortorder) {
+                query.sort((prefix != null ? prefix : "") + so.getProperty(),
+                        so.getSortorder() == SortOrder.Ascending
+                                ? org.onap.ccsdk.features.sdnr.wt.common.database.queries.SortOrder.ASCENDING
+                                : org.onap.ccsdk.features.sdnr.wt.common.database.queries.SortOrder.DESCENDING);
+            }
+        }
+        return query;
+
+    }
+
+    private static void setPagination(ReadPmdata15mListOutputBuilder outputBuilder, long page, long pageSize, long totalSize) {
+        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.Pagination value = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.pmdata._15m.list.output.PaginationBuilder()
+                .setPage(BigInteger.valueOf(page)).setSize(pageSize).setTotal(BigInteger.valueOf(totalSize)).build();
+        outputBuilder.setPagination(value);
+    }
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java
new file mode 100644
index 0000000..c911100
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangProvider.java
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.FileAttribute;
+import java.nio.file.attribute.PosixFilePermission;
+import java.nio.file.attribute.PosixFilePermissions;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Comparator;
+import java.util.EnumSet;
+import java.util.Set;
+
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.YangFileProvider;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.data.YangFilename;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.http.YangSchemaHttpServlet;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class TestYangProvider {
+
+	private static final String TESTPATH = "cache/schema/";
+
+
+	@BeforeClass
+	public static void init() {
+		Set<PosixFilePermission> perms;
+		FileAttribute<?> attr;
+		perms     = EnumSet.noneOf(PosixFilePermission.class);
+
+		perms.add(PosixFilePermission.OWNER_READ);
+		perms.add(PosixFilePermission.OWNER_WRITE);
+		perms.add(PosixFilePermission.OWNER_EXECUTE);
+
+		attr = PosixFilePermissions.asFileAttribute(perms);
+		try {
+			Files.createDirectories(new File(TESTPATH).toPath(),attr);
+			new File(TESTPATH+new YangFilename("module1","2010-01-01").getFilename()).createNewFile();
+			new File(TESTPATH+new YangFilename("module2","2010-01-01").getFilename()).createNewFile();
+			new File(TESTPATH+new YangFilename("module2","2010-04-01").getFilename()).createNewFile();
+			new File(TESTPATH+new YangFilename("module3","2010-01-01").getFilename()).createNewFile();
+			new File(TESTPATH+new YangFilename("module4","2010-05-01").getFilename()).createNewFile();
+			new File(TESTPATH+new YangFilename("module5","2010-01-11").getFilename()).createNewFile();
+			new File(TESTPATH+new YangFilename("module6","2010-01-01").getFilename()).createNewFile();
+		} catch (IOException | ParseException e) {
+
+		}
+	}
+	@AfterClass
+	public static void deinit() {
+		try {
+			Files.walk(new File("cache").toPath())
+		      .sorted(Comparator.reverseOrder())
+		      .map(Path::toFile)
+		      .forEach(File::delete);
+		} catch (IOException e) {
+			System.err.println(e);
+		}
+	}
+	@Test
+	public void testExisting() {
+		YangFileProvider provider= new YangFileProvider(TESTPATH);
+		assertTrue(provider.hasFileForModule("module1","2010-01-01"));
+		assertTrue(provider.hasFileForModule("module2"));
+		assertTrue(provider.hasFileForModule("module3"));
+		assertFalse(provider.hasFileForModule("module5","2010-01-01"));
+	}
+	@Test
+	public void testRevision() throws ParseException {
+		SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
+		YangFileProvider provider= new YangFileProvider(TESTPATH);
+		YangFilename f1 = provider.getFileForModule("module1","2010-01-01");
+		assertEquals("module1",f1.getModule());
+		assertEquals(sdf.parse("2010-01-01"),f1.getRevision());
+		YangFilename f2 = provider.getFileForModule("module2");
+		assertEquals("module2",f2.getModule());
+		assertEquals(sdf.parse("2010-04-01"),f2.getRevision());
+		f2 = provider.getFileForModule("module2","2010-02-01");
+		assertEquals("module2",f2.getModule());
+		assertEquals(sdf.parse("2010-04-01"),f2.getRevision());
+		YangFilename f3 = provider.getFileForModule("module3");
+		assertEquals("module3",f3.getModule());
+		assertEquals(sdf.parse("2010-01-01"),f3.getRevision());
+		f3 = provider.getFileForModule("module3","2010-04-01");
+		assertNull(f3);
+	}
+	@Test
+	public void testServlet() throws IOException, ServletException {
+		HelpYangSchemaHttpServlet servlet = new HelpYangSchemaHttpServlet();
+		HttpServletRequest req = mock(HttpServletRequest.class);
+		HttpServletResponse resp = mock(HttpServletResponse.class);
+
+		when(req.getRequestURI()).thenReturn("/yang-schema/module1");
+		StringWriter out = new StringWriter();
+		ServletOutputStream printOut = new ServletOutputStream() {
+
+			@Override
+			public void write(int arg0) throws IOException {
+				out.write(arg0);
+			}
+		};
+		when(resp.getOutputStream()).thenReturn(printOut);
+		servlet.doGet(req,resp);
+		verify(resp).setStatus(200);
+		verify(resp).setContentType("text/plain");
+
+	}
+	@Test
+	public void testServletBad() throws IOException, ServletException {
+		HelpYangSchemaHttpServlet servlet = new HelpYangSchemaHttpServlet();
+		HttpServletRequest req = mock(HttpServletRequest.class);
+		HttpServletResponse resp = mock(HttpServletResponse.class);
+
+		when(req.getRequestURI()).thenReturn("/yang-schema/module1/2020-01-01");
+		StringWriter out = new StringWriter();
+		ServletOutputStream printOut = new ServletOutputStream() {
+
+			@Override
+			public void write(int arg0) throws IOException {
+				out.write(arg0);
+			}
+		};
+		when(resp.getOutputStream()).thenReturn(printOut);
+		servlet.doGet(req,resp);
+		verify(resp).sendError(HttpServletResponse.SC_NOT_FOUND);
+
+	}
+	@Test
+	public void testServletNear() throws IOException, ServletException {
+		HelpYangSchemaHttpServlet servlet = new HelpYangSchemaHttpServlet();
+		HttpServletRequest req = mock(HttpServletRequest.class);
+		HttpServletResponse resp = mock(HttpServletResponse.class);
+
+		when(req.getRequestURI()).thenReturn("/yang-schema/module2/2010-03-01");
+		StringWriter out = new StringWriter();
+		ServletOutputStream printOut = new ServletOutputStream() {
+
+			@Override
+			public void write(int arg0) throws IOException {
+				out.write(arg0);
+			}
+		};
+		when(resp.getOutputStream()).thenReturn(printOut);
+		servlet.doGet(req,resp);
+		verify(resp).setStatus(200);
+		verify(resp).setContentType("text/plain");
+
+	}
+	private static class HelpYangSchemaHttpServlet extends YangSchemaHttpServlet{
+
+		/**
+		 *
+		 */
+		private static final long serialVersionUID = 1L;
+
+		@Override
+		public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+			super.doGet(req, resp);
+		}
+	}
+
+
+}
diff --git a/sdnr/wt/data-provider/provider/src/test/resources/log4j.properties b/sdnr/wt/data-provider/provider/src/test/resources/log4j.properties
new file mode 100644
index 0000000..142663b
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/resources/log4j.properties
@@ -0,0 +1,12 @@
+log4j.rootLogger=INFO, out
+
+log4j.logger.org.apache.camel.impl.converter=WARN
+log4j.logger.org.apache.camel.management=WARN
+log4j.logger.org.apache.camel.impl.DefaultPackageScanClassResolver=WARN
+log4j.logger.org.springframework=ERROR
+
+# CONSOLE appender not used by default
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
diff --git a/sdnr/wt/data-provider/provider/src/test/resources/log4j2.xml b/sdnr/wt/data-provider/provider/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..164e93f
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/resources/log4j2.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration package="log4j.test" 
+               status="WARN">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Logger name="log4j.test.Log4jTest" level="debug">
+            <AppenderRef ref="Console"/>
+        </Logger>
+        <Root level="trace">
+            <AppenderRef ref="Console"/>
+        </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file
diff --git a/sdnr/wt/data-provider/provider/src/test/resources/simplelogger.properties b/sdnr/wt/data-provider/provider/src/test/resources/simplelogger.properties
new file mode 100644
index 0000000..a2f1e7e
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/resources/simplelogger.properties
@@ -0,0 +1,6 @@
+org.slf4j.simpleLogger.defaultLogLevel=debug
+org.slf4j.simpleLogger.showDateTime=true
+#org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z
+#org.slf4j.simpleLogger.showThreadName=true
+org.slf4j.simpleLogger.showLogName=true
+org.slf4j.simpleLogger.showShortLogName=false
\ No newline at end of file
diff --git a/sdnr/wt/data-provider/provider/src/test/resources/test.properties b/sdnr/wt/data-provider/provider/src/test/resources/test.properties
new file mode 100644
index 0000000..de49c58
--- /dev/null
+++ b/sdnr/wt/data-provider/provider/src/test/resources/test.properties
@@ -0,0 +1,55 @@
+[dcae]
+dcaeUserCredentials=admin:admin
+dcaeUrl=off
+dcaeHeartbeatPeriodSeconds=120
+dcaeTestCollector=no
+
+[aots]
+userPassword=passwd
+soapurladd=off
+soapaddtimeout=10
+soapinqtimeout=20
+userName=user
+inqtemplate=inqreq.tmpl.xml
+assignedto=userid
+addtemplate=addreq.tmpl.xml
+severitypassthrough=critical,major,minor,warning
+systemuser=user
+prt-offset=1200
+soapurlinq=off
+#smtpHost=
+#smtpPort=
+#smtpUsername=
+#smtpPassword=
+#smtpSender=
+#smtpReceivers=
+
+[es]
+esCluster=sendateodl5
+#time limit to keep increasing data in database [in seconds] 
+#60*60*24*30 (30days)
+esArchiveLimit=2592000
+#folder where removed data will be stored
+esArchiveFolder=./backup
+#interval to archive database [in seconds]
+#60*60*24 (1day)
+esArchiveInterval=86400
+
+[aai]
+#keep comment
+aaiHeaders=["X-TransactionId: 9999"]
+aaiUrl=http://localhost:81
+aaiUserCredentials=AAI:AAI
+aaiDeleteOnMountpointRemove=false
+aaiTrustAllCerts=false
+aaiApiVersion=aai/v13
+aaiPropertiesFile=aaiclient.properties
+aaiApplicationId=SDNR
+aaiPcks12ClientCertFile=/opt/logs/externals/data/stores/keystore.client.p12
+aaiPcks12ClientCertPassphrase=adminadmin
+aaiClientConnectionTimeout=30000
+
+[pm]
+pmCluster=sendateodl5
+pmEnabled=true
+
diff --git a/sdnr/wt/pom.xml b/sdnr/wt/pom.xml
index b10d77a..fee3c4e 100644
--- a/sdnr/wt/pom.xml
+++ b/sdnr/wt/pom.xml
@@ -41,8 +41,8 @@
         <module>apigateway</module>
         <module>websocketmanager2</module>
         <module>helpserver</module>
-        <!--<module>data-provider</module>
-        <module>netconfnode-state-service</module>
+        <module>data-provider</module>
+        <!--<module>netconfnode-state-service</module>
         <module>devicemanager</module>
         <module>devicemanager-onf</module>
         <module>devicemanager-oran</module>
