Fixed sonar fix in JsonNotification.java 47/74447/2
authorezhil <ezhrajam@in.ibm.com>
Mon, 10 Dec 2018 13:29:02 +0000 (18:59 +0530)
committerEzhilarasi R <ezhrajam@in.ibm.com>
Mon, 10 Dec 2018 13:38:37 +0000 (13:38 +0000)
Logged exception using EELFLoggerDelegate
Issue-ID: MUSIC-257
Change-Id: I6f4b8c4b8020b76c260fbd3d545f4072c8cbfc65
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
src/main/java/org/onap/music/datastore/jsonobjects/JsonNotification.java

index ce244e2..5190de5 100755 (executable)
@@ -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.
@@ -28,6 +29,11 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
 
+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;
+
 import io.swagger.annotations.ApiModel;
 
 @ApiModel(value = "JsonNotification", description = "Json model for callback")
@@ -45,6 +51,7 @@ public class JsonNotification implements Serializable {
     private String operation_type;
     private String triggerName;
     private Map<String, String> response_body;
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(JsonNotification.class);
     
        public String getNotify_field() {
                return notify_field;
@@ -111,6 +118,7 @@ public class JsonNotification implements Serializable {
                try {
                return new com.fasterxml.jackson.databind.ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(this);
            } catch (com.fasterxml.jackson.core.JsonProcessingException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, e, AppMessages.EXECUTIONINTERRUPTED, ErrorSeverity.ERROR, ErrorTypes.GENERALSERVICEERROR);
                        return notify_field+ " : "+endpoint+ " : "+username+ " : "+password+ " : "+response_body;
            }