aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguochuyicmri <guochuyi@chinamobile.com>2019-04-03 11:22:12 +0800
committerguochuyicmri <guochuyi@chinamobile.com>2019-04-03 11:24:41 +0800
commitd9a2d92a8bf316f2e6a3870c07caf304d65d978b (patch)
treef09262f546249f2b385c5a1d0f167892510abec6
parentbdf550116980f6fc13105892ef2d2701516d4c52 (diff)
Change backend Code for VNF Performance UI page
Change-Id: I314f0ce976e6fcaaebcaf2e963ec30a727dc8a6b Issue-ID: USECASEUI-231 Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
-rwxr-xr-xserver/src/main/java/org/onap/usecaseui/server/bean/PerformanceHeader.java26
-rwxr-xr-xserver/src/main/java/org/onap/usecaseui/server/bean/PerformanceInformation.java11
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java8
3 files changed, 28 insertions, 17 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/PerformanceHeader.java b/server/src/main/java/org/onap/usecaseui/server/bean/PerformanceHeader.java
index fb8d388e..c6e63bbf 100755
--- a/server/src/main/java/org/onap/usecaseui/server/bean/PerformanceHeader.java
+++ b/server/src/main/java/org/onap/usecaseui/server/bean/PerformanceHeader.java
@@ -35,53 +35,53 @@ public class PerformanceHeader implements Serializable {
@Column(name = "version")
private String version;
- @Column(name = "eventName")
+ @Column(name = "event_name")
private String eventName;
@Column(name = "domain")
private String domain;
- @Column(name = "eventId")
+ @Column(name = "event_id")
private String eventId;
- @Column(name = "eventType")
+ @Column(name = "event_type")
private String eventType;
- @Column(name = "nfcNamingCode", nullable=false)
+ @Column(name = "nfc_naming_code", nullable=false)
private String nfcNamingCode;
- @Column(name = "nfNamingCode", nullable=false)
+ @Column(name = "nf_naming_code", nullable=false)
private String nfNamingCode;
- @Column(name = "sourceId")
+ @Column(name = "source_id")
private String sourceId;
- @Column(name = "sourceName")
+ @Column(name = "source_name")
private String sourceName;
- @Column(name = "reportingEntityId")
+ @Column(name = "reporting_entity_id")
private String reportingEntityId;
- @Column(name = "reportingEntityName")
+ @Column(name = "reporting_entity_name")
private String reportingEntityName;
@Column(name = "priority")
private String priority;
- @Column(name = "startEpochMicrosec")
+ @Column(name = "start_epoch_microsec")
private String startEpochMicrosec;
- @Column(name = "lastEpochMicroSec")
+ @Column(name = "last_epoch_microsec")
private String lastEpochMicroSec;
@Column(name = "sequence")
private String sequence;
- @Column(name = "measurementsForVfScalingVersion")
+ @Column(name = "measurements_for_vf_scaling_version")
private String measurementsForVfScalingVersion;
- @Column(name = "measurementInterval")
+ @Column(name = "measurement_interval")
private String measurementInterval;
/** */
diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/PerformanceInformation.java b/server/src/main/java/org/onap/usecaseui/server/bean/PerformanceInformation.java
index 72626e68..e53202b9 100755
--- a/server/src/main/java/org/onap/usecaseui/server/bean/PerformanceInformation.java
+++ b/server/src/main/java/org/onap/usecaseui/server/bean/PerformanceInformation.java
@@ -20,6 +20,8 @@ import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@@ -29,6 +31,7 @@ import javax.persistence.Table;
public class PerformanceInformation implements Serializable {
@Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id")
private int id;
@@ -38,16 +41,16 @@ public class PerformanceInformation implements Serializable {
@Column(name = "value")
private String value;
- @Column(name = "sourceId")
+ @Column(name = "source_id")
private String sourceId;
- @Column(name = "startEpochMicrosec")
+ @Column(name = "start_epoch_microsec")
private String startEpochMicrosec;
- @Column(name = "lastEpochMicroSec")
+ @Column(name = "last_epoch_microSec")
private String lastEpochMicroSec;
- @Column(name="headerId")
+ @Column(name="header_id")
private String headerId;
public PerformanceInformation() {
diff --git a/server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java b/server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java
index a1513fd4..5c8a13f2 100644
--- a/server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java
+++ b/server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java
@@ -27,6 +27,7 @@ import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
+import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -147,4 +148,11 @@ public class UuiCommonUtil {
File targetFile = new File(path);
return targetFile.exists();
}
+
+ public static String readJsonFile(String path) throws IOException{
+
+ File file = new File(path);
+ String content= FileUtils.readFileToString(file,"UTF-8");
+ return content;
+ }
}