aboutsummaryrefslogtreecommitdiffstats
path: root/SDNCReports/sdnc_reports_dao
diff options
context:
space:
mode:
Diffstat (limited to 'SDNCReports/sdnc_reports_dao')
-rw-r--r--SDNCReports/sdnc_reports_dao/.classpath86
-rw-r--r--SDNCReports/sdnc_reports_dao/.gitignore1
-rw-r--r--SDNCReports/sdnc_reports_dao/.project27
-rw-r--r--SDNCReports/sdnc_reports_dao/.settings/org.eclipse.core.resources.prefs6
-rw-r--r--SDNCReports/sdnc_reports_dao/.settings/org.eclipse.jdt.core.prefs13
-rw-r--r--SDNCReports/sdnc_reports_dao/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--SDNCReports/sdnc_reports_dao/.settings/org.eclipse.wst.common.project.facet.core.xml4
-rw-r--r--SDNCReports/sdnc_reports_dao/pom.xml66
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/DeviceConfig.java108
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/PreTestConfig.java126
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/ProtocolConfig.java198
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/Report.java94
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/Response.java50
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/RouterConfigDetails.java281
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/DeviceRepository.java31
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java34
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/ConfigDetailsRestModel.java73
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/JSONTags.java56
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/PreTestModel.java116
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/ProtocolModel.java207
-rw-r--r--SDNCReports/sdnc_reports_dao/src/main/resources/application.properties29
21 files changed, 1610 insertions, 0 deletions
diff --git a/SDNCReports/sdnc_reports_dao/.classpath b/SDNCReports/sdnc_reports_dao/.classpath
new file mode 100644
index 0000000..1a448aa
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/.classpath
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-context/4.3.9.RELEASE/spring-context-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-aop/4.3.9.RELEASE/spring-aop-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-beans/4.3.9.RELEASE/spring-beans-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/4.3.9.RELEASE/spring-core-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-expression/4.3.9.RELEASE/spring-expression-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-test/1.5.3.RELEASE/spring-boot-starter-test-1.5.3.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-test/1.5.4.RELEASE/spring-boot-test-1.5.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot/1.5.4.RELEASE/spring-boot-1.5.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-test-autoconfigure/1.5.4.RELEASE/spring-boot-test-autoconfigure-1.5.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-autoconfigure/1.5.4.RELEASE/spring-boot-autoconfigure-1.5.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/jayway/jsonpath/json-path/2.2.0/json-path-2.2.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/net/minidev/json-smart/2.2.1/json-smart-2.2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/net/minidev/accessors-smart/1.1/accessors-smart-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.12/junit-4.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/assertj/assertj-core/2.6.0/assertj-core-2.6.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/2.1/objenesis-2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/skyscreamer/jsonassert/1.4.0/jsonassert-1.4.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-test/4.3.9.RELEASE/spring-test-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-data-jpa/1.5.4.RELEASE/spring-boot-starter-data-jpa-1.5.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter/1.5.4.RELEASE/spring-boot-starter-1.5.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-logging/1.5.4.RELEASE/spring-boot-starter-logging-1.5.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar"/>
+ <classpathentry kind="var" path="M2_REPO/ch/qos/logback/logback-core/1.1.11/logback-core-1.1.11.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/log4j-over-slf4j/1.7.25/log4j-over-slf4j-1.7.25.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-aop/1.5.4.RELEASE/spring-boot-starter-aop-1.5.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-jdbc/1.5.4.RELEASE/spring-boot-starter-jdbc-1.5.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/tomcat-jdbc/8.5.15/tomcat-jdbc-8.5.15.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/tomcat-juli/8.5.15/tomcat-juli-8.5.15.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-jdbc/4.3.9.RELEASE/spring-jdbc-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-tx/4.3.9.RELEASE/spring-tx-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-core/5.0.12.Final/hibernate-core-5.0.12.Final.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging/3.3.1.Final/jboss-logging-3.3.1.Final.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.7/antlr-2.7.7.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jandex/2.0.0.Final/jandex-2.0.0.Final.jar"/>
+ <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/hibernate/common/hibernate-commons-annotations/5.0.1.Final/hibernate-commons-annotations-5.0.1.Final.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/data/spring-data-jpa/1.11.4.RELEASE/spring-data-jpa-1.11.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/data/spring-data-commons/1.13.4.RELEASE/spring-data-commons-1.13.4.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-orm/4.3.9.RELEASE/spring-orm-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring-aspects/4.3.9.RELEASE/spring-aspects-4.3.9.RELEASE.jar"/>
+ <classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.42/mysql-connector-java-5.1.42.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/SDNCReports/sdnc_reports_dao/.gitignore b/SDNCReports/sdnc_reports_dao/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/SDNCReports/sdnc_reports_dao/.project b/SDNCReports/sdnc_reports_dao/.project
new file mode 100644
index 0000000..95fb91b
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/.project
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>sdnc_reports_dao</name>
+ <comment>Parent pom providing dependency and plugin management for applications
+ built with Maven. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.springframework.ide.eclipse.core.springbuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.springframework.ide.eclipse.core.springnature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription> \ No newline at end of file
diff --git a/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.core.resources.prefs b/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..29abf99
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding//src/test/resources=UTF-8
+encoding/<project>=UTF-8
diff --git a/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.jdt.core.prefs b/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..5ce4518
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,13 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.m2e.core.prefs b/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.wst.common.project.facet.core.xml b/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 0000000..d858295
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="cloudfoundry.standalone.app" version="1.0"/>
+</faceted-project>
diff --git a/SDNCReports/sdnc_reports_dao/pom.xml b/SDNCReports/sdnc_reports_dao/pom.xml
new file mode 100644
index 0000000..0134b37
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/pom.xml
@@ -0,0 +1,66 @@
+<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>
+ <artifactId>sdnc_reports_dao</artifactId>
+ <packaging>jar</packaging>
+
+ <parent>
+ <groupId>com.sdnc.reports</groupId>
+ <artifactId>sdnc_reports</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ <version>1.5.3.RELEASE</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ </exclusion>
+ </exclusions>
+
+ </dependency>
+
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+ <scope>provided</scope>
+ </dependency> -->
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </dependency>
+
+ <!-- <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <version>1.0.1.Final</version>
+ </dependency> -->
+ <dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>1.1.7</version>
+</dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/DeviceConfig.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/DeviceConfig.java
new file mode 100644
index 0000000..5b32dbe
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/DeviceConfig.java
@@ -0,0 +1,108 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.model;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "deviceconfig",schema="testreports")
+public class DeviceConfig implements Serializable
+{
+ private static final long serialVersionUID = -3009157732242241606L;
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ @Column(name = "deviceid")
+ private long id;
+
+ @Column(name = "devicename")
+ private String deviceName;
+
+ @Column(name = "createdon")
+ private String createdon;
+
+ @OneToMany(mappedBy="device")
+ private Set<ProtocolConfig> protocolConfig;
+
+ @OneToMany(mappedBy="device")
+ private Set<PreTestConfig> preTestConfig;
+
+ public DeviceConfig() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getCreationDate() {
+ return createdon;
+ }
+
+ public void setCreationDate(String creationDate) {
+ this.createdon = creationDate;
+ }
+
+ public Set<ProtocolConfig> getProtocolConfig() {
+ return protocolConfig;
+ }
+
+ public void setProtocolConfig(Set<ProtocolConfig> protocolConfig) {
+ this.protocolConfig = protocolConfig;
+ }
+
+ public Set<PreTestConfig> getPreTestConfig() {
+ return preTestConfig;
+ }
+
+ public void setPreTestConfig(Set<PreTestConfig> preTestConfig) {
+ this.preTestConfig = preTestConfig;
+ }
+
+ @Override
+ public String toString() {
+ return "DeviceConfig [id=" + id + ", deviceName=" + deviceName + ", createdon=" + createdon
+ + "]";
+ }
+
+
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/PreTestConfig.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/PreTestConfig.java
new file mode 100644
index 0000000..3c11d51
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/PreTestConfig.java
@@ -0,0 +1,126 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.model;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+@Entity
+@Table(name = "pretestconfig",schema="testreports")
+public class PreTestConfig implements Serializable{
+
+ private static final long serialVersionUID = -3009157732242241606L;
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ @Column(name = "testid")
+ private long testId ;
+
+ @Column(name = "testname")
+ private String testName;
+
+
+ @Column(name = "result")
+ private String result;
+
+ @Column(name = "execuationdetails")
+ private String execuationDetails;
+
+ @Column(name = "timestamp")
+ @Temporal(TemporalType.DATE)
+ private Date timestamp;
+
+ @ManyToOne
+ @JoinColumn(name="deviceid",nullable=false)
+ private DeviceConfig device;
+
+ public PreTestConfig()
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+ public long getTestId() {
+ return testId;
+ }
+
+ public void setTestId(long testId) {
+ this.testId = testId;
+ }
+
+ public String getTestName() {
+ return testName;
+ }
+
+ public void setTestName(String testName) {
+ this.testName = testName;
+ }
+
+ public DeviceConfig getDevice() {
+ return device;
+ }
+
+ public void setDevice(DeviceConfig device) {
+ this.device = device;
+ }
+
+ public String getResult() {
+ return result;
+ }
+
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public String getExecuationDetails() {
+ return execuationDetails;
+ }
+
+ public void setExecuationDetails(String execuationDetails) {
+ this.execuationDetails = execuationDetails;
+ }
+
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ @Override
+ public String toString() {
+ return "PreTestConfig [testId=" + testId + ", testName=" + testName + ", result=" + result
+ + ", execuationDetails=" + execuationDetails + ", timestamp=" + timestamp + ", device=" + device + "]";
+ }
+
+
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/ProtocolConfig.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/ProtocolConfig.java
new file mode 100644
index 0000000..3ad2fbf
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/ProtocolConfig.java
@@ -0,0 +1,198 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "protocolconfig",schema="testreports")
+public class ProtocolConfig implements Serializable{
+
+ private static final long serialVersionUID = -3009157732242241606L;
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ @Column(name = "protocolid")
+ private long protocolId;
+
+ @Column(name = "protocolname")
+ private String protocolname;
+
+ @Column(name = "process_id")
+ private String process_id;
+
+ @Column(name = "networks")
+ private String networks;
+
+ @Column(name = "as_number")
+ private String as_number;
+
+ @Column(name = "neighbors")
+ private String neighbors;
+
+ @Column(name = "cos_entry_number")
+ private String cos_entry_number;
+
+ @Column(name = "destination_address")
+ private String destination_address;
+
+ @Column(name = "source_address")
+ private String source_address;
+
+ @Column(name = "customer_name")
+ private String customer_name;
+
+ @Column(name = "version")
+ private String version;
+
+ //@Column(name = "creationDate")
+ //private String creationDate;
+
+ @ManyToOne
+ @JoinColumn(name="deviceid",nullable=false)
+ private DeviceConfig device;
+
+ public ProtocolConfig() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public long getProtocolId() {
+ return protocolId;
+ }
+
+ public void setProtocolId(long protocolId) {
+ this.protocolId = protocolId;
+ }
+
+ public String getProtocolName() {
+ return protocolname;
+ }
+
+ public void setProtocolName(String protocolName) {
+ this.protocolname = protocolName;
+ }
+
+ public String getProcess_id() {
+ return process_id;
+ }
+
+ public void setProcess_id(String process_id) {
+ this.process_id = process_id;
+ }
+
+ public String getNetworks() {
+ return networks;
+ }
+
+ public void setNetworks(String networks) {
+ this.networks = networks;
+ }
+
+ public String getAs_number() {
+ return as_number;
+ }
+
+ public void setAs_number(String as_number) {
+ this.as_number = as_number;
+ }
+
+ public String getNeighbors() {
+ return neighbors;
+ }
+
+ public void setNeighbors(String neighbors) {
+ this.neighbors = neighbors;
+ }
+
+ public String getCos_entry_number() {
+ return cos_entry_number;
+ }
+
+ public void setCos_entry_number(String cos_entry_number) {
+ this.cos_entry_number = cos_entry_number;
+ }
+
+ public String getDestination_address() {
+ return destination_address;
+ }
+
+ public void setDestination_address(String destination_address) {
+ this.destination_address = destination_address;
+ }
+
+ public String getSource_address() {
+ return source_address;
+ }
+
+ public void setSource_address(String source_address) {
+ this.source_address = source_address;
+ }
+
+ public String getCustomer_name() {
+ return customer_name;
+ }
+
+ public void setCustomer_name(String customer_name) {
+ this.customer_name = customer_name;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ /*public String getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(String creationDate) {
+ this.creationDate = creationDate;
+ }*/
+
+ public DeviceConfig getDevice() {
+ return device;
+ }
+
+ public void setDevice(DeviceConfig device) {
+ this.device = device;
+ }
+
+ /*@Override
+ public String toString() {
+ return "ProtocolConfig [protocolId=" + protocolId + ", protocolname=" + protocolname + ", process_id="
+ + process_id + ", networks=" + networks + ", as_number=" + as_number + ", neighbors=" + neighbors
+ + ", cos_entry_number=" + cos_entry_number + ", destination_address=" + destination_address
+ + ", source_address=" + source_address + ", customer_name=" + customer_name + ", version=" + version
+ + ", device=" + device + "]";
+ }*/
+
+
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/Report.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/Report.java
new file mode 100644
index 0000000..53373b3
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/Report.java
@@ -0,0 +1,94 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.model;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+
+//@Entity
+//@Table(name = "report")
+public class Report implements Serializable {
+/*
+
+ private static final long serialVersionUID = -3009157732242241606L;
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private long id;
+
+ @Column(name = "router_name")
+ private String router_name;
+
+ protected Report() {
+ }
+
+ List<RouterConfigDetails> routerConfigDetailsObj;
+
+
+
+ public long getRouter_id() {
+ return id;
+ }
+
+
+
+ public void setRouter_id(long router_id) {
+ this.id = router_id;
+ }
+
+
+
+ public String getRouter_name() {
+ return router_name;
+ }
+
+
+
+ public void setRouter_name(String router_name) {
+ this.router_name = router_name;
+ }
+
+
+
+ public List<RouterConfigDetails> getRouterConfigDetailsObj() {
+ return routerConfigDetailsObj;
+ }
+
+
+
+ public void setRouterConfigDetailsObj(List<RouterConfigDetails> routerConfigDetailsObj) {
+ this.routerConfigDetailsObj = routerConfigDetailsObj;
+ }
+
+
+ @Override
+ public String toString() {
+ return "Router [router_id=" + id + ", router_name=" + router_name+"]";
+ }
+
+
+*/}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/Response.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/Response.java
new file mode 100644
index 0000000..3203931
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/Response.java
@@ -0,0 +1,50 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.model;
+
+public class Response {
+ private String status;
+ private Object data;
+
+ public Response() {
+
+ }
+
+ public Response(String status, Object data) {
+ this.status = status;
+ this.data = data;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/RouterConfigDetails.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/RouterConfigDetails.java
new file mode 100644
index 0000000..96bf38b
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/model/RouterConfigDetails.java
@@ -0,0 +1,281 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+import org.springframework.data.annotation.Id;
+
+import com.onap.sdnc.reports.rest.model.ConfigDetailsRestModel;
+import com.onap.sdnc.reports.rest.model.ProtocolModel;
+
+public class RouterConfigDetails implements Comparable<RouterConfigDetails>{
+
+ @Override
+ public int compareTo(RouterConfigDetails o) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+/*
+ @Id
+ String router_config_details_id;
+
+ Date date;
+ String version_id;
+ String protocol;
+ String cos_entry_number;
+ String destination_address;
+ String source_address;
+ String customer_name;
+
+ String process_id;
+ String subnet_ip;
+ String area_id;
+ String as_number;
+ String router_id;
+ String peer_ip;
+
+ HashMap<String, String> neighbors;
+ HashMap<String, String> networks;
+
+ List<Object> networkList;
+
+ public static List<ConfigDetailsRestModel> fromEntityToModel(List<RouterConfigDetails> entityList) {
+ List<ConfigDetailsRestModel> modelList= new ArrayList<ConfigDetailsRestModel>();
+ ConfigDetailsRestModel configmodel= new ConfigDetailsRestModel();
+ List<ProtocolModel> protocolmodelList= new ArrayList<ProtocolModel>();
+
+ for (RouterConfigDetails entity : entityList) {
+ ProtocolModel model = new ProtocolModel();
+ //
+ model.setDate(entity.getDate().toString());
+ if ("ipsla".equals(entity.getProtocol())) {
+ model.setVersion_id(entity.getVersion_id());
+ model.setProtocol_name(entity.getProtocol());
+ model.setCos_entry_number(entity.getCos_entry_number());
+ model.setCustomer_name(entity.getCustomer_name());
+ model.setDestination_address(entity.getDestination_address());
+ model.setSource_address(entity.getSource_address());
+ // routerConfigDetails.setRouter_config_details_id(String.valueOf(seqDao.getRouterConfigDetailsNextSequenceId(ROUTER_CONFIG_VERSION)));
+ protocolmodelList.add(model);
+ }
+ if ("bgp".equals(entity.getProtocol())) {
+ model.setVersion_id(entity.getVersion_id());
+ model.setProtocol_name(entity.getProtocol());
+ HashMap<String, String> neighbor = entity.getNeighbors();
+ HashMap<String, String> neighbormap = new HashMap<String, String>();
+ model.setAs_number(entity.getAs_number());
+ model.setRouter_id(entity.getRouter_id());
+
+ String as_number = neighbor.get("as_number").toString();
+ String peer_ip = neighbor.get("peer_ip").toString();
+
+ neighbormap.put("as_number", as_number);
+ neighbormap.put("peer_ip", peer_ip);
+
+ model.setNeighbors(neighbormap);
+ protocolmodelList.add(model);
+ }
+ if ("ospf".equals(entity.getProtocol())) {
+ model.setVersion_id(entity.getVersion_id());
+ model.setProtocol_name(entity.getProtocol());
+ HashMap<String, String> networks = entity.getNetworks();
+ HashMap<String, String> networksmap = new HashMap<String, String>();
+ String network_subnet_ip = networks.get("subnet_ip").toString();
+ String network_area_id = networks.get("area_id").toString();
+
+
+ networksmap.put("subnet_ip", network_subnet_ip);
+ networksmap.put("area_id", network_subnet_ip);
+
+ model.setNetworks(networksmap);
+ model.setProcess_id(entity.getProcess_id());
+ protocolmodelList.add(model);
+ }
+ }
+ configmodel.setProtocol(protocolmodelList);
+ modelList.add(configmodel);
+ return modelList;
+ }
+
+ public String getRouter_config_details_id() {
+ return router_config_details_id;
+ }
+
+ public void setRouter_config_details_id(String router_config_details_id) {
+ this.router_config_details_id = router_config_details_id;
+ }
+
+ public String getCos_entry_number() {
+ return cos_entry_number;
+ }
+
+ public void setCos_entry_number(String cos_entry_number) {
+ this.cos_entry_number = cos_entry_number;
+ }
+
+ public String getDestination_address() {
+ return destination_address;
+ }
+
+ public void setDestination_address(String destination_address) {
+ this.destination_address = destination_address;
+ }
+
+ public String getSource_address() {
+ return source_address;
+ }
+
+ public void setSource_address(String source_address) {
+ this.source_address = source_address;
+ }
+
+ public String getCustomer_name() {
+ return customer_name;
+ }
+
+ public void setCustomer_name(String customer_name) {
+ this.customer_name = customer_name;
+ }
+
+ public String getProtocol() {
+ return protocol;
+ }
+
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
+ }
+
+
+ * public String getVersion() { return version; }
+ *
+ * public void setVersion(String version) { this.version = version; }
+
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public String getProcess_id() {
+ return process_id;
+ }
+
+ public void setProcess_id(String process_id) {
+ this.process_id = process_id;
+ }
+
+ public String getSubnet_ip() {
+ return subnet_ip;
+ }
+
+ public void setSubnet_ip(String subnet_ip) {
+ this.subnet_ip = subnet_ip;
+ }
+
+ public String getArea_id() {
+ return area_id;
+ }
+
+ public void setArea_id(String area_id) {
+ this.area_id = area_id;
+ }
+
+ public String getAs_number() {
+ return as_number;
+ }
+
+ public void setAs_number(String as_number) {
+ this.as_number = as_number;
+ }
+
+ public String getRouter_id() {
+ return router_id;
+ }
+
+ public void setRouter_id(String router_id) {
+ this.router_id = router_id;
+ }
+
+ public String getPeer_ip() {
+ return peer_ip;
+ }
+
+ public void setPeer_ip(String peer_ip) {
+ this.peer_ip = peer_ip;
+ }
+
+ public HashMap<String, String> getNeighbors() {
+ return neighbors;
+ }
+
+ public void setNeighbors(HashMap<String, String> neighbormap) {
+ this.neighbors = neighbormap;
+ }
+
+ public HashMap<String, String> getNetworks() {
+ return networks;
+ }
+
+ public void setNetworks(HashMap<String, String> networks) {
+ this.networks = networks;
+ }
+
+ public List<Object> getNetworkList() {
+ return networkList;
+ }
+
+ public void setNetworkList(List<Object> networkList) {
+ this.networkList = networkList;
+ }
+
+ @Override
+ public String toString() {
+ return "RouterConfigDetails [router_config_details_id=" + router_config_details_id + ",date=" + date
+ + ",protocol=" + protocol + ", cos_entry_number=" + cos_entry_number + ", destination_address="
+ + destination_address + ", source_address=" + source_address + ", customer_name=" + customer_name + "]";
+ }
+
+ //@Override
+ public int compareTo(RouterConfigDetails o) {
+ if (this.date.before(o.getDate()))
+ return 1;
+ else if (this.date.equals(o.getDate()))
+ return 0;
+ else
+ return -1;
+ }
+
+ public String getVersion_id() {
+ return version_id;
+ }
+
+ public void setVersion_id(String version_id) {
+ this.version_id = version_id;
+ }
+*/
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/DeviceRepository.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/DeviceRepository.java
new file mode 100644
index 0000000..9e7f9b7
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/DeviceRepository.java
@@ -0,0 +1,31 @@
+
+package com.onap.sdnc.reports.repository;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.transaction.Transactional;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+
+import com.onap.sdnc.reports.model.DeviceConfig;
+import com.onap.sdnc.reports.model.PreTestConfig;
+import com.onap.sdnc.reports.model.Report;
+
+@Repository
+public interface DeviceRepository extends JpaRepository<DeviceConfig, Long> {
+//public interface DeviceRepository extends CrudRepository<DeviceConfig, Long> {
+ //List<Report> findByLastName(String lastName);
+ @Query(value= "from DeviceConfig where deviceName = :deviceName" )
+ DeviceConfig findDeviceName(@Param("deviceName") String deviceName);
+
+ @Modifying
+ @Query(value = "insert into DeviceConfig (deviceName,createdOn) VALUES (:deviceName,:createdOn)", nativeQuery = true)
+ @Transactional
+ void logDeviceName(@Param("deviceName") String deviceName, @Param("createdOn") String createdOn);
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java
new file mode 100644
index 0000000..07472d9
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java
@@ -0,0 +1,34 @@
+
+package com.onap.sdnc.reports.repository;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.transaction.Transactional;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+
+import com.onap.sdnc.reports.model.PreTestConfig;
+
+@Repository
+public interface PreTestConfigRepository extends JpaRepository<PreTestConfig, Long> {
+
+ @Query(value= " from PreTestConfig where timestamp >= :startDate and timestamp <= :endDate" )
+ List<PreTestConfig> findPreTestConfigByTimeStamp(@Param("startDate") Date startDate, @Param("endDate")Date endDate);
+
+
+ @Query(value= " from PreTestConfig where timestamp >= :startDate and timestamp <= :endDate and testName = :testName" )
+ List<PreTestConfig> findReportByTestName(@Param("startDate") Date startDate, @Param("endDate")Date endDate, @Param("testName")String testName);
+
+ @Query(value= " from PreTestConfig where timestamp >= :startDate and timestamp <= :endDate and device.deviceName = :deviceName" )
+ List<PreTestConfig> findReportByDeviceName(@Param("startDate") Date startDate, @Param("endDate")Date endDate, @Param("deviceName")String deviceName);
+
+ @Modifying
+ @Query(value = "insert into PreTestConfig (testName,result,execuationDetails,timestamp,deviceId) VALUES (:testName,:result,:execuationDetails,:timestamp,:deviceId)", nativeQuery = true)
+ @Transactional
+ void logPreTestReport(@Param("testName") String testName,@Param("result") String result, @Param("execuationDetails") String execuationDetails,@Param("timestamp") String timestamp,@Param("deviceId") long deviceId);
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/ConfigDetailsRestModel.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/ConfigDetailsRestModel.java
new file mode 100644
index 0000000..5794459
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/ConfigDetailsRestModel.java
@@ -0,0 +1,73 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.rest.model;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ConfigDetailsRestModel {
+
+ @JsonProperty(value = JSONTags.TAG_ROUTER)
+ String router;
+
+ @JsonProperty(value = JSONTags.TAG_DATE)
+ String date;
+
+ List<ProtocolModel> protocol;
+
+
+ public ConfigDetailsRestModel() {
+ super();
+ }
+
+
+ public String getRouter() {
+ return router;
+ }
+
+
+ public void setRouter(String router) {
+ this.router = router;
+ }
+
+
+ public String getDate() {
+ return date;
+ }
+
+
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+
+ public List<ProtocolModel> getProtocol() {
+ return protocol;
+ }
+
+
+ public void setProtocol(List<ProtocolModel> protocol) {
+ this.protocol = protocol;
+ }
+
+
+
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/JSONTags.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/JSONTags.java
new file mode 100644
index 0000000..90ff570
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/JSONTags.java
@@ -0,0 +1,56 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.rest.model;
+
+public class JSONTags {
+
+ public static final String TAG_REQUEST_FNAME = "first_name";
+ public static final String TAG_REQUEST_MNAME = "middle_name";
+ public static final String TAG_STATUS_SUCCESS = "success";
+ public static final String TAG_RESPONSE_STATUS = "status";
+ public static final String TAG_REQUEST_FROM = "request_from";
+ public static final String TAG_REQUEST_ID = "request_id";
+ public static final String TAG_RESPONSE_DETAIL = "response_detail";
+ public static final String TAG_RESPONSE_BODY = "response_body";
+ public static final String TAG_REQUEST_BODY = "request_body";
+ public static final String TAG_RESPONSE_MESSAGE = "request";
+ public static final String TAG_ERROR_CODE = "error_code";
+ public static final String TAG_ERROR_CODE_SUCCESS = "100";
+
+
+ public static final String TAG_ROUTER = "router";
+ public static final String TAG_IPSLA = "ipsla";
+ public static final String TAG_OSPF = "ospf";
+ public static final String TAG_DATE = "date";
+ public static final String TAG_COS_ENTRY_NUMBER = "cos-entry-number";
+ public static final String TAG_DESTINATION_ADDRESS = "destination-address";
+ public static final String TAG_SOURCE_ADDRESS = "source-address";
+ public static final String TAG_CUSTOMER_NAME = "customer-name";
+ public static final String TAG_PROTOCOL_NAME = "protocol-name";
+
+
+ public static final String TAG_AS_NUMBER = "as-number";
+ public static final String TAG_ROUTER_ID = "router-id";
+ public static final String TAG_PEER_IP = "peer-ip";
+
+ public static final String TAG_PROCESS_ID = "process-id";
+
+
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/PreTestModel.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/PreTestModel.java
new file mode 100644
index 0000000..4f73e02
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/PreTestModel.java
@@ -0,0 +1,116 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.rest.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class PreTestModel implements Serializable{
+
+ private static final long serialVersionUID = -3009157732242241606L;
+
+ private long testid;
+
+ private long deviceid;
+
+ private String testName;
+
+ private String deviceName,execuationDetails,result;
+
+ private Date timeStamp;
+
+ public PreTestModel(long testid, long deviceid, String testName, String deviceName, String execuationDetails,
+ String result, Date timeStamp) {
+ super();
+ this.testid = testid;
+ this.deviceid = deviceid;
+ this.testName = testName;
+ this.deviceName = deviceName;
+ this.execuationDetails = execuationDetails;
+ this.result = result;
+ this.timeStamp = timeStamp;
+ }
+
+ @Override
+ public String toString() {
+ return "PreTestModel [testid=" + testid + ", deviceid=" + deviceid + ", testName=" + testName + ", deviceName="
+ + deviceName + ", execuationDetails=" + execuationDetails + ", result=" + result + ", timeStamp="
+ + timeStamp + "]";
+ }
+
+ public long getTestid() {
+ return testid;
+ }
+
+ public void setTestid(long testid) {
+ this.testid = testid;
+ }
+
+ public long getDeviceid() {
+ return deviceid;
+ }
+
+ public void setDeviceid(long deviceid) {
+ this.deviceid = deviceid;
+ }
+
+ public String getTestName() {
+ return testName;
+ }
+
+ public void setTestName(String testName) {
+ this.testName = testName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getExecuationDetails() {
+ return execuationDetails;
+ }
+
+ public void setExecuationDetails(String execuationDetails) {
+ this.execuationDetails = execuationDetails;
+ }
+
+ public String getResult() {
+ return result;
+ }
+
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public Date getTimeStamp() {
+ return timeStamp;
+ }
+
+ public void setTimeStamp(Date timeStamp) {
+ this.timeStamp = timeStamp;
+ }
+
+
+
+}
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/ProtocolModel.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/ProtocolModel.java
new file mode 100644
index 0000000..d90584d
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/rest/model/ProtocolModel.java
@@ -0,0 +1,207 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SDNC-FEATURES
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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 com.onap.sdnc.reports.rest.model;
+
+import java.util.HashMap;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ProtocolModel {
+
+
+
+ @JsonProperty(value = JSONTags.TAG_COS_ENTRY_NUMBER)
+ String cos_entry_number;
+ @JsonProperty(value = JSONTags.TAG_DESTINATION_ADDRESS)
+ String destination_address;
+ @JsonProperty(value = JSONTags.TAG_SOURCE_ADDRESS)
+ String source_address;
+ @JsonProperty(value = JSONTags.TAG_CUSTOMER_NAME)
+ String customer_name;
+
+
+ String date;
+
+ String version_id;
+
+ String protocol_name;
+
+ // added by bhawna
+
+ String process_id;
+ String subnet_ip;
+ String area_id;
+ @JsonProperty(value = JSONTags.TAG_AS_NUMBER)
+ String as_number;
+ @JsonProperty(value = JSONTags.TAG_ROUTER_ID)
+ String router_id;
+ @JsonProperty(value = JSONTags.TAG_PEER_IP)
+ String peer_ip;
+
+ HashMap<String, String> neighbors;
+ HashMap<String, String> networks;
+
+ List<Object> networkList;
+
+ public ProtocolModel() {
+ super();
+ }
+
+ /*
+ * @Override public String toString() { return
+ * "RouterConfigDetailsRestModel [cos_entry_number=" + cos_entry_number +
+ * ", destination_address=" + destination_address + ", source_address=" +
+ * source_address + ", customer_name=" + customer_name + "]"; }
+ */
+ public String getProtocol_name() {
+ return protocol_name;
+ }
+
+
+ public void setProtocol_name(String protocol_name) {
+ this.protocol_name = protocol_name;
+ }
+
+ public String getCos_entry_number() {
+ return cos_entry_number;
+ }
+
+ public void setCos_entry_number(String cos_entry_number) {
+ this.cos_entry_number = cos_entry_number;
+ }
+
+ public String getDestination_address() {
+ return destination_address;
+ }
+
+ public void setDestination_address(String destination_address) {
+ this.destination_address = destination_address;
+ }
+
+ public String getSource_address() {
+ return source_address;
+ }
+
+ public void setSource_address(String source_address) {
+ this.source_address = source_address;
+ }
+
+ public String getCustomer_name() {
+ return customer_name;
+ }
+
+ public void setCustomer_name(String customer_name) {
+ this.customer_name = customer_name;
+ }
+
+
+ public String getProcess_id() {
+ return process_id;
+ }
+
+ public void setProcess_id(String process_id) {
+ this.process_id = process_id;
+ }
+
+ public String getSubnet_ip() {
+ return subnet_ip;
+ }
+
+ public void setSubnet_ip(String subnet_ip) {
+ this.subnet_ip = subnet_ip;
+ }
+
+ public String getArea_id() {
+ return area_id;
+ }
+
+ public void setArea_id(String area_id) {
+ this.area_id = area_id;
+ }
+
+ public String getAs_number() {
+ return as_number;
+ }
+
+ public void setAs_number(String as_number) {
+ this.as_number = as_number;
+ }
+
+ public String getRouter_id() {
+ return router_id;
+ }
+
+ public void setRouter_id(String router_id) {
+ this.router_id = router_id;
+ }
+
+ public String getPeer_ip() {
+ return peer_ip;
+ }
+
+ public void setPeer_ip(String peer_ip) {
+ this.peer_ip = peer_ip;
+ }
+
+ public HashMap<String, String> getNeighbors() {
+ return neighbors;
+ }
+
+ public void setNeighbors(HashMap<String, String> neighbors) {
+ this.neighbors = neighbors;
+ }
+
+ public HashMap<String, String> getNetworks() {
+ return networks;
+ }
+
+ public void setNetworks(HashMap<String, String> networks) {
+ this.networks = networks;
+ }
+
+ public List<Object> getNetworkList() {
+ return networkList;
+ }
+
+ public void setNetworkList(List<Object> networkList) {
+ this.networkList = networkList;
+ }
+
+ public String getDate() {
+ return date;
+ }
+
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ public String getVersion_id() {
+ return version_id;
+ }
+
+ public void setVersion_id(String version_id) {
+ this.version_id = version_id;
+ }
+
+
+
+}
+
diff --git a/SDNCReports/sdnc_reports_dao/src/main/resources/application.properties b/SDNCReports/sdnc_reports_dao/src/main/resources/application.properties
new file mode 100644
index 0000000..e79c8b2
--- /dev/null
+++ b/SDNCReports/sdnc_reports_dao/src/main/resources/application.properties
@@ -0,0 +1,29 @@
+#spring.datasource.url=jdbc:mysql://localhost:3306/mysql?useSSL=false
+#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+#spring.datasource.name=mysql
+#spring.jpa.database=mysql
+#spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
+
+spring.jpa.generate-ddl=true
+spring.datasource.url=jdbc:mariadb://localhost:3306/testreports
+spring.datasource.username=root
+spring.datasource.password=root
+spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
+spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
+#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
+# Keep the connection alive if idle for a long time (needed in production)
+spring.datasource.testWhileIdle=true
+
+#spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardIm
+
+#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
+#spring.jpa.properties.hibernate.id.new_generator_mappings = false
+#spring.jpa.properties.hibernate.format_sql = true
+#spring.jpa.hibernate.ddl-auto=create
+
+
+#logging.level.org.hibernate.SQL=DEBUG
+#logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
+
+# Naming strategy
+#spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy \ No newline at end of file