aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Forsyth <jf2512@att.com>2019-08-15 13:44:40 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-15 13:44:40 +0000
commit14830110a1fdf7c7ccc4a45f3e8b3e1573726a99 (patch)
tree8c47449a303aa80f13cf43ac20386a18e949f7c2
parenta55cf0fe1999e5aeccb535a29f3cec496afb1ef7 (diff)
parent7b26f1c1d8aa65036bd3ec395ef26bbe420ce2b4 (diff)
Merge "Sonar Fix : Added logger"
-rw-r--r--champ-lib/champ-janus/src/main/java/org/onap/aai/champjanus/graph/impl/GraphSON.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/champ-lib/champ-janus/src/main/java/org/onap/aai/champjanus/graph/impl/GraphSON.java b/champ-lib/champ-janus/src/main/java/org/onap/aai/champjanus/graph/impl/GraphSON.java
index 20b993c..93744b1 100644
--- a/champ-lib/champ-janus/src/main/java/org/onap/aai/champjanus/graph/impl/GraphSON.java
+++ b/champ-lib/champ-janus/src/main/java/org/onap/aai/champjanus/graph/impl/GraphSON.java
@@ -4,6 +4,7 @@
* ===================================================================
* Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* Copyright © 2017-2018 Amdocs
+ * Modifications Copyright (C) 2019 IBM
* ===================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,27 +21,30 @@
*/
package org.onap.aai.champjanus.graph.impl;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-// import com.thinkaurelius.titan.graphdb.tinkerpop.TitanIoRegistry;
-import org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
+import org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry;
import org.onap.aai.champcore.FormatMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
public class GraphSON implements FormatMapper {
+ private static final Logger LOGGER = LoggerFactory.getLogger(GraphSON.class);
private final GraphSONMapper mapper;
private final GraphSONWriter writer;
protected JsonParser parser;
public GraphSON() {
- this.mapper = GraphSONMapper.build().addRegistry(JanusGraphIoRegistry.getInstance ()).create();
+ this.mapper = GraphSONMapper.build().addRegistry(JanusGraphIoRegistry.getInstance()).create();
this.writer = GraphSONWriter.build().mapper(this.mapper).create();
this.parser = new JsonParser();
}
@@ -50,10 +54,10 @@ public class GraphSON implements FormatMapper {
String result = "";
try {
- this.writer.writeVertex(os, (Vertex)v, Direction.BOTH);
+ this.writer.writeVertex(os, (Vertex) v, Direction.BOTH);
result = os.toString();
} catch (IOException var5) {
- var5.printStackTrace();
+ LOGGER.debug("Exception occured while formatting object : " + var5.getMessage());
}
return this.parser.parse(result).getAsJsonObject();