summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src')
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java43
1 files changed, 3 insertions, 40 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
index 217ff857f6..d9e0351578 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
@@ -2,7 +2,6 @@ package org.openecomp.sdc.validation.util;
import org.apache.commons.collections4.CollectionUtils;
-import org.openecomp.core.utilities.CommonMethods;
import org.openecomp.core.utilities.json.JsonUtil;
import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
import org.openecomp.core.validation.types.GlobalValidationContext;
@@ -16,7 +15,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.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;
@@ -229,8 +227,9 @@ public class ValidationUtil {
}
} catch (Exception exception) {
globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
- .getErrorWithParameters(Messages.INVALID_HEAT_FORMAT_REASON.getErrorMessage(),
- getParserExceptionReason(exception)),
+ .getErrorWithParameters(globalContext.getMessageCode(),
+ Messages.INVALID_HEAT_FORMAT_REASON.getErrorMessage()
+ , getParserExceptionReason(exception)),
LoggerTragetServiceName.VALIDATE_HEAT_FORMAT,
LoggerErrorDescription.INVALID_HEAT_FORMAT);
mdcDataDebugMessage.debugExitMessage("file", fileName);
@@ -240,41 +239,5 @@ public class ValidationUtil {
return heatOrchestrationTemplate;
}
- public static Set<String> validateManifest(ManifestContent manifestContent,
- GlobalValidationContext globalContext) {
-
- mdcDataDebugMessage.debugEntryMessage("file", SdcCommon.MANIFEST_NAME);
-
- Set<String> baseFiles = ManifestUtil.getBaseFiles(manifestContent);
- if (baseFiles == null || baseFiles.size() == 0) {
- globalContext.addMessage(
- SdcCommon.MANIFEST_NAME,
- ErrorLevel.WARNING,
- ErrorMessagesFormatBuilder
- .getErrorWithParameters(Messages.MISSIN_BASE_HEAT_FILE.getErrorMessage()),
- LoggerTragetServiceName.VALIDATE_BASE_FILE,
- LoggerErrorDescription.MISSING_BASE_HEAT);
- } else if (baseFiles.size() > 1) {
- String baseFileList = getElementListAsString(baseFiles);
- globalContext.addMessage(
- SdcCommon.MANIFEST_NAME,
- ErrorLevel.WARNING,
- ErrorMessagesFormatBuilder
- .getErrorWithParameters(Messages.MULTI_BASE_HEAT_FILE.getErrorMessage(),
- baseFileList),
- LoggerTragetServiceName.VALIDATE_BASE_FILE,
- LoggerErrorDescription.MULTI_BASE_HEAT);
- }
-
- mdcDataDebugMessage.debugExitMessage("file", SdcCommon.MANIFEST_NAME);
- return baseFiles;
- }
-
- private static String getElementListAsString(Set<String> elementCollection) {
-
- return "["
- + CommonMethods.collectionToCommaSeparatedString(elementCollection)
- + "]";
- }
}