From 2b959a7fcdbf82ec9534d4b860a6100643eb6447 Mon Sep 17 00:00:00 2001 From: vempo Date: Thu, 4 Jan 2018 18:46:01 +0200 Subject: Remove enter/exit debug #4 Change-Id: I99cef676015533d9cfe66f5a5371da49856500dc Issue-ID: SDC-875 Signed-off-by: vempo --- .../composition/CompositionDataExtractorImpl.java | 64 --------------------- .../CompositionEntityDataManagerImpl.java | 44 --------------- .../CandidateServiceImpl.java | 66 ---------------------- .../ManifestCreatorNamingConventionImpl.java | 28 --------- .../services/utils/CandidateServiceValidator.java | 17 ------ 5 files changed, 219 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core') diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java index 6b57649308..b11deca656 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java @@ -27,7 +27,6 @@ import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -71,8 +70,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { protected static Logger logger; private static ToscaAnalyzerService toscaAnalyzerService; - private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); - static { logger = LoggerFactory.getLogger(CompositionDataExtractorImpl.class); toscaAnalyzerService = new ToscaAnalyzerServiceImpl(); @@ -85,10 +82,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { * @return the composition data */ public CompositionData extractServiceCompositionData(ToscaServiceModel toscaServiceModel) { - - - mdcDataDebugMessage.debugEntryMessage(null); - ExtractCompositionDataContext context = new ExtractCompositionDataContext(); String entryDefinitionServiceTemplateFileName = toscaServiceModel.getEntryDefinitionServiceTemplate(); @@ -100,8 +93,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { CompositionData compositionData = new CompositionData(); compositionData.setNetworks(context.getNetworks()); compositionData.setComponents(context.getComponents()); - - mdcDataDebugMessage.debugExitMessage(null); return compositionData; } @@ -121,10 +112,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { private void handleSubstitution(ServiceTemplate serviceTemplate, ToscaServiceModel toscaServiceModel, ExtractCompositionDataContext context) { - - - mdcDataDebugMessage.debugEntryMessage(null); - Map substitutableNodeTemplates = toscaAnalyzerService.getSubstitutableNodeTemplates(serviceTemplate); @@ -135,8 +122,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { substitutableNodeTemplates.get(substitutableNodeTemplateId), context); } } - - mdcDataDebugMessage.debugExitMessage(null); } private void handleSubstitutableNodeTemplate(ServiceTemplate serviceTemplate, @@ -144,10 +129,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { String substitutableNodeTemplateId, NodeTemplate substitutableNodeTemplate, ExtractCompositionDataContext context) { - - - mdcDataDebugMessage.debugEntryMessage(null); - ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); Optional substituteServiceTemplateFileName = toscaAnalyzerService .getSubstituteServiceTemplateName(substitutableNodeTemplateId, substitutableNodeTemplate); @@ -162,7 +143,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { if (context.getHandledServiceTemplates().contains(substituteServiceTemplateFileName.get())) { //each substitution is should be handled once, and will get the connection to the upper // service level according to the first one which was processed - mdcDataDebugMessage.debugExitMessage(null); return; } @@ -175,7 +155,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { substitutableNodeTemplate.getRequirements(); if (CollectionUtils.isEmpty(substitutableRequirements)) { - mdcDataDebugMessage.debugExitMessage(null); return; } @@ -184,8 +163,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { RequirementAssignment reqAssignment = toscaExtensionYamlUtil .yamlToObject(toscaExtensionYamlUtil.objectToYaml(substitutableReq.get(reqId)), RequirementAssignment.class); - - mdcDataDebugMessage.debugExitMessage(null); return isLinkToNetworkRequirementAssignment(reqAssignment); }).forEach(reqId -> { RequirementAssignment linkToNetworkRequirement = toscaExtensionYamlUtil @@ -243,10 +220,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { private void connectPortToNetwork(Nic port, NodeTemplate portNodeTemplate) { - - - mdcDataDebugMessage.debugEntryMessage(null); - List linkRequirementsToNetwork = toscaAnalyzerService.getRequirements(portNodeTemplate, ToscaConstants.LINK_REQUIREMENT_ID); @@ -254,8 +227,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { for (RequirementAssignment linkRequirementToNetwork : linkRequirementsToNetwork) { port.setNetworkName(linkRequirementToNetwork.getNode()); } - - mdcDataDebugMessage.debugExitMessage(null); } /* @@ -263,10 +234,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { */ private Map> getComputeToPortsConnection( Map portNodeTemplates) { - - - mdcDataDebugMessage.debugEntryMessage(null); - Map> computeToPortConnection = new HashMap<>(); if (MapUtils.isEmpty(portNodeTemplates)) { return computeToPortConnection; @@ -280,18 +247,12 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { computeToPortConnection.get(bindingRequirementToCompute.getNode()).add(portId); } } - - mdcDataDebugMessage.debugExitMessage(null); return computeToPortConnection; } private void extractComponents(ServiceTemplate serviceTemplate, ToscaServiceModel toscaServiceModel, ExtractCompositionDataContext context) { - - - mdcDataDebugMessage.debugEntryMessage(null); - Map computeNodeTemplates = toscaAnalyzerService .getNodeTemplatesByType(serviceTemplate, ToscaNodeType.NATIVE_COMPUTE, toscaServiceModel); @@ -317,8 +278,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { .forEach(nodeType -> extractComponent(serviceTemplate, computeToPortsConnection, computesGroupedByType, imageNodeTemplates, computeFlavorNodeTemplates, nodeType, context)); - - mdcDataDebugMessage.debugExitMessage(null); } private Map> getComponentImages(Map @@ -454,10 +413,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { private Map> getNodeTemplatesGroupedByType( Map nodeTemplates) { - - - mdcDataDebugMessage.debugEntryMessage(null); - Map> nodeTemplatesGrouped = new HashMap<>(); //key - node type, value - list of node ids with this type for (String nodeId : nodeTemplates.keySet()) { @@ -465,23 +420,16 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { nodeTemplatesGrouped.putIfAbsent(nodeType, new ArrayList<>()); nodeTemplatesGrouped.get(nodeType).add(nodeId); } - - mdcDataDebugMessage.debugExitMessage(null); return nodeTemplatesGrouped; } private List extractNetworks(ServiceTemplate serviceTemplate, ToscaServiceModel toscaServiceModel) { - - - mdcDataDebugMessage.debugEntryMessage(null); - List networks = new ArrayList<>(); Map networkNodeTemplates = toscaAnalyzerService .getNodeTemplatesByType(serviceTemplate, ToscaNodeType.NATIVE_NETWORK, toscaServiceModel); if (MapUtils.isEmpty(networkNodeTemplates)) { - mdcDataDebugMessage.debugExitMessage(null); return networks; } for (String networkId : networkNodeTemplates.keySet()) { @@ -492,35 +440,26 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { network.setDhcp(networkDhcpValue.isPresent() ? networkDhcpValue.get() : true); networks.add(network); } - - mdcDataDebugMessage.debugExitMessage(null); return networks; } //dhcp default value is true private Optional getNetworkDhcpValue(ServiceTemplate serviceTemplate, NodeTemplate networkNodeTemplate) { - - - mdcDataDebugMessage.debugEntryMessage(null); - if (networkNodeTemplate == null) { return Optional.empty(); } if (networkNodeTemplate.getProperties() == null || networkNodeTemplate.getProperties().get(ToscaConstants.DHCP_ENABLED_PROPERTY_NAME) == null) { - mdcDataDebugMessage.debugExitMessage(null); return Optional.of(true); } Object dhcp = networkNodeTemplate.getProperties().get(ToscaConstants.DHCP_ENABLED_PROPERTY_NAME); if (dhcp instanceof String) { - mdcDataDebugMessage.debugExitMessage(null); return Optional.of(Boolean.valueOf((String) dhcp)); } else if (dhcp instanceof Boolean) { - mdcDataDebugMessage.debugExitMessage(null); return Optional.of((Boolean) dhcp); } else if (dhcp instanceof Map) { String inputParameterName = @@ -530,7 +469,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { serviceTemplate.getTopology_template().getInputs().get(inputParameterName); if (inputParameterDefinition != null) { if (inputParameterDefinition.get_default() != null) { - mdcDataDebugMessage.debugExitMessage(null); return Optional.of(Boolean.valueOf(inputParameterDefinition.get_default().toString())); } } else { @@ -544,8 +482,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { } } } - - mdcDataDebugMessage.debugExitMessage(null); return Optional.of(true); } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java index ab5ee6c64c..51a3689943 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java @@ -30,7 +30,6 @@ import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; 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.vendorsoftwareproduct.dao.ComponentDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao; @@ -85,8 +84,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa private static final Logger logger = LoggerFactory.getLogger(CompositionEntityDataManagerImpl.class); - private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); - private Map entities = new HashMap<>(); private Map nonDynamicSchemas = new HashMap<>(); private List roots = new ArrayList<>(); @@ -125,8 +122,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa public CompositionEntityValidationData validateEntity(CompositionEntity entity, SchemaTemplateContext schemaTemplateContext, SchemaTemplateInput schemaTemplateInput) { - mdcDataDebugMessage.debugEntryMessage(null); - if (entity == null) { throw new CoreException( new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) @@ -150,8 +145,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa validationData.setErrors(JsonUtil.validate( json == null ? JsonUtil.object2Json(new Object()) : json, generateSchema(schemaTemplateContext, entity.getType(), schemaTemplateInput))); - - mdcDataDebugMessage.debugExitMessage(null); return validationData; } @@ -181,8 +174,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa */ @Override public Map> validateEntitiesQuestionnaire() { - mdcDataDebugMessage.debugEntryMessage(null); - Map> errorsByEntityId = new HashMap<>(); entities.entrySet().forEach(entry -> { Collection errors = validateQuestionnaire(entry.getValue()); @@ -190,8 +181,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa errorsByEntityId.put(entry.getKey(), errors); } }); - - mdcDataDebugMessage.debugExitMessage(null); return errorsByEntityId; } @@ -213,16 +202,12 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa @Override public void saveCompositionData(String vspId, Version version, CompositionData compositionData) { - mdcDataDebugMessage.debugEntryMessage(null); - if (Objects.isNull(compositionData)) { return; } Map networkIdByName = saveNetworks(vspId, version, compositionData); saveComponents(vspId, version, compositionData, networkIdByName); - - mdcDataDebugMessage.debugExitMessage(null); } @Override @@ -279,10 +264,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa public void saveComponents(String vspId, Version version, CompositionData compositionData, Map networkIdByName) { - - - mdcDataDebugMessage.debugEntryMessage(null); - if (CollectionUtils.isNotEmpty(compositionData.getComponents())) { for (Component component : compositionData.getComponents()) { ComponentEntity componentEntity = new ComponentEntity(vspId, version, null); @@ -296,8 +277,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa saveNicsByComponent(vspId, version, networkIdByName, component, componentId); } } - - mdcDataDebugMessage.debugExitMessage(null); } public void saveNicsByComponent(String vspId, Version version, @@ -321,8 +300,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa public Map saveNetworks(String vspId, Version version, CompositionData compositionData) { - mdcDataDebugMessage.debugEntryMessage(null); - Map networkIdByName = new HashMap<>(); if (CollectionUtils.isNotEmpty(compositionData.getNetworks())) { for (Network network : compositionData.getNetworks()) { @@ -335,25 +312,18 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa } } } - - mdcDataDebugMessage.debugExitMessage(null); return networkIdByName; } @Override public NetworkEntity createNetwork(NetworkEntity network) { - mdcDataDebugMessage.debugEntryMessage(null); - //network.setId(CommonMethods.nextUuId()); will be set by the dao networkDao.create(network); - mdcDataDebugMessage.debugExitMessage(null); return network; } @Override public ComponentEntity createComponent(ComponentEntity component) { - mdcDataDebugMessage.debugEntryMessage(null); - //component.setId(CommonMethods.nextUuId()); will be set by the dao component.setQuestionnaireData( new JsonSchemaDataGenerator( @@ -362,15 +332,11 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa .generateData()); componentDao.create(component); - - mdcDataDebugMessage.debugExitMessage(null); return component; } @Override public NicEntity createNic(NicEntity nic) { - mdcDataDebugMessage.debugEntryMessage(null); - //nic.setId(CommonMethods.nextUuId()); will be set by the dao nic.setQuestionnaireData( new JsonSchemaDataGenerator( @@ -378,8 +344,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa .generateData()); nicDao.create(nic); - - mdcDataDebugMessage.debugExitMessage(null); return nic; } @@ -392,7 +356,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa * get a flat list of all questionnaire entities that have validation errors * */ public Set getEntityListWithErrors() { - mdcDataDebugMessage.debugEntryMessage(null); Set treeAsList = new HashSet<>(); for (CompositionEntityValidationData entity : roots) { @@ -403,8 +366,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa } updateValidationCompositionEntityName(treeAsList); - - mdcDataDebugMessage.debugExitMessage(null); return treeAsList; } @@ -629,8 +590,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa @Override public DeploymentFlavorEntity createDeploymentFlavor(DeploymentFlavorEntity deploymentFlavor) { - mdcDataDebugMessage.debugEntryMessage(null, null); - deploymentFlavor.setId(CommonMethods.nextUuId()); deploymentFlavorDao.create(deploymentFlavor); return deploymentFlavor; @@ -638,8 +597,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa @Override public ImageEntity createImage(ImageEntity image) { - mdcDataDebugMessage.debugEntryMessage(null, null); - image.setId(CommonMethods.nextUuId()); image.setQuestionnaireData( @@ -648,7 +605,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa .generateData()); imageDao.create(image); - mdcDataDebugMessage.debugExitMessage(null, null); return image; } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java index e6e89a6cd4..78723ae0d2 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java @@ -35,7 +35,6 @@ import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; import org.openecomp.sdc.heat.datatypes.structure.Artifact; import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData; @@ -75,8 +74,6 @@ import static org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder.ge public class CandidateServiceImpl implements CandidateService { protected static final Logger logger = LoggerFactory.getLogger(CandidateServiceImpl.class); - private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); - private CandidateServiceValidator candidateServiceValidator = new CandidateServiceValidator(); private ManifestCreator manifestCreator; private OrchestrationTemplateCandidateDao orchestrationTemplateCandidateDao; @@ -94,10 +91,6 @@ public class CandidateServiceImpl implements CandidateService { @Override public Optional validateNonEmptyFileToUpload(InputStream fileToUpload, String fileSuffix) { - - - mdcDataDebugMessage.debugEntryMessage(null); - String errorMessage = getErrorWithParameters(Messages.NO_FILE_WAS_UPLOADED_OR_FILE_NOT_EXIST.getErrorMessage(), fileSuffix); @@ -109,19 +102,15 @@ public class CandidateServiceImpl implements CandidateService { try { int available = fileToUpload.available(); if (available == 0) { - mdcDataDebugMessage.debugExitMessage(null); return Optional.of(new ErrorMessage(ErrorLevel.ERROR, errorMessage)); } } catch (IOException e) { logger.debug(e.getMessage(), e); - mdcDataDebugMessage.debugExitMessage(null); return Optional.of(new ErrorMessage(ErrorLevel.ERROR, errorMessage)); } } - - mdcDataDebugMessage.debugExitMessage(null); return Optional.empty(); } @@ -166,10 +155,6 @@ public class CandidateServiceImpl implements CandidateService { public OrchestrationTemplateCandidateData createCandidateDataEntity( CandidateDataEntityTo candidateDataEntityTo, InputStream zipFileManifest, AnalyzedZipHeatFiles analyzedZipHeatFiles) throws Exception { - - - mdcDataDebugMessage.debugEntryMessage(null); - FileContentHandler zipContentMap = candidateDataEntityTo.getContentMap(); FilesDataStructure filesDataStructure; String dataStructureJson; @@ -197,8 +182,6 @@ public class CandidateServiceImpl implements CandidateService { OrchestrationTemplateCandidateData candidateData = new OrchestrationTemplateCandidateData(); candidateData.setContentData(ByteBuffer.wrap(candidateDataEntityTo.getUploadedFileData())); candidateData.setFilesDataStructure(dataStructureJson); - - mdcDataDebugMessage.debugExitMessage(null); return candidateData; } @@ -278,10 +261,6 @@ public class CandidateServiceImpl implements CandidateService { } private FilesDataStructure createFileDataStructureFromManifest(InputStream isManifestContent) { - - - mdcDataDebugMessage.debugEntryMessage(null); - ManifestContent manifestContent = JsonUtil.json2Object(isManifestContent, ManifestContent.class); FilesDataStructure structure = new FilesDataStructure(); @@ -300,8 +279,6 @@ public class CandidateServiceImpl implements CandidateService { structure.getArtifacts().add(fileData.getFile()); } } - - mdcDataDebugMessage.debugExitMessage(null); return structure; } @@ -339,28 +316,19 @@ public class CandidateServiceImpl implements CandidateService { @Override public void updateCandidateUploadData(String vspId, Version version, OrchestrationTemplateCandidateData uploadData) { - mdcDataDebugMessage.debugEntryMessage(null); - orchestrationTemplateCandidateDao.update(vspId, version, uploadData); - - mdcDataDebugMessage.debugExitMessage(null); } @Override public Optional getOrchestrationTemplateCandidateFileDataStructure( String vspId, Version version) { - - mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId); - Optional jsonFileDataStructure = orchestrationTemplateCandidateDao.getStructure(vspId, version); if (jsonFileDataStructure.isPresent() && JsonUtil.isValidJson(jsonFileDataStructure.get())) { - mdcDataDebugMessage.debugExitMessage("VSP Id", vspId); return Optional .of(JsonUtil.json2Object(jsonFileDataStructure.get(), FilesDataStructure.class)); } else { - mdcDataDebugMessage.debugExitMessage("VSP Id", vspId); return Optional.empty(); } } @@ -375,32 +343,21 @@ public class CandidateServiceImpl implements CandidateService { @Override public OrchestrationTemplateCandidateData getOrchestrationTemplateCandidate(String vspId, Version version) { - mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId); - mdcDataDebugMessage.debugExitMessage("VSP Id", vspId); - return orchestrationTemplateCandidateDao.get(vspId, version); } @Override public OrchestrationTemplateCandidateData getOrchestrationTemplateCandidateInfo(String vspId, Version version) { - mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId); - mdcDataDebugMessage.debugExitMessage("VSP Id", vspId); - return orchestrationTemplateCandidateDao.getInfo(vspId, version); } @Override public String createManifest(VspDetails vspDetails, FilesDataStructure structure) { - - mdcDataDebugMessage.debugEntryMessage("VSP Id", vspDetails.getId()); - Optional manifest = manifestCreator.createManifest(vspDetails, structure); if (!manifest.isPresent()) { throw new RuntimeException(Messages.CREATE_MANIFEST_FROM_ZIP.getErrorMessage()); } - - mdcDataDebugMessage.debugExitMessage("VSP Id", vspDetails.getId()); return JsonUtil.object2Json(manifest.get()); } @@ -408,11 +365,6 @@ public class CandidateServiceImpl implements CandidateService { public Optional createManifest(VspDetails vspDetails, FileContentHandler fileContentHandler, AnalyzedZipHeatFiles analyzedZipHeatFiles) { - - - mdcDataDebugMessage.debugEntryMessage("VSP Id", vspDetails.getId()); - - mdcDataDebugMessage.debugExitMessage("VSP Id", vspDetails.getId()); return manifestCreator.createManifest(vspDetails, fileContentHandler, analyzedZipHeatFiles); } @@ -591,10 +543,6 @@ public class CandidateServiceImpl implements CandidateService { private void handleSingleHeat(FilesDataStructure structure, List modules, HeatStructureTree heat, Map> uploadErrors) { - - - mdcDataDebugMessage.debugEntryMessage(null); - Module module = new Module(); module.setYaml(heat.getFileName()); module.setIsBase(heat.getBase()); @@ -606,17 +554,11 @@ public class CandidateServiceImpl implements CandidateService { } handleEnv(module, heat, false, structure); modules.add(module); - - mdcDataDebugMessage.debugExitMessage(null); } private void handleVolumes(Module module, Set volumeSet, FilesDataStructure structure, int inx, Map> uploadErrors) { - - - mdcDataDebugMessage.debugEntryMessage(null); - for (HeatStructureTree volume : volumeSet) { if (inx++ > 0) { ErrorsUtil.addStructureErrorToErrorMap(SdcCommon.UPLOAD_FILE, @@ -629,16 +571,10 @@ public class CandidateServiceImpl implements CandidateService { handleEnv(module, volume, true, structure); addNestedToFileDataStructure(volume, structure); } - - mdcDataDebugMessage.debugExitMessage(null); } private void handleEnv(Module module, HeatStructureTree tree, boolean isVolEnv, FilesDataStructure structure) { - - - mdcDataDebugMessage.debugEntryMessage(null); - if (Objects.nonNull(tree.getEnv())) { if (isVolEnv) { module.setVolEnv(tree.getEnv().getFileName()); @@ -647,8 +583,6 @@ public class CandidateServiceImpl implements CandidateService { } handleArtifactsFromTree(tree.getEnv(), structure); } - - mdcDataDebugMessage.debugExitMessage(null); } private void addNestedToFileDataStructure(HeatStructureTree heat, diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java index 9b93023d51..4afcad2a34 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java @@ -20,7 +20,6 @@ import org.apache.commons.collections4.CollectionUtils; import org.openecomp.core.utilities.file.FileContentHandler; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; import org.openecomp.sdc.vendorsoftwareproduct.services.HeatFileAnalyzer; import org.openecomp.sdc.vendorsoftwareproduct.services.filedatastructuremodule.ManifestCreator; @@ -44,16 +43,9 @@ import java.util.regex.Pattern; public class ManifestCreatorNamingConventionImpl implements ManifestCreator { protected static final Logger logger = LoggerFactory.getLogger(ManifestCreatorNamingConventionImpl.class); - private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); - - @Override public Optional createManifest( VspDetails vspDetails, FilesDataStructure filesDataStructure) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (Objects.isNull(filesDataStructure)) { return Optional.empty(); } @@ -63,24 +55,16 @@ public class ManifestCreatorNamingConventionImpl implements ManifestCreator { addNestedToManifest(filesDataStructure, fileDataList); addArtifactsToManifestFileDataList(filesDataStructure, fileDataList); ManifestContent manifestContent = createManifest(vspDetails, fileDataList); - - mdcDataDebugMessage.debugExitMessage(null); return Optional.of(manifestContent); } private void addNestedToManifest( FilesDataStructure filesDataStructure, List fileDataList) { - - - mdcDataDebugMessage.debugEntryMessage(null); - if (CollectionUtils.isNotEmpty(filesDataStructure.getNested())) { for (String nested : filesDataStructure.getNested()) { fileDataList.add(createBaseFileData(FileData.Type.HEAT, nested)); } } - - mdcDataDebugMessage.debugExitMessage(null); } @Override @@ -158,10 +142,6 @@ public class ManifestCreatorNamingConventionImpl implements ManifestCreator { private void addArtifactsToManifestFileDataList( FilesDataStructure filesDataStructure, List fileDataList) { - - - mdcDataDebugMessage.debugEntryMessage(null); - Collection forArtifacts = CollectionUtils .union(filesDataStructure.getArtifacts(), filesDataStructure.getUnassigned()); if (CollectionUtils.isNotEmpty(forArtifacts)) { @@ -169,16 +149,10 @@ public class ManifestCreatorNamingConventionImpl implements ManifestCreator { fileDataList.add(createBaseFileData(FileData.Type.OTHER, artifact)); } } - - mdcDataDebugMessage.debugExitMessage(null); } private void addModulesToManifestFileDataList( FilesDataStructure filesDataStructure, List fileDataList) { - - - mdcDataDebugMessage.debugEntryMessage(null); - if (CollectionUtils.isNotEmpty(filesDataStructure.getModules())) { for (Module module : filesDataStructure.getModules()) { FileData fileData = createBaseFileData(FileData.Type.HEAT, module.getYaml()); @@ -188,8 +162,6 @@ public class ManifestCreatorNamingConventionImpl implements ManifestCreator { fileDataList.add(fileData); } } - - mdcDataDebugMessage.debugExitMessage(null); } private void addEnv(Module module, FileData fileData) { diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/utils/CandidateServiceValidator.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/utils/CandidateServiceValidator.java index 05c95a7596..0fa327fed1 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/utils/CandidateServiceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/utils/CandidateServiceValidator.java @@ -26,7 +26,6 @@ import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; import org.openecomp.sdc.common.errors.Messages; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.datatypes.error.ErrorMessage; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure; import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.Module; @@ -40,8 +39,6 @@ import java.util.Optional; * Created by Talio on 12/6/2016. */ public class CandidateServiceValidator { - private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); - public Optional> validateFileDataStructure( FilesDataStructure filesDataStructure) { if (Objects.isNull(filesDataStructure)) { @@ -62,36 +59,22 @@ public class CandidateServiceValidator { private boolean validateAtLeaseOneModuleExist(FilesDataStructure filesDataStructure) { - - mdcDataDebugMessage.debugEntryMessage(null, null); - - mdcDataDebugMessage.debugExitMessage(null, null); return CollectionUtils.isEmpty(filesDataStructure.getModules()); } private void validateNoVolEnvWithoutVol(List errors, Module module) { - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (StringUtils.isEmpty(module.getVol()) && StringUtils.isNotEmpty(module.getVolEnv())) { errors.add(new ErrorMessage(ErrorLevel.ERROR, ErrorMessagesFormatBuilder .getErrorWithParameters(Messages.MODULE_IN_MANIFEST_VOL_ENV_NO_VOL.getErrorMessage(), module.getName()))); } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void validateModuleHaveYaml(List errors, Module module) { - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (StringUtils.isEmpty(module.getYaml())) { errors.add(new ErrorMessage(ErrorLevel.ERROR, ErrorMessagesFormatBuilder .getErrorWithParameters(Messages.MODULE_IN_MANIFEST_NO_YAML.getErrorMessage(), module.getName()))); } - - mdcDataDebugMessage.debugExitMessage(null, null); } } -- cgit 1.2.3-korg