Remove MdcDataErrorMessage #2 65/29365/3
authorvempo <vitaliy.emporopulo@amdocs.com>
Sat, 27 Jan 2018 15:49:26 +0000 (17:49 +0200)
committerAvi Gaffa <avi.gaffa@amdocs.com>
Sun, 28 Jan 2018 07:24:14 +0000 (07:24 +0000)
Change-Id: I8a89538aa31000cf5b04a38a175156ccaba5ed51
Issue-ID: SDC-875
Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
12 files changed:
openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java
openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java
openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java

index c3ee44c..a909e04 100644 (file)
@@ -24,7 +24,6 @@ import com.datastax.driver.mapping.annotations.Table;
 import com.google.common.io.ByteStreams;
 import org.openecomp.sdc.common.errors.SdcRuntimeException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -80,10 +79,6 @@ public class EnrichedServiceArtifactEntity implements ServiceElementEntity {
         try {
             this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent()));
         } catch (IOException ioException) {
-            MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-                    LoggerTragetServiceName.CREATE_SERVICE_ENRICH_ARTIFACT, ErrorLevel.ERROR.name(),
-                    LoggerErrorCode.DATA_ERROR.getErrorCode(),
-                    LoggerErrorDescription.CREATE_ENRICH_SERVICE_ARTIFACT);
             throw new SdcRuntimeException(ioException);
         }
 
index 65c3d94..2207d3f 100644 (file)
@@ -24,7 +24,6 @@ import com.datastax.driver.mapping.annotations.Table;
 import com.google.common.io.ByteStreams;
 import org.openecomp.sdc.common.errors.SdcRuntimeException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -83,10 +82,6 @@ public class EnrichedServiceTemplateEntity implements ServiceElementEntity {
         try {
             this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent()));
         } catch (IOException ioException) {
-            MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-                    LoggerTragetServiceName.CREATE_ENRICH_SERVICE_TEMPLATE, ErrorLevel.ERROR.name(),
-                    LoggerErrorCode.DATA_ERROR.getErrorCode(),
-                    LoggerErrorDescription.CREATE_ENRICH_SERVICE_TEMPLATE);
             throw new SdcRuntimeException(ioException);
         }
 
index 71b3e49..08ecc5d 100644 (file)
@@ -24,7 +24,6 @@ import com.datastax.driver.mapping.annotations.Table;
 import com.google.common.io.ByteStreams;
 import org.openecomp.sdc.common.errors.SdcRuntimeException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -83,10 +82,6 @@ public class ServiceTemplateEntity implements ServiceElementEntity {
         try {
             this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent()));
         } catch (IOException ioException) {
-            MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-                    LoggerTragetServiceName.CREATE_SERVICE_TEMPLATE, ErrorLevel.ERROR.name(),
-                    LoggerErrorCode.DATA_ERROR.getErrorCode(),
-                    LoggerErrorDescription.CREATE_SERVICE_TEMPLATE);
             throw new SdcRuntimeException(ioException);
         }
 
index addbd74..c084a6b 100644 (file)
@@ -33,7 +33,6 @@ import org.openecomp.sdc.heat.datatypes.model.Output;
 import org.openecomp.sdc.heat.datatypes.model.Resource;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -348,9 +347,6 @@ public class TranslationService {
     for (String resourceId : heatOrchestrationTemplate.getResources().keySet()) {
       Resource resource = heatOrchestrationTemplate.getResources().get(resourceId);
       if (resource == null) {
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-            LoggerTragetServiceName.TRANSLATE_RESOURCE, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.TRANSLATE_HEAT);
         throw new CoreException(
             new ResourceNotFoundInHeatFileErrorBuilder(resourceId, heatFileName).build());
       }
index 6e5f0b4..7ad2cf9 100644 (file)
@@ -21,7 +21,6 @@ import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -65,11 +64,6 @@ public class ResourceWalker {
       try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) {
         filesContent.put(fileName, IOUtils.toString(reader));
       } catch (IOException exception) {
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-            LoggerTragetServiceName.READ_RESOURCE_FILE, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(),
-            LoggerErrorDescription.RESOURCE_FILE_READ_ERROR
-                + " File name = " + fileName);
         throw new CoreException((new ErrorCode.ErrorCodeBuilder())
             .withMessage(LoggerErrorDescription.RESOURCE_FILE_READ_ERROR
                 + " File name = " + fileName)
index 544bc0d..43df8eb 100644 (file)
@@ -28,7 +28,6 @@ import org.openecomp.sdc.heat.datatypes.model.Parameter;
 import org.openecomp.sdc.heat.datatypes.model.Resource;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -143,10 +142,6 @@ public class HeatValidationService {
     if (fileContent.isPresent()) {
       return new YamlUtil().yamlToObject(fileContent.get(), HeatOrchestrationTemplate.class);
     } else {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-              LoggerTragetServiceName.VALIDATE_PROPERTIES_MATCH_NESTED_PARAMETERS,
-              ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(),
-              LoggerErrorDescription.EMPTY_FILE);
       Exception exception = new Exception(String.format(NO_CONTENT_IN_FILE_MSG, fileName));
       LOGGER.error("Error while reading file : " + fileName , exception);
       throw exception;
@@ -301,9 +296,6 @@ public class HeatValidationService {
       nestedHeatOrchestrationTemplate =
               new YamlUtil().yamlToObject(fileContent.get(), HeatOrchestrationTemplate.class);
     } else {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-              LoggerTragetServiceName.VALIDATE_NESTING_LOOPS, ErrorLevel.ERROR.name(),
-              LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.EMPTY_FILE);
       throw new Exception(String.format(NO_CONTENT_IN_FILE_MSG, nestedFileName));
     }
 
@@ -330,9 +322,6 @@ public class HeatValidationService {
       if (fileContent.isPresent()) {
         envContent = new YamlUtil().yamlToObject(fileContent.get(), Environment.class);
       } else {
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-                LoggerTragetServiceName.VALIDATE_ENV_FILE, ErrorLevel.ERROR.name(),
-                LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.EMPTY_FILE);
         throw new Exception(String.format(NO_CONTENT_IN_FILE_MSG, envFileName));
       }
     } catch (Exception exception) {
index 7ba177a..9d4d48a 100644 (file)
@@ -38,7 +38,6 @@ import org.openecomp.sdc.heat.services.HeatStructureUtil;
 import org.openecomp.sdc.heat.services.manifest.ManifestUtil;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -323,11 +322,6 @@ public class HeatValidator implements Validator {
         nestedHeatOrchestrationTemplate =
             new YamlUtil().yamlToObject(fileContent.get(), HeatOrchestrationTemplate.class);
       } else {
-        MdcDataErrorMessage
-            .createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-                LoggerTragetServiceName.VALIDATE_GET_ATTR_FROM_NESTED,
-                ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(),
-                LoggerErrorDescription.EMPTY_FILE);
         throw new Exception("The file '" + resourceType + "' has no content");
       }
     } catch (Exception exception) {
index 47cc6a9..d35d3ca 100644 (file)
@@ -27,7 +27,6 @@ import org.openecomp.sdc.heat.datatypes.manifest.FileData;
 import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -60,9 +59,6 @@ public class ManifestValidator implements Validator {
       if (content.isPresent()) {
         manifestContent = JsonUtil.json2Object(content.get(), ManifestContent.class);
       } else {
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-            LoggerTragetServiceName.VALIDATE_MANIFEST_CONTENT, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.EMPTY_FILE);
         throw new Exception("The manifest file '" + SdcCommon.MANIFEST_NAME + "' has no content");
       }
     } catch (Exception re) {
index cbbceab..77e82dc 100644 (file)
@@ -18,7 +18,6 @@ import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions;
 import org.openecomp.sdc.heat.services.HeatStructureUtil;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -128,9 +127,6 @@ public class ValidationUtil {
       if (fileContent.isPresent()) {
         envContent = new YamlUtil().yamlToObject(fileContent.get(), Environment.class);
       } else {
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-            LoggerTragetServiceName.VALIDATE_ENV_FILE, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.EMPTY_FILE);
         throw new Exception("The file '" + envFileName + "' has no content");
       }
     } catch (Exception exception) {
@@ -164,9 +160,6 @@ public class ValidationUtil {
   public static ManifestContent validateManifest(GlobalValidationContext globalContext) {
     Optional<InputStream> manifest = globalContext.getFileContent(SdcCommon.MANIFEST_NAME);
     if (!manifest.isPresent()) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-          LoggerTragetServiceName.VALIDATE_MANIFEST_CONTENT, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.MISSING_FILE);
       throw new RuntimeException("Can't load manifest file for Heat Validator");
     }
     ManifestContent manifestContent;
@@ -174,9 +167,6 @@ public class ValidationUtil {
       manifestContent = JsonUtil.json2Object(manifest.get(), ManifestContent.class);
     } catch (Exception exception) {
       LOG.debug("",exception);
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-          LoggerTragetServiceName.VALIDATE_MANIFEST_CONTENT, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_MANIFEST);
       throw new SdcRuntimeException("Can't load manifest file for Heat Validator");
     }
 
index cebbaef..ed28eda 100644 (file)
@@ -27,7 +27,6 @@ import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -95,9 +94,6 @@ public class DataModelUtil {
   public static void addSubstitutionMapping(ServiceTemplate serviceTemplate,
                                             SubstitutionMapping substitutionMapping) {
     if (serviceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Substitution Mapping", SERVICE_TEMPLATE)
               .build());
@@ -129,9 +125,6 @@ public class DataModelUtil {
                                                String substitutionMappingRequirementId,
                                                List<String> substitutionMappingRequirementList) {
     if (serviceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Substitution Mapping Requirements",
               SERVICE_TEMPLATE).build());
@@ -164,9 +157,6 @@ public class DataModelUtil {
                                                       String substitutionMappingCapabilityId,
                                                       List<String> substitutionMappingCapabilityList) {
     if (serviceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Substitution Mapping Capabilities",
               SERVICE_TEMPLATE).build());
@@ -208,9 +198,6 @@ public class DataModelUtil {
   public static void addNodeTemplate(ServiceTemplate serviceTemplate, String nodeTemplateId,
                                      NodeTemplate nodeTemplate) {
     if (serviceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Node Template", SERVICE_TEMPLATE).build());
     }
@@ -263,9 +250,6 @@ public class DataModelUtil {
   public static void addPolicyDefinition(ServiceTemplate serviceTemplate, String policyId,
                                          PolicyDefinition policyDefinition) {
     if (serviceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Policy Definition", SERVICE_TEMPLATE)
               .build());
@@ -291,9 +275,6 @@ public class DataModelUtil {
   public static void addNodeType(ServiceTemplate serviceTemplate, String nodeTypeId,
                                  NodeType nodeType) {
     if (serviceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder(NODE_TYPE, SERVICE_TEMPLATE).build());
     }
@@ -306,9 +287,6 @@ public class DataModelUtil {
   public static void removeNodeType(ServiceTemplate serviceTemplate,
                                     String nodeTypeId) {
     if (serviceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder(NODE_TYPE, SERVICE_TEMPLATE).build());
     }
@@ -329,9 +307,6 @@ public class DataModelUtil {
                                              String relationshipTemplateId,
                                              RelationshipTemplate relationshipTemplate) {
     if (serviceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Relationship Template", SERVICE_TEMPLATE)
               .build());
@@ -356,17 +331,11 @@ public class DataModelUtil {
   public static void addRequirementAssignment(NodeTemplate nodeTemplate, String requirementId,
                                               RequirementAssignment requirementAssignment) {
     if (nodeTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Requirement Assignment", "Node Template")
               .build());
     }
     if (requirementAssignment.getNode() == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(new InvalidRequirementAssignmentErrorBuilder(requirementId).build());
     }
 
@@ -477,9 +446,6 @@ public class DataModelUtil {
   public static void addGroupDefinitionToTopologyTemplate(ServiceTemplate serviceTemplate,
                                                           String groupName, GroupDefinition group) {
     if (serviceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Group Definition", SERVICE_TEMPLATE)
               .build());
@@ -659,9 +625,6 @@ public class DataModelUtil {
                                                          String parameterDefinitionId,
                                                          ParameterDefinition parameterDefinition) {
     if (Objects.isNull(serviceTemplate)) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Topology Template Input Parameter",
               SERVICE_TEMPLATE).build());
@@ -688,9 +651,6 @@ public class DataModelUtil {
                                                           String parameterDefinitionId,
                                                           ParameterDefinition parameterDefinition) {
     if (Objects.isNull(serviceTemplate)) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
       throw new CoreException(
           new InvalidAddActionNullEntityErrorBuilder("Topology Template Output Parameter",
               SERVICE_TEMPLATE).build());
index 898025c..6d9d16f 100644 (file)
@@ -22,7 +22,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.openecomp.core.utilities.CommonMethods;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -304,9 +303,6 @@ public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService {
         return Optional.of(substituteServiceTemplate.toString());
       }
     }
-    MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-        LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-        LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_PROPERTY);
     throw new CoreException(
         new ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder(substituteNodeTemplateId)
             .build());
@@ -315,9 +311,6 @@ public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService {
   private void handleNoSubstituteServiceTemplate(String substituteNodeTemplateId,
                                                  Object substituteServiceTemplate) {
     if (substituteServiceTemplate == null) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_PROPERTY);
       throw new CoreException(
           new ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder(substituteNodeTemplateId)
               .build());
@@ -441,9 +434,6 @@ public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService {
         returnEntity = new NodeType();
         break;
       default:
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-            LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_ENTITY);
         throw new RuntimeException(
             "Entity[" + elementType + "] id[" + typeId + "] flat not supported");
     }
@@ -654,9 +644,6 @@ public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService {
         }
         break;
       default:
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-            LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_ENTITY);
         throw new RuntimeException(
             "Entity[" + elementType + "] id[" + typeId + "] flat not supported");
     }
index 6f4ec17..f0a12e6 100644 (file)
@@ -23,7 +23,6 @@ import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
@@ -76,9 +75,6 @@ public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService {
         packArtifacts(zos, artifactFiles);
       }
       if (toscaServiceModel.getEntryDefinitionServiceTemplate() == null) {
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-            LoggerTragetServiceName.CREATE_CSAR, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.CREATE_CSAR);
         throw new CoreException(new CsarMissingEntryPointErrorBuilder().build());
       }
       createAndPackToscaMetaFile(zos, toscaServiceModel.getEntryDefinitionServiceTemplate());
@@ -86,9 +82,6 @@ public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService {
         packExternalArtifacts(zos, externalArtifacts);
       }
     } catch (IOException ex) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.CREATE_CSAR, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.CREATE_CSAR);
       throw new CoreException(new CsarCreationErrorBuilder().build(), ex);
     }
     return baos.toByteArray();
@@ -137,9 +130,6 @@ public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService {
         writeBytesToZip(zos, externalArtifacts.getFileContent(filenameIncludingPath));
 
       } catch (IOException ex) {
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-            LoggerTragetServiceName.PACK_ARTIFACTS, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.PACK_ARTIFACTS);
         throw new RuntimeException(ex);
       } finally {
         try {
@@ -160,9 +150,6 @@ public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService {
         writeBytesToZip(zos, artifacts.getFileContent(fileName));
 
       } catch (IOException ex) {
-        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-            LoggerTragetServiceName.PACK_ARTIFACTS, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.PACK_ARTIFACTS);
         throw new RuntimeException(ex);
       } finally {
         try {