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;
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());
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());
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());
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());
}
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());
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());
}
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());
}
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());
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());
}
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());
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());
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());