failed to import a tosca vsp 31/70731/3
authorYuli Shlosberg <ys9693@att.com>
Thu, 18 Oct 2018 11:59:56 +0000 (14:59 +0300)
committerMichael Lando <michael.lando@intl.att.com>
Mon, 22 Oct 2018 13:37:38 +0000 (13:37 +0000)
proper prints have added to log

Change-Id: I73e0441036dbc7206f148cf8fe8a21f6266397ce
Issue-ID: SDC-1683
Signed-off-by: Yuli Shlosberg <ys9693@att.com>
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java

index ebdbcea..03ffdd5 100644 (file)
@@ -78,12 +78,12 @@ import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
 import org.openecomp.sdc.common.api.ArtifactTypeEnum;
 import org.openecomp.sdc.common.api.Constants;
 import org.openecomp.sdc.common.datastructure.Wrapper;
+import org.openecomp.sdc.common.log.wrappers.Logger;
 import org.openecomp.sdc.common.util.GeneralUtility;
 import org.openecomp.sdc.common.util.ValidationUtils;
 import org.openecomp.sdc.common.util.YamlToObjectConverter;
 import org.openecomp.sdc.exception.ResponseFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.xml.sax.*;
 import org.yaml.snakeyaml.Yaml;
@@ -119,7 +119,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic {
     public static final String HEAT_ENV_SUFFIX = "env";
     private static final String ARTIFACT_PLACEHOLDER_FILE_EXTENSION = "fileExtension";
 
-    private static final Logger log = LoggerFactory.getLogger(ArtifactsBusinessLogic.class);
+    private static final Logger log = Logger.getLogger(ArtifactsBusinessLogic.class);
     public static final String FAILED_UPDATE_GROUPS = "Failed to update groups of the component {}. ";
     public static final String FAILED_UPDATE_ARTIFACT = "Failed to delete or update the artifact {}. Parent uniqueId is {}";
     public static final String FAILED_SAVE_ARTIFACT = "Failed to save the artifact.";
@@ -3258,7 +3258,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic {
         // currently done separately
         else {
             if (!isArtifactMetadataUpdate) {
-                log.debug("Payload is missing.");
+                log.debug("In artifact: {} Payload is missing.",artifactInfo.getArtifactName());
                 ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.MISSING_DATA, ARTIFACT_PAYLOAD);
                 return Either.right(responseFormat);
             }
index 69ac1b8..72d5487 100644 (file)
@@ -3,6 +3,8 @@ package org.openecomp.sdc.be.components.impl.exceptions;
 import org.openecomp.sdc.be.dao.api.ActionStatus;
 import org.openecomp.sdc.exception.ResponseFormat;
 
+import java.util.Arrays;
+
 public class ComponentException extends RuntimeException {
 
     /**
@@ -39,5 +41,21 @@ public class ComponentException extends RuntimeException {
         return params.clone();
     }
 
+    @Override
+    public String getMessage() {
+        return this.toString();
+    }
+
+    @Override
+    public String toString() {
+        return "ComponentException{" +
+                "responseFormat=" + responseFormat +
+                ", actionStatus=" + actionStatus +
+                ", params=" + Arrays.toString(params) +
+                '}';
+    }
+
+
+
 
 }