From f6eaa46641b4ddab5797eb0920771f81779cd5c3 Mon Sep 17 00:00:00 2001 From: vempo Date: Thu, 4 Jan 2018 18:46:09 +0200 Subject: Remove enter/exit debug #5 Change-Id: I756f8fc8ae24fe7840e9189274ea749c5555dc78 Issue-ID: SDC-875 Signed-off-by: vempo --- .../impl/util/HeatValidationService.java | 48 ------------- .../impl/validators/ContrailValidator.java | 31 -------- .../ForbiddenResourceGuideLineValidator.java | 7 -- .../validation/impl/validators/HeatValidator.java | 82 ---------------------- .../impl/validators/ManifestValidator.java | 12 ---- .../validation/impl/validators/YamlValidator.java | 6 -- .../ContrailNetworkPolicyResourceValidator.java | 7 -- .../heatresource/NestedResourceValidator.java | 17 ----- .../heatresource/NeutronPortResourceValidator.java | 12 ---- .../NovaServerGroupResourceValidator.java | 7 -- .../heatresource/NovaServerResourceValidator.java | 18 ----- .../ResourceGroupResourceValidator.java | 23 ------ 12 files changed, 270 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main') diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java index e437892758..544bc0dae3 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java @@ -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.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -53,7 +52,6 @@ public class HeatValidationService { private static final Logger LOGGER = LoggerFactory.getLogger(HeatValidator.class); private static final String NESTED_FILE = "nested file"; private static final String NO_CONTENT_IN_FILE_MSG = "The file ' %s ' has no content"; - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private HeatValidationService(){ } @@ -66,9 +64,6 @@ public class HeatValidationService { */ public static void checkArtifactsExistence(String fileName, Set artifactsNames, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); artifactsNames .stream() .filter(artifactName -> !globalContext.getFileContextMap().containsKey(artifactName)) @@ -80,8 +75,6 @@ public class HeatValidationService { Messages.MISSING_ARTIFACT.getErrorMessage(), artifactName), LoggerTragetServiceName.VALIDATE_ARTIFACTS_EXISTENCE, LoggerErrorDescription.MISSING_FILE)); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } /** @@ -125,9 +118,6 @@ public class HeatValidationService { Map parentParameters, Map nestedParameters, Set nestedParametersNames) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", parentFileName); - HeatOrchestrationTemplate parentHeatOrchestrationTemplate; HeatOrchestrationTemplate nestedHeatOrchestrationTemplate; @@ -135,7 +125,6 @@ public class HeatValidationService { nestedHeatOrchestrationTemplate = getHeatOrchestrationTemplate(nestedFileName, globalContext); parentHeatOrchestrationTemplate = getHeatOrchestrationTemplate(parentFileName, globalContext); } catch (Exception exception) { - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", parentFileName); return; } @@ -144,8 +133,6 @@ public class HeatValidationService { if (!nestedParameters.isEmpty()) { nestedParametersNames.addAll(nestedHeatOrchestrationTemplate.getParameters().keySet()); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", parentFileName); } private static HeatOrchestrationTemplate getHeatOrchestrationTemplate(String fileName, @@ -171,8 +158,6 @@ public class HeatValidationService { String resourceName, Set resourceFileProperties, GlobalValidationContext globalContext) { - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", parentFileName); - Map parentParameters = new HashMap<>(); Map nestedParameters = new HashMap<>(); Set nestedParametersNames = new HashSet<>(); @@ -181,8 +166,6 @@ public class HeatValidationService { checkNoMissingParameterInNested(parentFileName, nestedFileName, resourceName, resourceFileProperties, nestedParametersNames, globalContext); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", parentFileName); } public static void checkNestedInputValuesAlignWithType(String parentFileName, @@ -190,8 +173,6 @@ public class HeatValidationService { String resourceName, Resource resource, Optional indexVarValue, GlobalValidationContext globalContext) { - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", parentFileName); - Map parentParameters = new HashMap<>(); Map nestedParameters = new HashMap<>(); Set nestedParametersNames = new HashSet<>(); @@ -200,8 +181,6 @@ public class HeatValidationService { checkNestedInputValuesAlignWithType(parentFileName, nestedFileName, nestedParameters, resourceName, resource, indexVarValue, globalContext); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", parentFileName); } private static void checkNoMissingParameterInNested(String parentFileName, String nestedFileName, @@ -209,9 +188,6 @@ public class HeatValidationService { Set resourceFileProperties, Set nestedParametersNames, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("nested file", nestedFileName); - if (CollectionUtils.isNotEmpty(nestedParametersNames)) { resourceFileProperties .stream() @@ -225,8 +201,6 @@ public class HeatValidationService { LoggerTragetServiceName.VALIDATE_PROPERTIES_MATCH_NESTED_PARAMETERS, LoggerErrorDescription.MISSING_PARAMETER_IN_NESTED)); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage(NESTED_FILE, nestedFileName); } private static void checkNestedInputValuesAlignWithType(String parentFileName, @@ -235,9 +209,6 @@ public class HeatValidationService { String resourceName, Resource resource, Optional indexVarValue, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(NESTED_FILE, nestedFileName); - Map properties = resource.getProperties(); for (Map.Entry propertyEntry : properties.entrySet()) { String parameterName = propertyEntry.getKey(); @@ -251,8 +222,6 @@ public class HeatValidationService { globalContext); } } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage(NESTED_FILE, nestedFileName); } private static void validateStaticValueForNestedInputParameter(String parentFileName, @@ -263,9 +232,6 @@ public class HeatValidationService { Parameter parameterInNested, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(NESTED_FILE, nestedFileName); - if (parameterInNested == null) { return; } @@ -278,8 +244,6 @@ public class HeatValidationService { LoggerTragetServiceName.VALIDATE_PROPERTIES_MATCH_NESTED_PARAMETERS, LoggerErrorDescription.WRONG_VALUE_ASSIGNED_NESTED_PARAMETER); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage(NESTED_FILE, nestedFileName); } @@ -295,9 +259,6 @@ public class HeatValidationService { public static boolean isNestedLoopExistInFile(String callingFileName, String nestedFileName, List filesInLoop, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", callingFileName); - HeatOrchestrationTemplate nestedHeatOrchestrationTemplate; try { nestedHeatOrchestrationTemplate = getNestedHeatOrchestrationTemplate(nestedFileName, @@ -306,8 +267,6 @@ public class HeatValidationService { LOGGER.error("Error while reading file : " + nestedFileName, exception); LOGGER.warn("HEAT Validator will not be executed on file " + nestedFileName + " due to illegal HEAT format"); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", callingFileName); return false; } filesInLoop.add(nestedFileName); @@ -316,8 +275,6 @@ public class HeatValidationService { : nestedHeatOrchestrationTemplate.getResources().values(); boolean isNestedLoopExist = addNestedFilesInLoopAndCheckIfNestedLoopExist(nestedResources, callingFileName, filesInLoop, globalContext); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", callingFileName); return isNestedLoopExist; } private static boolean addNestedFilesInLoopAndCheckIfNestedLoopExist( @@ -329,7 +286,6 @@ public class HeatValidationService { String resourceType = resource.getType(); if (Objects.nonNull(resourceType) && isNestedResource(resourceType)) { - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", callingFileName); return resourceType.equals(callingFileName) || !filesInLoop.contains(resourceType) && isNestedLoopExistInFile(callingFileName, resourceType, filesInLoop, globalContext); } @@ -368,9 +324,6 @@ public class HeatValidationService { */ public static Environment validateEnvContent(String fileName, String envFileName, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("env file", envFileName); - Environment envContent; try { Optional fileContent = globalContext.getFileContent(envFileName); @@ -384,7 +337,6 @@ public class HeatValidationService { } } catch (Exception exception) { LOGGER.error("Error while reading env file : " + envFileName, exception); - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("env file", envFileName); return null; } return envContent; diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java index 0980bf93ba..4615f7be45 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java @@ -30,7 +30,6 @@ import org.openecomp.sdc.heat.services.HeatConstants; 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.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.tosca.services.YamlUtil; @@ -45,7 +44,6 @@ import java.util.Optional; public class ContrailValidator implements Validator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private static final Logger LOGGER = LoggerFactory.getLogger(ContrailValidator.class); private static final ErrorMessageCode ERROR_CODE_CTL_1 = new ErrorMessageCode("CTL1"); private static final ErrorMessageCode ERROR_CODE_CTL_2 = new ErrorMessageCode("CTL2"); @@ -54,8 +52,6 @@ public class ContrailValidator implements Validator { @Override public void validate(GlobalValidationContext globalContext) { - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null, null); - ManifestContent manifestContent; try { manifestContent = ValidationUtil.validateManifest(globalContext); @@ -70,8 +66,6 @@ public class ContrailValidator implements Validator { .filter(fileName -> FileData.isHeatFile(fileTypeMap.get(fileName))) .forEach(fileName -> validate(fileName, contrailResourcesMappingTo, globalContext)); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null, null); } @@ -87,25 +81,15 @@ public class ContrailValidator implements Validator { private void handleContrailV1AndContrailV2ResourceMerging(String fileName, ContrailResourcesMappingTo contrailResourcesMappingTo, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Optional fileContrailResourcesMappingTo = collectHeatFileContrailResources(globalContext, fileName); fileContrailResourcesMappingTo.ifPresent(contrailResourcesMappingTo::addAll); addContrailMergeValidationMessageToGlobalContext(globalContext, contrailResourcesMappingTo); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private void addContrailMergeValidationMessageToGlobalContext( GlobalValidationContext globalContext, ContrailResourcesMappingTo contrailResourcesMappingTo) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null, null); - if (!MapUtils.isEmpty(contrailResourcesMappingTo.getContrailV1Resources()) && !MapUtils.isEmpty(contrailResourcesMappingTo.getContrailV2Resources())) { globalContext.addMessage( @@ -117,8 +101,6 @@ public class ContrailValidator implements Validator { LoggerTragetServiceName.MERGE_OF_CONTRAIL_2_AND_3, LoggerErrorDescription.MERGE_CONTRAIL_2_AND_3); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null, null); } private Optional collectHeatFileContrailResources( @@ -137,10 +119,6 @@ public class ContrailValidator implements Validator { private Optional fetchContrailResourcesMapping(String fileName, InputStream fileContent ) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - ContrailResourcesMappingTo contrailResourcesMappingTo = new ContrailResourcesMappingTo(); HeatOrchestrationTemplate heatOrchestrationTemplate; try { @@ -149,7 +127,6 @@ public class ContrailValidator implements Validator { } catch (Exception ignored) { LOGGER.debug("",ignored); // the HeatValidator should handle file that is failing to parse - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); return Optional.empty(); } if( !MapUtils.isEmpty(heatOrchestrationTemplate.getResources())) { @@ -163,16 +140,12 @@ public class ContrailValidator implements Validator { } }); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); return Optional.of(contrailResourcesMappingTo); } private void validateNoContrailResourceTypeIsInUse(String fileName, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); globalContext.setMessageCode(ERROR_CODE_CTL_4); HeatOrchestrationTemplate heatOrchestrationTemplate = ValidationUtil.checkHeatOrchestrationPreCondition(fileName, globalContext); @@ -181,13 +154,10 @@ public class ContrailValidator implements Validator { return; } validateResourcePrefix(fileName, globalContext, heatOrchestrationTemplate); - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private void validateResourcePrefix(String fileName, GlobalValidationContext globalContext, HeatOrchestrationTemplate heatOrchestrationTemplate) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); Map resourcesMap = heatOrchestrationTemplate.getResources(); if(!MapUtils.isEmpty(resourcesMap)) { for (Map.Entry resourceEntry : resourcesMap.entrySet()) { @@ -200,7 +170,6 @@ public class ContrailValidator implements Validator { } } } - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java index 7b27d0caeb..bbd81e1327 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java @@ -29,7 +29,6 @@ import org.openecomp.sdc.heat.datatypes.model.Resource; 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.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.validation.Validator; @@ -41,7 +40,6 @@ import java.util.Objects; import java.util.Set; public class ForbiddenResourceGuideLineValidator implements Validator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private static Set forbiddenResources = new HashSet<>(); private static final ErrorMessageCode ERROR_CODE_FRG_1 = new ErrorMessageCode("FRG1"); private static final ErrorMessageCode ERROR_CODE_FRG_2 = new ErrorMessageCode("FRG2"); @@ -106,12 +104,8 @@ public class ForbiddenResourceGuideLineValidator implements Validator { private void validateResourceTypeIsForbidden(String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Map resourcesMap = heatOrchestrationTemplate.getResources(); if (MapUtils.isEmpty(resourcesMap)) { - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); return; } @@ -137,7 +131,6 @@ public class ForbiddenResourceGuideLineValidator implements Validator { } } } - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private boolean isResourceForbidden(String resourceType) { diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java index 073e63a21d..7ba177a4f3 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java @@ -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.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -59,7 +58,6 @@ import java.util.Optional; import java.util.Set; public class HeatValidator implements Validator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private static final Logger LOGGER = LoggerFactory.getLogger(HeatValidator.class); private static final ErrorMessageCode ERROR_CODE_HOT_1 = new ErrorMessageCode("HOT1"); private static final ErrorMessageCode ERROR_CODE_HOT_2 = new ErrorMessageCode("HOT2"); @@ -84,9 +82,6 @@ public class HeatValidator implements Validator { heatOrchestrationTemplate, Set artifacts, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Collection resourcesValues = heatOrchestrationTemplate.getResources() == null ? null : heatOrchestrationTemplate.getResources().values(); @@ -98,8 +93,6 @@ public class HeatValidator implements Validator { artifacts, globalContext); } } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static void validatePropertiesForAllRequiredArtifactsExist(Collection properties, @@ -127,9 +120,6 @@ public class HeatValidator implements Validator { HeatOrchestrationTemplate heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Set resourcesNames = heatOrchestrationTemplate.getResources() == null ? null : heatOrchestrationTemplate.getResources().keySet(); Collection resourcesValues = heatOrchestrationTemplate.getResources() == null ? null @@ -140,18 +130,12 @@ public class HeatValidator implements Validator { globalContext); checkResourceExistenceFromResourcesMap(fileName, resourcesNames, outputsValues, globalContext); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); - } private static void checkResourceExistenceFromResourcesMap(String fileName, Set resourcesNames, Collection valuesToSearchIn, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - if (CollectionUtils.isNotEmpty(valuesToSearchIn)) { for (Object value : valuesToSearchIn) { if (value instanceof Resource) { @@ -185,9 +169,6 @@ public class HeatValidator implements Validator { private static void handleReferencedResources(String fileName, Object valueToSearchReferencesIn, Set resourcesNames, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); globalContext.setMessageCode(ERROR_CODE_HOT_13); Set referencedResourcesNames = HeatStructureUtil .getReferencedValuesByFunctionName(fileName, @@ -197,18 +178,12 @@ public class HeatValidator implements Validator { checkIfResourceReferenceExist(fileName, resourcesNames, referencedResourcesNames, globalContext); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static void checkIfResourceReferenceExist(String fileName, Set referencedResourcesNames, Set referencedResources, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - referencedResources.stream() .filter(referencedResource -> !referencedResourcesNames .contains(referencedResource)) @@ -219,8 +194,6 @@ public class HeatValidator implements Validator { .REFERENCED_RESOURCE_NOT_FOUND.getErrorMessage(), referencedResource), LoggerTragetServiceName.VALIDATE_RESOURCE_REFERENCE_EXISTENCE, LoggerErrorDescription.RESOURCE_NOT_FOUND)); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } /* validation 16 */ @@ -229,9 +202,6 @@ public class HeatValidator implements Validator { HeatOrchestrationTemplate heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Set parametersNames = heatOrchestrationTemplate.getParameters() == null ? null : heatOrchestrationTemplate.getParameters().keySet(); Map resourcesMap = heatOrchestrationTemplate.getResources(); @@ -244,8 +214,6 @@ public class HeatValidator implements Validator { resourceEntry, globalContext); } } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static void validatePropertiesForGetParamPointToParameter(Map parametersNamesFromFile, Set referencedParametersNames, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - for (String parameterName : referencedParametersNames) { if (!isHeatPseudoParameter(parameterName) && !parametersNamesFromFile.contains(parameterName)) { @@ -287,8 +251,6 @@ public class HeatValidator implements Validator { LoggerErrorDescription.PARAMETER_NOT_FOUND); } } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static boolean isHeatPseudoParameter(String parameterName) { @@ -300,9 +262,6 @@ public class HeatValidator implements Validator { private static void validateGetAttr(String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Map outputMap; outputMap = heatOrchestrationTemplate.getOutputs(); @@ -310,8 +269,6 @@ public class HeatValidator implements Validator { loopOverOutputMapAndValidateGetAttrFromNested(fileName, outputMap, heatOrchestrationTemplate, globalContext); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static void loopOverOutputMapAndValidateGetAttrFromNested(String fileName, @@ -399,10 +356,6 @@ public class HeatValidator implements Validator { private static void validateEnvFile(String fileName, String envFileName, HeatOrchestrationTemplate heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Environment envContent; if (!envFileName.contains(".env")) { @@ -419,9 +372,6 @@ public class HeatValidator implements Validator { validateEnvParametersMatchDefinedHeatParameterTypes(envFileName, envContent, globalContext, heatOrchestrationTemplate); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); - } private static void validateEnvContentIsSubSetOfHeatParameters(String envFile, @@ -430,9 +380,6 @@ public class HeatValidator implements Validator { globalContext, HeatOrchestrationTemplate heatOrchestrationTemplate) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", envFile); - Set parametersNames = heatOrchestrationTemplate.getParameters() == null ? null : heatOrchestrationTemplate.getParameters().keySet(); @@ -454,8 +401,6 @@ public class HeatValidator implements Validator { } } } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", envFile); } private static void validateEnvEntryForvalidateEnvContentIsSubSetOfHeatParameters( @@ -478,9 +423,6 @@ public class HeatValidator implements Validator { heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Map parametersMap = heatOrchestrationTemplate.getParameters() == null ? null : heatOrchestrationTemplate.getParameters(); @@ -490,8 +432,6 @@ public class HeatValidator implements Validator { fileName, globalContext); } } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static void validateParameterEntryForParameterDefaultTypeAlignWithType( Map.Entry parameterEntry, @@ -519,10 +459,6 @@ public class HeatValidator implements Validator { Environment envContent, GlobalValidationContext globalContext, HeatOrchestrationTemplate heatOrchestrationTemplate) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", envFile); - Map heatParameters = heatOrchestrationTemplate.getParameters(); if (MapUtils.isNotEmpty(heatParameters) && MapUtils.isNotEmpty(envContent.getParameters())) { @@ -531,8 +467,6 @@ public class HeatValidator implements Validator { } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", envFile); } private static void validateEnvEntryForEnvParametersMatchDefinedHeatParameterTypes( @@ -562,7 +496,6 @@ public class HeatValidator implements Validator { @Override public void validate(GlobalValidationContext globalContext) { - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null, null); ManifestContent manifestContent; try { manifestContent = ValidationUtil.validateManifest(globalContext); @@ -592,9 +525,6 @@ public class HeatValidator implements Validator { Messages.ARTIFACT_FILE_NOT_REFERENCED.getErrorMessage()), LoggerTragetServiceName.CHECK_FOR_ORPHAN_ARTIFACTS, LoggerErrorDescription.ARTIFACT_NOT_REFERENCED)); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null, null); - } private boolean isManifestArtifact(Set manifestArtifacts, String fileName) { @@ -657,10 +587,6 @@ public class HeatValidator implements Validator { private static void checkResourceDependsOn(String fileName, Resource resource, Set resourcesNames, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Object dependencies = resource.getDepends_on(); if (dependencies instanceof Collection) { ((Collection) dependencies) @@ -679,18 +605,12 @@ public class HeatValidator implements Validator { (String) dependencies), LoggerTragetServiceName.CHECK_RESOURCE_DEPENDS_ON, LoggerErrorDescription.MISSING_RESOURCE_DEPENDS_ON); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private void validateHeatBaseStructure(String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - if (heatOrchestrationTemplate.getHeat_template_version() == null) { globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder .getErrorWithParameters(ERROR_CODE_HOT_9,Messages @@ -706,8 +626,6 @@ public class HeatValidator implements Validator { "The heat file does not contain any resources"), LoggerTragetServiceName.VALIDATE_HEAT_FORMAT, LoggerErrorDescription.INVALID_HEAT_FORMAT); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java index 08cd2450f2..47cc6a9f25 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java @@ -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.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -42,7 +41,6 @@ import java.util.Optional; public class ManifestValidator implements Validator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private static final Logger LOGGER = LoggerFactory.getLogger(YamlValidator.class); private static final ErrorMessageCode ERROR_CODE_MNF_1 = new ErrorMessageCode("MNF1"); private static final ErrorMessageCode ERROR_CODE_MNF_2 = new ErrorMessageCode("MNF2"); @@ -55,8 +53,6 @@ public class ManifestValidator implements Validator { @Override public void validate(GlobalValidationContext globalContext) { - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null, null); - Optional content = globalContext.getFileContent(SdcCommon.MANIFEST_NAME); ManifestContent manifestContent; @@ -98,8 +94,6 @@ public class ManifestValidator implements Validator { Messages.MISSING_FILE_IN_MANIFEST.getErrorMessage()), LoggerTragetServiceName.VALIDATE_FILE_IN_MANIFEST, LoggerErrorDescription.MISSING_FILE) ); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null, null); } private boolean isNotManifestFiles(List manifestFiles, String name) { @@ -113,14 +107,8 @@ public class ManifestValidator implements Validator { private List getManifestFileList(ManifestContent manifestContent, GlobalValidationContext context) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null, null); - ManifestScanner manifestScanner = new ManifestScanner(); manifestScanner.scan(null, manifestContent.getData(), context); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null, null); return manifestScanner.getFileList(); } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java index 7e1ba98de5..bf89d69893 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java @@ -21,7 +21,6 @@ import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; import org.openecomp.core.validation.types.GlobalValidationContext; import org.openecomp.sdc.common.errors.Messages; import org.openecomp.sdc.datatypes.error.ErrorLevel; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.tosca.services.YamlUtil; @@ -34,21 +33,16 @@ import java.util.Map; import java.util.Optional; public class YamlValidator implements Validator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private static final ErrorMessageCode ERROR_CODE_YML_1 = new ErrorMessageCode("YML1"); private static final ErrorMessageCode ERROR_CODE_YML_2 = new ErrorMessageCode("YML2"); @Override public void validate(GlobalValidationContext globalContext) { - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null, null); - Collection files = globalContext.files( (fileName, globalValidationContext) -> fileName.endsWith(".yaml") || fileName.endsWith(".yml") || fileName.endsWith(".env")); files.stream().forEach(fileName -> validate(fileName, globalContext)); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null, null); } private void validate(String fileName, GlobalValidationContext globalContext) { diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidator.java index 8aa5714f2c..9f202e3b4a 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidator.java @@ -8,7 +8,6 @@ import org.openecomp.sdc.common.errors.Messages; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; import org.openecomp.sdc.heat.datatypes.model.Resource; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.validation.ResourceValidator; @@ -23,7 +22,6 @@ import java.util.Map; * Created by TALIO on 2/28/2017. */ public class ContrailNetworkPolicyResourceValidator implements ResourceValidator { - private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); private static final ErrorMessageCode ERROR_CODE_HNP1 = new ErrorMessageCode("HNP1"); private static final ErrorMessageCode ERROR_CODE_HNP2 = new ErrorMessageCode("HNP2"); @@ -39,8 +37,6 @@ public class ContrailNetworkPolicyResourceValidator implements ResourceValidator Map.Entry resourceEntry, GlobalValidationContext globalContext, HeatResourceValidationContext validationContext) { - mdcDataDebugMessage.debugEntryMessage("file", fileName); - Map>> referencedNetworkAttachPoliciesResources = validationContext.getFileLevelResourceDependencies() .get(HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE.getHeatResource()); @@ -61,9 +57,6 @@ public class ContrailNetworkPolicyResourceValidator implements ResourceValidator handleNetworkAttachPolicyReferences(fileName, resourceEntry, referencedNetworkAttachPoliciesResources, globalContext); - - mdcDataDebugMessage.debugExitMessage("file", fileName); - } private static void handleNetworkAttachPolicyReferences(String fileName, diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NestedResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NestedResourceValidator.java index 41897f4563..84899d1967 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NestedResourceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NestedResourceValidator.java @@ -23,7 +23,6 @@ import org.openecomp.core.validation.types.GlobalValidationContext; import org.openecomp.sdc.common.errors.Messages; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.heat.datatypes.model.Resource; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.validation.ResourceValidator; @@ -41,7 +40,6 @@ import java.util.Set; * Created by TALIO on 2/22/2017. */ public class NestedResourceValidator implements ResourceValidator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private static final ErrorMessageCode ERROR_CODE_HNR1 = new ErrorMessageCode("HNR1"); private static final ErrorMessageCode ERROR_CODE_HNR2 = new ErrorMessageCode("HNR2"); private static final ErrorMessageCode ERROR_CODE_HNR3 = new ErrorMessageCode("HNR3"); @@ -58,14 +56,9 @@ public class NestedResourceValidator implements ResourceValidator { private static void handleNestedResourceType(String fileName, String resourceName, Resource resource, Optional indexVarValue, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - validateAllPropertiesMatchNestedParameters(fileName, resourceName, resource, indexVarValue, globalContext); validateLoopsOfNestingFromFile(fileName, resource.getType(), globalContext); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } public static void validateAllPropertiesMatchNestedParameters(String fileName, @@ -74,9 +67,6 @@ public class NestedResourceValidator implements ResourceValidator { Optional indexVarValue, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - String resourceType = resource.getType(); if (globalContext.getFileContextMap().containsKey(resourceType)) { Set propertiesNames = @@ -100,15 +90,10 @@ public class NestedResourceValidator implements ResourceValidator { LoggerTragetServiceName.VALIDATE_PROPERTIES_MATCH_NESTED_PARAMETERS, LoggerErrorDescription.MISSING_FILE); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } public static void validateLoopsOfNestingFromFile(String fileName, String resourceType, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - List filesInLoop = new ArrayList<>(Collections.singletonList(fileName)); if (HeatValidationService .isNestedLoopExistInFile(fileName, resourceType, filesInLoop, globalContext)) { @@ -117,7 +102,5 @@ public class NestedResourceValidator implements ResourceValidator { HeatValidationService.drawFilesLoop(filesInLoop)), LoggerTragetServiceName.VALIDATE_NESTING_LOOPS, LoggerErrorDescription.NESTED_LOOP); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidator.java index befbe3bb97..2568f40416 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidator.java @@ -27,7 +27,6 @@ import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions; import org.openecomp.sdc.heat.services.HeatStructureUtil; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.validation.ResourceValidator; @@ -42,7 +41,6 @@ import java.util.Objects; import java.util.Set; public class NeutronPortResourceValidator implements ResourceValidator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private static final ErrorMessageCode ERROR_HPRODE_HPR1 = new ErrorMessageCode("HPR1"); private static final ErrorMessageCode ERROR_HPRODE_HPR2 = new ErrorMessageCode("HPR2"); private static final ErrorMessageCode ERROR_HPRODE_HPR3 = new ErrorMessageCode("HPR3"); @@ -61,9 +59,6 @@ public class NeutronPortResourceValidator implements ResourceValidator { Map.Entry resourceEntry, HeatResourceValidationContext heatResourceValidationContext, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Map>> portIdToPointingResources = heatResourceValidationContext.getFileLevelResourceDependencies() .get(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource()); @@ -85,8 +80,6 @@ public class NeutronPortResourceValidator implements ResourceValidator { portIdToPointingResources.get(portResourceId); checkPortBindingFromMap( fileName, portResourceId, pointingResourcesToCurrPort, globalContext); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static void checkPortBindingFromMap(String fileName, @@ -143,9 +136,6 @@ public class NeutronPortResourceValidator implements ResourceValidator { Map.Entry resourceEntry, List securityGroupResourceNameList, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", filename); - Map propertiesMap = resourceEntry.getValue().getProperties(); if (MapUtils.isEmpty(propertiesMap)) { @@ -167,8 +157,6 @@ public class NeutronPortResourceValidator implements ResourceValidator { securityGroupResourceNameList, globalContext); } } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", filename); } private static void removeSecurityGroupNamesFromListByGivenFunction(String filename, diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerGroupResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerGroupResourceValidator.java index e70b884805..afc9e3cef6 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerGroupResourceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerGroupResourceValidator.java @@ -25,7 +25,6 @@ import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; import org.openecomp.sdc.heat.datatypes.model.PolicyTypes; import org.openecomp.sdc.heat.datatypes.model.Resource; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.validation.ResourceValidator; @@ -38,7 +37,6 @@ import java.util.Map; import java.util.Objects; public class NovaServerGroupResourceValidator implements ResourceValidator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private static final ErrorMessageCode ERROR_CODE_HNG1 = new ErrorMessageCode("HNG1"); private static final ErrorMessageCode ERROR_CODE_HNG2 = new ErrorMessageCode("HNG2"); private static final ErrorMessageCode ERROR_CODE_HNG3 = new ErrorMessageCode("HNG3"); @@ -55,9 +53,6 @@ public class NovaServerGroupResourceValidator implements ResourceValidator { private static void validateNovaServerGroupPolicy(String fileName, Map.Entry resourceEntry, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Resource resource = resourceEntry.getValue(); Object policies = resource.getProperties() == null ? null : resource.getProperties().get("policies"); @@ -83,8 +78,6 @@ public class NovaServerGroupResourceValidator implements ResourceValidator { LoggerErrorDescription.WRONG_POLICY_SERVER_GROUP); } } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static boolean isGivenPolicyValid(Object policy) { diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java index 7d8ab251b9..b6bbeb5172 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java @@ -27,7 +27,6 @@ import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; import org.openecomp.sdc.heat.datatypes.model.PropertiesMapKeyTypes; import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.validation.ResourceValidator; @@ -37,7 +36,6 @@ import org.openecomp.sdc.validation.type.HeatResourceValidationContext; import java.util.Map; public class NovaServerResourceValidator implements ResourceValidator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); private static final ErrorMessageCode ERROR_CODE_HNS1 = new ErrorMessageCode("HNS1"); private static final ErrorMessageCode ERROR_CODE_HNS2 = new ErrorMessageCode("HNS2"); @@ -55,15 +53,9 @@ public class NovaServerResourceValidator implements ResourceValidator { Map.Entry resourceEntry, HeatResourceValidationContext heatResourceValidationContext, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - validateAssignedValueForImageOrFlavorFromNova(fileName, resourceEntry, globalContext); validateAllServerGroupsPointedByServerExistAndDefined (fileName, resourceEntry, heatResourceValidationContext.getHeatOrchestrationTemplate(), globalContext ); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); - } private static void validateAssignedValueForImageOrFlavorFromNova(String fileName, @@ -71,9 +63,6 @@ public class NovaServerResourceValidator implements ResourceValidator { resourceEntry, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Resource resource = resourceEntry.getValue(); Map propertiesMap = resource.getProperties(); if (propertiesMap.get(PropertiesMapKeyTypes.IMAGE.getKeyMap()) == null @@ -84,8 +73,6 @@ public class NovaServerResourceValidator implements ResourceValidator { LoggerTragetServiceName.VALIDATE_ASSIGNED_VALUES_FOR_NOVA_IMAGE_FLAVOR, LoggerErrorDescription.MISSING_NOVA_PROPERTIES); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } @SuppressWarnings("unchecked") @@ -93,9 +80,6 @@ public class NovaServerResourceValidator implements ResourceValidator { Map.Entry resourceEntry, HeatOrchestrationTemplate heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Map resourcesMap = heatOrchestrationTemplate.getResources(); Map resourceProperties = resourceEntry.getValue().getProperties(); Map schedulerHintsMap = @@ -107,8 +91,6 @@ public class NovaServerResourceValidator implements ResourceValidator { } validateServerGroupValue(fileName, resourceEntry, globalContext, resourcesMap, schedulerHintsMap); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static void validateServerGroupValue(String fileName, Map.Entry resourceEntry, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - globalContext.setMessageCode(ERROR_CODE_HRR6); HeatTreeManagerUtil .checkResourceTypeValid(fileName, resourceEntry.getKey(), resourceEntry.getValue(), @@ -89,8 +83,6 @@ public class ResourceGroupResourceValidator implements ResourceValidator { globalContext); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static Optional getResourceGroupIndexVarValue( @@ -118,14 +110,9 @@ public class ResourceGroupResourceValidator implements ResourceValidator { private static void handleNestedResourceType(String fileName, String resourceName, Resource resource, Optional indexVarValue, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - validateAllPropertiesMatchNestedParameters(fileName, resourceName, resource, indexVarValue, globalContext); validateLoopsOfNestingFromFile(fileName, resource.getType(), globalContext); - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static void validateAllPropertiesMatchNestedParameters(String fileName, @@ -134,9 +121,6 @@ public class ResourceGroupResourceValidator implements ResourceValidator { Optional indexVarValue, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - String resourceType = resource.getType(); if (globalContext.getFileContextMap().containsKey(resourceType)) { Set propertiesNames = @@ -160,15 +144,10 @@ public class ResourceGroupResourceValidator implements ResourceValidator { LoggerTragetServiceName.VALIDATE_PROPERTIES_MATCH_NESTED_PARAMETERS, LoggerErrorDescription.MISSING_FILE); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } private static void validateLoopsOfNestingFromFile(String fileName, String resourceType, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - List filesInLoop = new ArrayList<>(Collections.singletonList(fileName)); if (HeatValidationService .isNestedLoopExistInFile(fileName, resourceType, filesInLoop, globalContext)) { @@ -178,7 +157,5 @@ public class ResourceGroupResourceValidator implements ResourceValidator { HeatValidationService.drawFilesLoop(filesInLoop)), LoggerTragetServiceName.VALIDATE_NESTING_LOOPS, LoggerErrorDescription.NESTED_LOOP); } - - MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName); } } -- cgit 1.2.3-korg