diff options
author | vempo <vitaliy.emporopulo@amdocs.com> | 2018-01-04 18:46:09 +0200 |
---|---|---|
committer | Vitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com> | 2018-01-04 18:14:35 +0000 |
commit | f6eaa46641b4ddab5797eb0920771f81779cd5c3 (patch) | |
tree | 79f2096f16d6ac237bc073f2c10dc332b095f49c /openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl | |
parent | 2b959a7fcdbf82ec9534d4b860a6100643eb6447 (diff) |
Remove enter/exit debug #5
Change-Id: I756f8fc8ae24fe7840e9189274ea749c5555dc78
Issue-ID: SDC-875
Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl')
12 files changed, 0 insertions, 270 deletions
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<String> 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<String, Parameter> parentParameters, Map<String, Parameter> nestedParameters, Set<String> 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<String> resourceFileProperties, GlobalValidationContext globalContext) { - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", parentFileName); - Map<String, Parameter> parentParameters = new HashMap<>(); Map<String, Parameter> nestedParameters = new HashMap<>(); Set<String> 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<String> indexVarValue, GlobalValidationContext globalContext) { - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", parentFileName); - Map<String, Parameter> parentParameters = new HashMap<>(); Map<String, Parameter> nestedParameters = new HashMap<>(); Set<String> 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<String> resourceFileProperties, Set<String> 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<String> indexVarValue, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(NESTED_FILE, nestedFileName); - Map<String, Object> properties = resource.getProperties(); for (Map.Entry<String, Object> 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<String> 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<InputStream> 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<ContrailResourcesMappingTo> 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<ContrailResourcesMappingTo> collectHeatFileContrailResources( @@ -137,10 +119,6 @@ public class ContrailValidator implements Validator { private Optional<ContrailResourcesMappingTo> 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<String, Resource> resourcesMap = heatOrchestrationTemplate.getResources(); if(!MapUtils.isEmpty(resourcesMap)) { for (Map.Entry<String, Resource> 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<String> 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<String, Resource> 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<String> artifacts, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Collection<Resource> 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<Object> properties, @@ -127,9 +120,6 @@ public class HeatValidator implements Validator { HeatOrchestrationTemplate heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Set<String> resourcesNames = heatOrchestrationTemplate.getResources() == null ? null : heatOrchestrationTemplate.getResources().keySet(); Collection<Resource> 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<String> 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<String> resourcesNames, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); globalContext.setMessageCode(ERROR_CODE_HOT_13); Set<String> 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<String> referencedResourcesNames, Set<String> 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<String> parametersNames = heatOrchestrationTemplate.getParameters() == null ? null : heatOrchestrationTemplate.getParameters().keySet(); Map<String, Resource> 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<String, @@ -272,10 +240,6 @@ public class HeatValidator implements Validator { Set<String> parametersNamesFromFile, Set<String> 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<String, Output> 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<String> 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<String, Parameter> 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<String, Parameter> parameterEntry, @@ -519,10 +459,6 @@ public class HeatValidator implements Validator { Environment envContent, GlobalValidationContext globalContext, HeatOrchestrationTemplate heatOrchestrationTemplate) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", envFile); - Map<String, Parameter> 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<String> manifestArtifacts, String fileName) { @@ -657,10 +587,6 @@ public class HeatValidator implements Validator { private static void checkResourceDependsOn(String fileName, Resource resource, Set<String> resourcesNames, GlobalValidationContext globalContext) { - - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Object dependencies = resource.getDepends_on(); if (dependencies instanceof Collection) { ((Collection<String>) 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<InputStream> 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<String> manifestFiles, String name) { @@ -113,14 +107,8 @@ public class ManifestValidator implements Validator { private List<String> 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<String> 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<String, Resource> resourceEntry, GlobalValidationContext globalContext, HeatResourceValidationContext validationContext) { - mdcDataDebugMessage.debugEntryMessage("file", fileName); - Map<String, Map<String, List<String>>> 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<String> 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<String> indexVarValue, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - String resourceType = resource.getType(); if (globalContext.getFileContextMap().containsKey(resourceType)) { Set<String> 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<String> 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<String, Resource> resourceEntry, HeatResourceValidationContext heatResourceValidationContext, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Map<String, Map<String, List<String>>> 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<String, Resource> resourceEntry, List<String> securityGroupResourceNameList, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", filename); - Map<String, Object> 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<String, Resource> 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<String, Resource> 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<String, Object> 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<String, Resource> resourceEntry, HeatOrchestrationTemplate heatOrchestrationTemplate, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - Map<String, Resource> resourcesMap = heatOrchestrationTemplate.getResources(); Map<String, Object> resourceProperties = resourceEntry.getValue().getProperties(); Map<String, Object> 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<String, diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ResourceGroupResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ResourceGroupResourceValidator.java index 06794923cf..a8e1ea5b40 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ResourceGroupResourceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ResourceGroupResourceValidator.java @@ -25,7 +25,6 @@ import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.heat.services.HeatConstants; import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil; -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; @@ -44,8 +43,6 @@ import java.util.Set; * Created by TALIO on 2/22/2017. */ public class ResourceGroupResourceValidator implements ResourceValidator { - private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage(); - private static final ErrorMessageCode ERROR_CODE_HRR1 = new ErrorMessageCode("HRR1"); private static final ErrorMessageCode ERROR_CODE_HRR2 = new ErrorMessageCode("HRR2"); private static final ErrorMessageCode ERROR_CODE_HRR3 = new ErrorMessageCode("HRR3"); @@ -64,9 +61,6 @@ public class ResourceGroupResourceValidator implements ResourceValidator { private static void validateResourceGroupType(String fileName, Map.Entry<String, Resource> 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<String> getResourceGroupIndexVarValue( @@ -118,14 +110,9 @@ public class ResourceGroupResourceValidator implements ResourceValidator { private static void handleNestedResourceType(String fileName, String resourceName, Resource resource, Optional<String> 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<String> indexVarValue, GlobalValidationContext globalContext) { - - MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName); - String resourceType = resource.getType(); if (globalContext.getFileContextMap().containsKey(resourceType)) { Set<String> 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<String> 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); } } |