aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorezhil <ezhrajam@in.ibm.com>2018-12-10 19:05:03 +0530
committerEzhilarasi R <ezhrajam@in.ibm.com>2018-12-10 13:39:15 +0000
commit495e2684609e8592ba0ef2ef6f4685cf0ba0f071 (patch)
treee70247062226c2034229749c78919b86e66dc33b /src/main
parent0768534363e9e6f2d6efd962fb1af94e5e9c166c (diff)
Fixed sonar issue in JsonInsert.java
Logged IO exception using EELFLoggerDelegate Issue-ID: MUSIC-256 Change-Id: I0ffa5b9f63d5128a8ef05e1ba354696ff4f64d30 Signed-off-by: ezhil <ezhrajam@in.ibm.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java b/src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java
index c79ba9b7..456fb951 100644
--- a/src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java
+++ b/src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java
@@ -3,6 +3,7 @@
* org.onap.music
* ===================================================================
* Copyright (c) 2017 AT&T Intellectual Property
+ * Modifications Copyright (C) 2018 IBM.
* ===================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +34,11 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import org.onap.music.eelf.logging.EELFLoggerDelegate;
+import org.onap.music.eelf.logging.format.AppMessages;
+import org.onap.music.eelf.logging.format.ErrorSeverity;
+import org.onap.music.eelf.logging.format.ErrorTypes;
+
@ApiModel(value = "JsonTable", description = "Json model for table vlaues insert")
@JsonIgnoreProperties(ignoreUnknown = true)
public class JsonInsert implements Serializable {
@@ -41,10 +47,11 @@ public class JsonInsert implements Serializable {
private transient Map<String, Object> values;
private String ttl;
private String timestamp;
- private transient Map<String, Object> row_specification;
+ private transient Map<String, Object> rowSpecification;
private Map<String, String> consistencyInfo;
private Map<String, byte[]> objectMap;
-
+ private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(JsonInsert.class);
+
@ApiModelProperty(value = "objectMap")
public Map<String, byte[]> getObjectMap() {
return objectMap;
@@ -110,11 +117,11 @@ public class JsonInsert implements Serializable {
@ApiModelProperty(value = "Information for selecting specific rows for insert")
public Map<String, Object> getRow_specification() {
- return row_specification;
+ return rowSpecification;
}
- public void setRow_specification(Map<String, Object> row_specification) {
- this.row_specification = row_specification;
+ public void setRow_specification(Map<String, Object> rowSpecification) {
+ this.rowSpecification = rowSpecification;
}
public byte[] serialize() {
@@ -124,7 +131,7 @@ public class JsonInsert implements Serializable {
out = new ObjectOutputStream(bos);
out.writeObject(this);
} catch (IOException e) {
- e.printStackTrace();
+ logger.error(EELFLoggerDelegate.errorLogger, e, AppMessages.IOERROR, ErrorSeverity.ERROR, ErrorTypes.DATAERROR);
}
return bos.toByteArray();
}