summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-lib/src/main
diff options
context:
space:
mode:
authorvempo <vitaliy.emporopulo@amdocs.com>2018-01-27 17:49:26 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-01-28 07:24:14 +0000
commit4192751073f5738777b9fdf42dfc707d0069c3ee (patch)
treee135bc6d9a559a19992438655e8ed4446bf738fe /openecomp-be/lib/openecomp-tosca-lib/src/main
parentde60ce87b314a37e8b6af96f59df91e5422fbe89 (diff)
Remove MdcDataErrorMessage #2
Change-Id: I8a89538aa31000cf5b04a38a175156ccaba5ed51 Issue-ID: SDC-875 Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main')
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java40
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java13
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java13
3 files changed, 0 insertions, 66 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
index cebbaef602..ed28eda06b 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
@@ -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());
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
index 898025c44d..6d9d16fadc 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
@@ -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");
}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java
index 6f4ec173a8..f0a12e6c10 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java
@@ -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 {