From 4e418d684db244939d0a4d1df479b8935e085a96 Mon Sep 17 00:00:00 2001 From: Chandan Ghosh Date: Thu, 17 Jan 2019 16:23:21 +0530 Subject: Added error logger in exception scenario Added error logger in exception scenatio Issue-ID: AAI-2086 Change-Id: I47b222096ff9613821101e6f87c0bd75d2bf3f4e Signed-off-by: Chandan Ghosh --- .../java/org/onap/aai/spike/schema/RelationshipSchema.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/onap/aai/spike/schema/RelationshipSchema.java b/src/main/java/org/onap/aai/spike/schema/RelationshipSchema.java index 6858783..7cddcb5 100644 --- a/src/main/java/org/onap/aai/spike/schema/RelationshipSchema.java +++ b/src/main/java/org/onap/aai/spike/schema/RelationshipSchema.java @@ -1,5 +1,4 @@ /** - * ============LICENSE_START======================================================= * Gizmo * ================================================================================ * Copyright © 2017 AT&T Intellectual Property. @@ -33,19 +32,23 @@ import java.util.stream.Collectors; import com.google.common.collect.Multimap; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import org.onap.aai.cl.eelf.LoggerFactory; import org.codehaus.jackson.map.ObjectMapper; import org.onap.aai.edges.EdgeRule; import org.onap.aai.spike.exception.SpikeException; +import org.onap.aai.spike.logging.SpikeMsgs; public class RelationshipSchema { - private static final Gson gson = new GsonBuilder().create(); + public static final String SCHEMA_SOURCE_NODE_TYPE = "from"; public static final String SCHEMA_TARGET_NODE_TYPE = "to"; public static final String SCHEMA_RELATIONSHIP_TYPE = "label"; public static final String SCHEMA_RULES_ARRAY = "rules"; + private static org.onap.aai.cl.api.Logger logger = + LoggerFactory.getInstance().getLogger(RelationshipSchema.class.getName()); private Map>> relations = new HashMap<>(); /** @@ -61,7 +64,7 @@ public class RelationshipSchema { try { return resolveClass(p.getValue()); } catch (SpikeException | ClassNotFoundException e) { - e.printStackTrace(); + logger.error(SpikeMsgs.OXM_LOAD_ERROR, "Error in RelationshipSchema: " + e); } return null; })); @@ -85,7 +88,7 @@ public class RelationshipSchema { try { return resolveClass(p.getValue()); } catch (SpikeException | ClassNotFoundException e) { - e.printStackTrace(); + logger.error(SpikeMsgs.OXM_LOAD_ERROR, "Error in RelationshipSchema: " + e); } return null; })); -- cgit 1.2.3-korg