From 6cdcd6f0ec19477b7fddbe8a9fb9dfc6cef223cb Mon Sep 17 00:00:00 2001 From: "k.kazak" Date: Thu, 2 May 2019 12:13:54 +0200 Subject: replace System.out by logger Fix sonar issues connected to using System.out instead of Logger: VnfInstantiationNotification, VnfmAdapterCreationNotification, VnfmAdapterDeletionNotification Change-Id: I7385cbbf41c68d752e76c6ad277aec004a3cca8a Issue-ID: SO-1811 Signed-off-by: k.kazak --- .../simulator/notifications/VnfInstantiationNotification.java | 9 +++++---- .../simulator/notifications/VnfmAdapterCreationNotification.java | 9 +++++++-- .../simulator/notifications/VnfmAdapterDeletionNotification.java | 9 +++++++-- 3 files changed, 19 insertions(+), 8 deletions(-) (limited to 'vnfm-simulator') diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfInstantiationNotification.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfInstantiationNotification.java index 153970b053..9a3cd95bec 100644 --- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfInstantiationNotification.java +++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfInstantiationNotification.java @@ -22,7 +22,8 @@ package org.onap.svnfm.simulator.notifications; -import org.onap.svnfm.simulator.services.SvnfmService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @@ -31,16 +32,16 @@ import org.onap.svnfm.simulator.services.SvnfmService; */ public class VnfInstantiationNotification implements Runnable { - SvnfmService svnfmService = new SvnfmService(); + private static final Logger logger = LoggerFactory.getLogger(VnfInstantiationNotification.class); @Override public void run() { try { Thread.sleep(10000); } catch (final InterruptedException e) { - e.printStackTrace(); + logger.error("Error occured while simulating instantiation ", e); Thread.currentThread().interrupt(); } - System.out.println("Instantiation process finished"); + logger.info("Instantiation process finished"); } } diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterCreationNotification.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterCreationNotification.java index ff299ce12e..39de3444db 100644 --- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterCreationNotification.java +++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterCreationNotification.java @@ -22,6 +22,9 @@ package org.onap.svnfm.simulator.notifications; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech) @@ -29,15 +32,17 @@ package org.onap.svnfm.simulator.notifications; */ public class VnfmAdapterCreationNotification implements Runnable { + private static final Logger logger = LoggerFactory.getLogger(VnfmAdapterCreationNotification.class); + @Override public void run() { try { Thread.sleep(10000); } catch (final InterruptedException e) { - e.printStackTrace(); + logger.error("Error occured while simulating creation ", e); Thread.currentThread().interrupt(); } - System.out.println("Call to VNFM Adapter-Create"); + logger.info("Call to VNFM Adapter-Create"); } } diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterDeletionNotification.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterDeletionNotification.java index f7a8eaa2dd..af6064fd6a 100644 --- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterDeletionNotification.java +++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterDeletionNotification.java @@ -22,6 +22,9 @@ package org.onap.svnfm.simulator.notifications; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech) @@ -29,15 +32,17 @@ package org.onap.svnfm.simulator.notifications; */ public class VnfmAdapterDeletionNotification implements Runnable { + private static final Logger logger = LoggerFactory.getLogger(VnfmAdapterDeletionNotification.class); + @Override public void run() { try { Thread.sleep(10000); } catch (final InterruptedException e) { - e.printStackTrace(); + logger.error("Error occured while simulating deletion ", e); Thread.currentThread().interrupt(); } - System.out.println("Call to VNFM Adapter-Delete"); + logger.info("Call to VNFM Adapter-Delete"); } } -- cgit 1.2.3-korg