diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib')
10 files changed, 0 insertions, 387 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationBase.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationBase.java index e439935517..0f979c015f 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationBase.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationBase.java @@ -25,7 +25,6 @@ import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; import org.openecomp.sdc.heat.datatypes.model.Resource; -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; @@ -63,8 +62,6 @@ import java.util.stream.Collectors; public abstract class ResourceTranslationBase { protected static Logger logger = (Logger) LoggerFactory.getLogger(ResourceTranslationBase.class); - protected static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); - protected abstract void translate(TranslateTo translateTo); /** @@ -82,8 +79,6 @@ public abstract class ResourceTranslationBase { HeatOrchestrationTemplate heatOrchestrationTemplate, Resource resource, String resourceId, TranslationContext context) { - - mdcDataDebugMessage.debugEntryMessage("file, resource", heatFileName, resourceId); Optional<String> translatedId = getResourceTranslatedId(heatFileName, heatOrchestrationTemplate, resourceId, context); context.getTranslatedResources().putIfAbsent(heatFileName, new HashSet<>()); @@ -112,8 +107,6 @@ public abstract class ResourceTranslationBase { context.getHeatStackGroupMembers().get(heatFileName).add(translatedId.get()); updateResourceDependency(translateTo); } - - mdcDataDebugMessage.debugExitMessage("file, resource", heatFileName, resourceId); return translatedId; } @@ -141,10 +134,6 @@ public abstract class ResourceTranslationBase { heatOrchestrationTemplate, String resourceId, TranslationContext context) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (!context.getTranslatedIds().containsKey(heatFileName)) { context.getTranslatedIds().put(heatFileName, new HashMap<>()); } @@ -163,8 +152,6 @@ public abstract class ResourceTranslationBase { throw new CoreException( new ResourceNotFoundInHeatFileErrorBuilder(resourceId, heatFileName).build()); } - - mdcDataDebugMessage.debugExitMessage(null, null); return getTranslatedResourceId(resourceId, heatFileName, resource, heatOrchestrationTemplate, context ); @@ -208,9 +195,6 @@ public abstract class ResourceTranslationBase { String heatFileName, HeatOrchestrationTemplate heatOrchestrationTemplate, String resourceId, TranslationContext context) { - - mdcDataDebugMessage.debugEntryMessage(null, null); - Resource resource = heatOrchestrationTemplate.getResources().get(resourceId); if (resource == null) { MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, @@ -226,8 +210,6 @@ public abstract class ResourceTranslationBase { Optional<ToscaTopologyTemplateElements> translatedElementTemplate = ResourceTranslationFactory.getInstance(resource) .getTranslatedToscaTopologyElement(translateTo); - - mdcDataDebugMessage.debugExitMessage(null, null); return translatedElementTemplate; } @@ -274,8 +256,6 @@ public abstract class ResourceTranslationBase { private void updateResourceDependency(TranslateTo translateTo) { String heatFileName = translateTo.getHeatFileName(); - mdcDataDebugMessage.debugEntryMessage("file", heatFileName); - Resource resource = translateTo.getResource(); HeatOrchestrationTemplate heatOrchestrationTemplate = translateTo .getHeatOrchestrationTemplate(); @@ -295,13 +275,9 @@ public abstract class ResourceTranslationBase { String dependsOnResourceId = (String) resource.getDepends_on(); addDependOnRequirement(dependsOnResourceId, translateTo); } - - mdcDataDebugMessage.debugExitMessage("file", heatFileName); } private void addDependOnRequirement(String dependsOnResourceId, TranslateTo translateTo) { - - mdcDataDebugMessage.debugEntryMessage(null, null); String nodeTemplateId = translateTo.getTranslatedId(); ServiceTemplate serviceTemplate = translateTo.getServiceTemplate(); String heatFileName = translateTo.getHeatFileName(); @@ -340,7 +316,6 @@ public abstract class ResourceTranslationBase { requirementAssignment); } } - mdcDataDebugMessage.debugExitMessage(null, null); } Optional<List<Map.Entry<String, Resource>>> getResourceByTranslatedResourceId( @@ -349,7 +324,6 @@ public abstract class ResourceTranslationBase { String translatedResourceId, TranslateTo translateTo, String heatResourceType) { - mdcDataDebugMessage.debugEntryMessage(null, null); List<Map.Entry<String, Resource>> list = heatOrchestrationTemplate.getResources().entrySet() .stream() .filter(entry -> getPredicatesForTranslatedIdToResourceId(heatFileName, @@ -359,10 +333,8 @@ public abstract class ResourceTranslationBase { .allMatch(p -> p.test(entry))) .collect(Collectors.toList()); if (CollectionUtils.isEmpty(list)) { - mdcDataDebugMessage.debugExitMessage(null, null); return Optional.empty(); } else { - mdcDataDebugMessage.debugExitMessage(null, null); return Optional.of(list); } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailAttachPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailAttachPolicyImpl.java index 90206cf7c7..e6dba8730a 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailAttachPolicyImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailAttachPolicyImpl.java @@ -51,14 +51,9 @@ public class ResourceTranslationContrailAttachPolicyImpl extends ResourceTransla @Override protected void translate(TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - String heatFileName = translateTo.getHeatFileName(); String translatedNetworkResourceId = getTranslatedNetworkResourceId(translateTo); if (translatedNetworkResourceId == null) { - mdcDataDebugMessage.debugExitMessage(null, null); return; } @@ -68,8 +63,6 @@ public class ResourceTranslationContrailAttachPolicyImpl extends ResourceTransla .addRequirementAssignment(policyNodeTemplate, ToscaConstants.NETWORK_REQUIREMENT_ID, createRequirementAssignment(translatedNetworkResourceId)); } - - mdcDataDebugMessage.debugExitMessage(null, null); } @Override @@ -86,10 +79,6 @@ public class ResourceTranslationContrailAttachPolicyImpl extends ResourceTransla private NodeTemplate getTranslatedPolicyNodeTemplate(TranslateTo translateTo, String heatFileName) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - AttachedResourceId attachedPolicyResourceId = extractAttachedResourceIdHandleMissing(translateTo, "policy"); NodeTemplate policyNodeTemplate = new NodeTemplate(); @@ -103,17 +92,11 @@ public class ResourceTranslationContrailAttachPolicyImpl extends ResourceTransla + "' include 'policy' property without 'get_attr' of 'fq_name'/'get_resource' function," + " therefore this resource will be ignored in TOSCA translation."); } - - mdcDataDebugMessage.debugExitMessage(null, null); return policyNodeTemplate; } private NodeTemplate getPolicyNodeTemplate(TranslateTo translateTo, String heatFileName, String policyResourceId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Resource policyResource = HeatToToscaUtil .getResource(translateTo.getHeatOrchestrationTemplate(), policyResourceId, heatFileName); Optional<String> translatedPolicyResourceId = @@ -126,21 +109,13 @@ public class ResourceTranslationContrailAttachPolicyImpl extends ResourceTransla + translateTo.getResource().getType() + "' include unsupported policy resource, therefore this resource will be ignored in " + "TOSCA translation. "); - - mdcDataDebugMessage.debugExitMessage(null, null); return null; } - - mdcDataDebugMessage.debugExitMessage(null, null); return DataModelUtil .getNodeTemplate(translateTo.getServiceTemplate(), translatedPolicyResourceId.get()); } private String getTranslatedNetworkResourceId(TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - AttachedResourceId attachedNetworkResourceId = extractAttachedResourceIdHandleMissing(translateTo, "network"); @@ -153,30 +128,19 @@ public class ResourceTranslationContrailAttachPolicyImpl extends ResourceTransla + "' include 'network' property without 'get_resource' function, therefore this " + "resource will be ignored in TOSCA translation."); } - - mdcDataDebugMessage.debugExitMessage(null, null); return translatedNetworkResourceId; } private RequirementAssignment createRequirementAssignment(String translatedNetworkResourceId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - RequirementAssignment requirement = new RequirementAssignment(); requirement.setCapability(ToscaCapabilityType.NATIVE_ATTACHMENT); requirement.setNode(translatedNetworkResourceId); requirement.setRelationship(ToscaRelationshipType.ATTACHES_TO); - mdcDataDebugMessage.debugExitMessage(null, null); return requirement; } private AttachedResourceId extractAttachedResourceIdHandleMissing( TranslateTo translateTo, String propertyName) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Optional<AttachedResourceId> attachedResourceId = HeatToToscaUtil.extractAttachedResourceId(translateTo, propertyName); @@ -187,8 +151,6 @@ public class ResourceTranslationContrailAttachPolicyImpl extends ResourceTransla LoggerErrorDescription.MISSING_MANDATORY_PROPERTY); throw new CoreException(new MissingMandatoryPropertyErrorBuilder(propertyName).build()); } - - mdcDataDebugMessage.debugExitMessage(null, null); return attachedResourceId.get(); } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailNetworkPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailNetworkPolicyImpl.java index 999441deb7..5d90b4bf68 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailNetworkPolicyImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailNetworkPolicyImpl.java @@ -35,10 +35,6 @@ public class ResourceTranslationContrailNetworkPolicyImpl extends ResourceTransl @Override protected void translate(TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - NodeTemplate nodeTemplate = new NodeTemplate(); nodeTemplate.setType(ToscaNodeType.CONTRAIL_NETWORK_RULE); @@ -51,7 +47,5 @@ public class ResourceTranslationContrailNetworkPolicyImpl extends ResourceTransl DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(), nodeTemplate); - - mdcDataDebugMessage.debugExitMessage(null, null); } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java index 0b7e9eacfe..ea56aa11cd 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java @@ -81,10 +81,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran @Override public void translate(TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Resource serviceInstanceResource = translateTo.getResource(); AttachedResourceId contrailServiceTemplateAttached = getServiceTemplateAttachedId(translateTo, serviceInstanceResource); @@ -103,8 +99,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran + "' in property service_template. Invalid type, resource type should be type of '" + HeatResourcesTypes.CONTRAIL_SERVICE_TEMPLATE.getHeatResource() + "', therefore this resource will be ignored in TOSCA translation."); - - mdcDataDebugMessage.debugExitMessage(null, null); return; } Optional<String> contrailServiceTemplateTranslatedId = @@ -119,8 +113,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran + "' with type '" + contrailServiceTemplateResource.getType() + "' in property 'service_template'" + ", therefore this resource will be ignored in TOSCA translation."); - - mdcDataDebugMessage.debugExitMessage(null, null); return; /*throw new CoreException(new ReferenceToUnsupportedResourceErrorBuilder (translateTo.getResourceId(), translateTo.getResource().getType(), @@ -142,8 +134,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran logger.warn("More than one ServiceInstance pointing to the same ServiceTemplate '" + contrailServiceTemplateResourceId + " ' with different number of interfaces." + ", therefore this resource will be ignored in TOSCA translation."); - - mdcDataDebugMessage.debugExitMessage(null, null); return; } @@ -171,18 +161,12 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran + "' include 'service_template' property without 'get_resource' function, currently not" + " supported, therefore this resource will be ignored in TOSCA translation."); } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void addAbstractSubstitutionProperty(TranslateTo translateTo, Map<String, Object> substitutionProperties, ServiceTemplate nestedServiceTemplate, Resource contrailServiceTemplateResource) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Map<String, Object> innerProps = new HashMap<>(); innerProps.put(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME, ToscaUtil.getServiceTemplateFileName(nestedServiceTemplate)); @@ -199,15 +183,9 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran } innerProps.put("mandatory", mandatory); substitutionProperties.put(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME, innerProps); - - mdcDataDebugMessage.debugExitMessage(null, null); } private Object handleScaleOutProperty(TranslateTo translateTo, Map<String, Object> innerProps) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Object scaleOutPropertyValue = translateTo.getResource().getProperties().get(HeatConstants.SCALE_OUT_PROPERTY_NAME); Object countValue = null; @@ -226,17 +204,11 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran } else { innerProps.put(ToscaConstants.COUNT_PROPERTY_NAME, 1); } - - mdcDataDebugMessage.debugExitMessage(null, null); return countValue; } private void handleServiceScalingProperty(TranslateTo translateTo, Map<String, Object> innerProps, Resource contrailServiceTemplateResource) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Object serviceScalingPropertyValue = contrailServiceTemplateResource.getProperties() .get(HeatConstants.SERVICE_SCALING_PROPERTY_NAME); Object serviceScalingValue = null; @@ -252,26 +224,17 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran .eval(serviceScalingValue) : serviceScalingValue); } } - - mdcDataDebugMessage.debugExitMessage(null, null); } private boolean getOrderedInterfaces(Resource contrailServiceTemplate) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Object orderedInterfaces = contrailServiceTemplate.getProperties().get("ordered_interfaces"); if (orderedInterfaces == null) { - mdcDataDebugMessage.debugExitMessage(null, null); return false; } if (orderedInterfaces instanceof String) { - mdcDataDebugMessage.debugExitMessage(null, null); return HeatBoolean.eval(orderedInterfaces); } //if get_param, set default value to true - mdcDataDebugMessage.debugExitMessage(null, null); return true; } @@ -280,10 +243,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran String substitutedNodeTypeId, NodeTemplate substitutedNodeTemplate, boolean orderedInterfaces) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - ServiceTemplate nestedSubstitutionServiceTemplate = new ServiceTemplate(); setNestedServiceTemplateGeneralDetails(translateTo, nestedSubstitutionServiceTemplate); String heatStackGroupKey = addHeatStackGroup(translateTo, nestedSubstitutionServiceTemplate); @@ -296,17 +255,11 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran handleOutputParameters(nestedSubstitutionServiceTemplate, computeNodeTemplateId, translateTo); handleServiceInstanceInterfaces(translateTo, nestedSubstitutionServiceTemplate, substitutedNodeTemplate, heatStackGroupKey, orderedInterfaces, computeNodeTemplateId); - - mdcDataDebugMessage.debugExitMessage(null, null); return nestedSubstitutionServiceTemplate; } private void handleOutputParameters(ServiceTemplate nestedSubstitutionServiceTemplate, String nodeTemplateId, TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (nodeTemplateId == null) { return; } @@ -343,8 +296,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran nestedSubstitutionServiceTemplate.getTopology_template() .setOutputs(nestedSubstitutionServiceTemplateOutputs); } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleServiceInstanceInterfaces(TranslateTo translateTo, @@ -352,10 +303,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran NodeTemplate substitutedNodeTemplate, String heatStackGroupKey, boolean orderedInterfaces, String computeNodeTemplateId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Resource serviceInstanceResource = translateTo.getResource(); Object interfaceListProperty = serviceInstanceResource.getProperties().get(HeatConstants.INTERFACE_LIST_PROPERTY_NAME); @@ -372,8 +319,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran handleInterface(translateTo, interfaceListProperty, null, nestedSubstitutionServiceTemplate, heatStackGroupKey, substitutedNodeTemplate, orderedInterfaces, computeNodeTemplateId); } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleInterface(TranslateTo translateTo, Object interfacePropertyValue, @@ -381,10 +326,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran ServiceTemplate nestedSubstitutionServiceTemplate, String heatStackGroupKey, NodeTemplate substitutedNodeTemplate, boolean orderedInterfaces, String computeNodeTemplateId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (index == null) { index = new Integer(0); } @@ -400,17 +341,11 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran updateHeatStackGroup(nestedSubstitutionServiceTemplate, heatStackGroupKey, portNodeTemplateId); connectPortToNetwork(translateTo, interfacePropertyValue, substitutedNodeTemplate, portReqMappingKey); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void connectPortToNetwork(TranslateTo translateTo, Object interfacePropertyValue, NodeTemplate substitutedNodeTemplate, String portReqMappingKey) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - List<String> validNetworksForConnections = Arrays .asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(), HeatResourcesTypes.CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource()); @@ -475,16 +410,10 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran // MissingMandatoryPropertyErrorBuilder("virtual_network").build()); } } - - mdcDataDebugMessage.debugExitMessage(null, null); } private NodeTemplate createPortNodeTemplate(Integer index, boolean orderedInterfaces, String computeNodeTemplateId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - NodeTemplate portNodeTemplate = new NodeTemplate(); portNodeTemplate.setType(ToscaNodeType.CONTRAIL_PORT); Map<String, Object> portProperties = new HashMap<>(); @@ -508,8 +437,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran } portNodeTemplate.setProperties(portProperties); DataModelUtil.addBindingReqFromPortToCompute(computeNodeTemplateId, portNodeTemplate); - - mdcDataDebugMessage.debugExitMessage(null, null); return portNodeTemplate; } @@ -517,10 +444,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran private void addLinkToNetworkRequirementAssignment(NodeTemplate nodeTemplate, String connectedNodeTranslatedId, String requirementId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (nodeTemplate == null || connectedNodeTranslatedId == null) { return; } @@ -530,57 +453,33 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran requirement.setRelationship(ToscaRelationshipType.NATIVE_NETWORK_LINK_TO); requirement.setNode(connectedNodeTranslatedId); DataModelUtil.addRequirementAssignment(nodeTemplate, requirementId, requirement); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void updateHeatStackGroup(ServiceTemplate serviceTemplate, String heatStackGroupKey, String memberId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - serviceTemplate.getTopology_template().getGroups().get(heatStackGroupKey).getMembers() .add(memberId); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void updateSubstitutionMappingRequirement(ServiceTemplate serviceTemplate, String portReqMappingKey, String portNodeTemplateId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - List<String> portReqMappingValue = new ArrayList<>(); portReqMappingValue.add(portNodeTemplateId); portReqMappingValue.add(ToscaConstants.LINK_REQUIREMENT_ID); DataModelUtil .addSubstitutionMappingReq(serviceTemplate, portReqMappingKey, portReqMappingValue); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void addSubstitutionMappingEntry(ServiceTemplate nestedSubstitutionServiceTemplate, String substitutedNodeTypeId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - SubstitutionMapping substitutionMappings = new SubstitutionMapping(); substitutionMappings.setNode_type(substitutedNodeTypeId); DataModelUtil.addSubstitutionMapping(nestedSubstitutionServiceTemplate, substitutionMappings); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleInputParameters(ServiceTemplate nestedSubstitutionServiceTemplate, TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - ToscaAnalyzerService toscaAnalyzerService = new ToscaAnalyzerServiceImpl(); Optional<NodeType> contrailAbstractNodeType = @@ -605,17 +504,11 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran nestedSubstitutionServiceTemplate.getTopology_template() .setInputs(nestedSubstitutionServiceTemplateInputs); } - - mdcDataDebugMessage.debugExitMessage(null, null); } private String handleComputeNodeTemplate(TranslateTo translateTo, String computeNodeTypeId, ServiceTemplate nestedSubstitutionServiceTemplate, String heatStackGroupKey) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - ToscaAnalyzerService toscaAnalyzerService = new ToscaAnalyzerServiceImpl(); Optional<NodeType> contrailComputeNodeType = toscaAnalyzerService .fetchNodeType(ToscaNodeType.CONTRAIL_COMPUTE, @@ -646,16 +539,10 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran computeNodeTemplate); nestedSubstitutionServiceTemplate.getTopology_template().getGroups().get(heatStackGroupKey) .getMembers().add(computeNodeTemplateId); - - mdcDataDebugMessage.debugExitMessage(null, null); return computeNodeTemplateId; } private String addHeatStackGroup(TranslateTo translateTo, ServiceTemplate serviceTemplate) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - GroupDefinition serviceInstanceGroupDefinition = new GroupDefinition(); serviceInstanceGroupDefinition.setType(ToscaGroupType.HEAT_STACK); Map<String, Object> groupProperties = new HashMap<>(); @@ -667,8 +554,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran String heatStackGroupKey = translateTo.getTranslatedId() + "_group"; DataModelUtil.addGroupDefinitionToTopologyTemplate(serviceTemplate, heatStackGroupKey, serviceInstanceGroupDefinition); - - mdcDataDebugMessage.debugExitMessage(null, null); return heatStackGroupKey; } @@ -676,8 +561,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran private void setNestedServiceTemplateGeneralDetails(TranslateTo translateTo, ServiceTemplate nestedSubstitutionServiceTemplate) { - mdcDataDebugMessage.debugEntryMessage(null, null); - Map<String, String> nestedTemplateMetadata = new HashMap<>(); String nestedTemplateName = new ContrailTranslationHelper() .getSubstitutionContrailServiceTemplateMetadata(translateTo.getHeatFileName(), @@ -692,16 +575,12 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran globalTypesImportList.addAll( HeatToToscaUtil.createImportList(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME)); nestedSubstitutionServiceTemplate.setImports(globalTypesImportList); - mdcDataDebugMessage.debugExitMessage(null, null); } private NodeTemplate createSubstitutedNodeTemplate(TranslateTo translateTo, Resource contrailServiceTemplateResource, String contrailServiceTemplateTranslatedId, int numberOfPorts) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); boolean isImportAddedToServiceTemplate = DataModelUtil .isImportAddedToServiceTemplate(translateTo.getServiceTemplate().getImports(), Constants @@ -785,16 +664,10 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran String substitutedNodeTemplateId = translateTo.getTranslatedId(); DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), substitutedNodeTemplateId, substitutesNodeTemplate); - - mdcDataDebugMessage.debugExitMessage(null, null); return substitutesNodeTemplate; } private void addNetworkLinkRequirements(NodeType nodeType, int numberOfPorts) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (nodeType.getRequirements() == null) { List<Map<String, RequirementDefinition>> requirementList = new ArrayList<>(); for (int i = 0; i < numberOfPorts; i++) { @@ -809,15 +682,9 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran nodeType.setRequirements(requirementList); } } - - mdcDataDebugMessage.debugExitMessage(null, null); } private int getServiceInstanceNumberOfPorts(Resource serviceInstanceResource) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - int numberOfPorts; Object interfaceTypeProperty = serviceInstanceResource.getProperties().get(HeatConstants.INTERFACE_LIST_PROPERTY_NAME); @@ -830,17 +697,11 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran } else { numberOfPorts = 0; } - - mdcDataDebugMessage.debugExitMessage(null, null); return numberOfPorts; } private AttachedResourceId getServiceTemplateAttachedId(TranslateTo translateTo, Resource serviceInstanceResource) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Object serviceTemplateProperty = serviceInstanceResource.getProperties().get("service_template"); Optional<AttachedResourceId> serviceTemplateId = HeatToToscaUtil @@ -848,7 +709,6 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(), serviceTemplateProperty); if (serviceTemplateId.isPresent()) { - mdcDataDebugMessage.debugExitMessage(null, null); return serviceTemplateId.get(); } else { MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImpl.java index 76396f77bc..43e80a4962 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImpl.java @@ -45,10 +45,6 @@ public class ResourceTranslationContrailV2VlanSubInterfaceImpl extends ResourceT @Override protected void translate(TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - NodeTemplate nodeTemplate = new NodeTemplate(); nodeTemplate.setType(ToscaNodeType.CONTRAILV2_VLAN_SUB_INTERFACE); @@ -64,17 +60,11 @@ public class ResourceTranslationContrailV2VlanSubInterfaceImpl extends ResourceT connectSubInterfaceToInterface(translateTo, nodeTemplate); DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(), nodeTemplate); - - mdcDataDebugMessage.debugExitMessage(null, null); } //connection to shared interface is not supported private void connectSubInterfaceToInterface(TranslateTo translateTo, NodeTemplate vlanSubInterfaceNodeTemplate) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Object interfaceRefs = translateTo.getResource().getProperties().get(HeatConstants.VMI_REFS_PROPERTY_NAME); if (Objects.isNull(interfaceRefs) || !(interfaceRefs instanceof List) @@ -124,8 +114,6 @@ public class ResourceTranslationContrailV2VlanSubInterfaceImpl extends ResourceT + "', therefore, this connection will be ignored in TOSCA translation."); } } - - mdcDataDebugMessage.debugExitMessage(null, null); } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailVirtualNetworkImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailVirtualNetworkImpl.java index f0c3c8b3f1..c8f81d035f 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailVirtualNetworkImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailVirtualNetworkImpl.java @@ -30,10 +30,6 @@ public class ResourceTranslationContrailVirtualNetworkImpl extends ResourceTrans @Override public void translate(TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - NodeTemplate nodeTemplate = new NodeTemplate(); nodeTemplate.setType(ToscaNodeType.CONTRAIL_VIRTUAL_NETWORK); nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter @@ -44,7 +40,5 @@ public class ResourceTranslationContrailVirtualNetworkImpl extends ResourceTrans nodeTemplate, translateTo.getContext())); DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(),nodeTemplate); - - mdcDataDebugMessage.debugExitMessage(null, null); } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNestedImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNestedImpl.java index 7ba33c47e4..b85fb02795 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNestedImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNestedImpl.java @@ -45,8 +45,6 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { @Override public void translate(TranslateTo translateTo) { - mdcDataDebugMessage.debugEntryMessage(null, null); - TranslationContext context = translateTo.getContext(); FileData nestedFileData = HeatToToscaUtil.getFileData(translateTo.getResource().getType(), context); @@ -94,7 +92,6 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { if(DataModelUtil.isNodeTemplateSectionMissingFromServiceTemplate(substitutionServiceTemplate)){ handleSubstitutionServiceTemplateWithoutNodeTemplates( templateName, translateTo); - mdcDataDebugMessage.debugExitMessage(null, null); return; } NodeTemplate substitutionNodeTemplate = @@ -107,8 +104,6 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { //Add nested node template id to consolidation data ConsolidationDataUtil.updateNestedNodeTemplateId(translateTo); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleSubstitutionServiceTemplateWithoutNodeTemplates(String templateName, @@ -137,10 +132,6 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { FileData nestedFileData, NodeTemplate substitutionNodeTemplate, String substitutionNodeTypeId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - ServiceTemplate globalSubstitutionTemplate = translateTo.getContext().getTranslatedServiceTemplates() .get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME); @@ -155,24 +146,16 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { nodeType); handleVlanSubInterfaceToInterfaceConnections(translateTo, nestedFileData, substitutionNodeTemplate, nodeType); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleVlanSubInterfaceToInterfaceConnections(TranslateTo translateTo, FileData nestedFileData, NodeTemplate substitutionNodeTemplate, NodeType nodeType) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - ContrailV2VlanToInterfaceResourceConnection linker = new ContrailV2VlanToInterfaceResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); linker.connect(); - - mdcDataDebugMessage.debugExitMessage(null, null); } @@ -180,76 +163,46 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { FileData nestedFileData, NodeTemplate substitutionNodeTemplate, NodeType nodeType) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - ContrailV2VmInterfaceToNetResourceConnection linker = new ContrailV2VmInterfaceToNetResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); linker.connect(); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleNovaToVolConnection(TranslateTo translateTo, FileData nestedFileData, NodeTemplate substitutionNodeTemplate, NodeType nodeType) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - NovaToVolResourceConnection linker = new NovaToVolResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); linker.connect(); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleSecurityRulesToPortConnections(TranslateTo translateTo, FileData nestedFileData, NodeTemplate substitutionNodeTemplate, NodeType nodeType) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - SecurityRulesToPortResourceConnection linker = new SecurityRulesToPortResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); linker.connect(); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handlePortToNetConnections(TranslateTo translateTo, FileData nestedFileData, NodeTemplate substitutionNodeTemplate, NodeType nodeType) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - PortToNetResourceConnection linker = new PortToNetResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); linker.connect(); - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleContrailPortToNetConnections(TranslateTo translateTo, FileData nestedFileData, NodeTemplate substitutionNodeTemplate, NodeType nodeType) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - ContrailPortToNetResourceConnection linker = new ContrailPortToNetResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); linker.connect(); - - mdcDataDebugMessage.debugExitMessage(null, null); } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImpl.java index 76a900f32e..d140197da7 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImpl.java @@ -52,10 +52,6 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase @Override public void translate(TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - NodeTemplate nodeTemplate = new NodeTemplate(); nodeTemplate.setType(ToscaNodeType.NEUTRON_PORT); nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter @@ -70,15 +66,9 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase String resourceTranslatedId = handleSecurityRulesRequirement(translateTo); DataModelUtil .addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId, nodeTemplate); - - mdcDataDebugMessage.debugExitMessage(null, null); } private String handleSecurityRulesRequirement(TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - String resourceTranslatedId = translateTo.getTranslatedId(); Map<String, Object> properties = translateTo.getResource().getProperties(); Optional<Object> securityGroups = @@ -95,17 +85,11 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase attachedResourceId)); }); } - - mdcDataDebugMessage.debugExitMessage(null, null); return resourceTranslatedId; } private void handleSecurityGroupResourceId(TranslateTo translateTo, String resourceTranslatedId, AttachedResourceId securityGroupResourceId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - List<String> supportedSecurityGroupsTypes = Collections .singletonList(HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE.getHeatResource()); if (securityGroupResourceId.isGetResource()) { @@ -115,17 +99,12 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase handleGetParam(translateTo, resourceTranslatedId, securityGroupResourceId, supportedSecurityGroupsTypes); } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleGetParam(TranslateTo translateTo, String resourceTranslatedId, AttachedResourceId securityGroupResourceId, List<String> supportedSecurityGroupsTypes) { - mdcDataDebugMessage.debugEntryMessage(null, null); - if (!(securityGroupResourceId.getEntityId() instanceof String)) { - mdcDataDebugMessage.debugExitMessage(null, null); return; } TranslatedHeatResource translatedSharedResourceId = @@ -135,7 +114,6 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { if (validateResourceTypeSupportedForReqCreation(translateTo, supportedSecurityGroupsTypes, translatedSharedResourceId.getHeatResource(), "security_groups")) { - mdcDataDebugMessage.debugExitMessage(null, null); return; } final NodeTemplate securityGroupNodeTemplate = DataModelUtil @@ -154,17 +132,11 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase ConsolidationEntityType.PORT, translateTo.getResourceId(), ToscaConstants.PORT_REQUIREMENT_ID, requirement); } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleGetResource(TranslateTo translateTo, String resourceTranslatedId, AttachedResourceId securityGroupResourceId, List<String> supportedSecurityGroupsTypes) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - String resourceId = (String) securityGroupResourceId.getEntityId(); Resource securityGroupResource = HeatToToscaUtil .getResource(translateTo.getHeatOrchestrationTemplate(), resourceId, @@ -177,7 +149,6 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase if (securityGroupTranslatedId.isPresent()) { if (validateResourceTypeSupportedForReqCreation(translateTo, supportedSecurityGroupsTypes, securityGroupResource, "security_groups")) { - mdcDataDebugMessage.debugExitMessage(null, null); return; } final NodeTemplate securityGroupNodeTemplate = DataModelUtil @@ -194,15 +165,9 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase ConsolidationEntityType.PORT, translateTo.getResourceId(), ToscaConstants.PORT_REQUIREMENT_ID, requirement); } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handleNetworkRequirement(TranslateTo translateTo, NodeTemplate nodeTemplate) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - Optional<AttachedResourceId> networkResourceId = HeatToToscaUtil.extractAttachedResourceId(translateTo, "network"); if (networkResourceId.isPresent()) { @@ -215,17 +180,11 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase addRequirementAssignmentForNetworkResource(translateTo, nodeTemplate, attachedResourceId); } } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void addRequirementAssignmentForNetworkResource(TranslateTo translateTo, NodeTemplate nodeTemplate, AttachedResourceId attachedResourceId) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - String networkTranslatedId; List<String> supportedNetworkTypes = Arrays.asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(), @@ -264,8 +223,6 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase ToscaConstants.LINK_REQUIREMENT_ID, requirementAssignment); } } - - mdcDataDebugMessage.debugExitMessage(null, null); } @@ -273,21 +230,14 @@ public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase List<String> supportedTypes, Resource heatResource, final String propertyName) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (!isResourceTypeSupported(heatResource, supportedTypes)) { logger.warn( "'" + propertyName + "' property of port resource('" + translateTo.getResourceId() + "') is pointing to a resource of type '" + heatResource.getType() + "' " + "which is not supported for this requirement. " + "Supported types are: " + supportedTypes.toString()); - - mdcDataDebugMessage.debugExitMessage(null, null); return true; } - mdcDataDebugMessage.debugExitMessage(null, null); return false; } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImpl.java index 9ed59e04db..9259218049 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImpl.java @@ -101,22 +101,16 @@ public class ResourceTranslationNovaServerGroupsImpl extends ResourceTranslation @Override protected void translate(TranslateTo translateTo) { - mdcDataDebugMessage.debugEntryMessage(null, null); - String resourceId = translateTo.getResourceId(); List<String> toscaPolicyTypes = getToscaPolicies(translateTo.getResource(), resourceId); if (!CollectionUtils.isEmpty(toscaPolicyTypes)) { String translatedGroupId = addGroupToTopology(translateTo, resourceId); addPoliciesToTopology(translateTo, translatedGroupId, toscaPolicyTypes); } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void addPoliciesToTopology(TranslateTo translateTo, String policyTargetEntityId, List<String> toscaPolicyTypes) { - mdcDataDebugMessage.debugEntryMessage(null, null); - logger.info("******** Start creating policies for resource '%s' ********", translateTo.getResourceId()); for (int i = 0; i < toscaPolicyTypes.size(); i++) { @@ -143,22 +137,15 @@ public class ResourceTranslationNovaServerGroupsImpl extends ResourceTranslation logger .info("******** All policies for resource '%s' created successfully ********", translateTo.getResourceId()); - - mdcDataDebugMessage.debugExitMessage(null, null); } private String getTranslatedPolicyId(TranslateTo translateTo, List<String> toscaPolicyTypes, int policyIndex) { - mdcDataDebugMessage.debugEntryMessage(null, null); - - mdcDataDebugMessage.debugExitMessage(null, null); return translateTo.getResourceId() + (toscaPolicyTypes.size() > 1 ? policyIndex : "") + "_policy"; } private String addGroupToTopology(TranslateTo translateTo, String resourceId) { - mdcDataDebugMessage.debugEntryMessage(null, null); - logger.info("******** Start creating group for resource '%s' ********", resourceId); GroupDefinition group = new GroupDefinition(); group.setMembers(new ArrayList<>()); @@ -168,8 +155,6 @@ public class ResourceTranslationNovaServerGroupsImpl extends ResourceTranslation .addGroupDefinitionToTopologyTemplate(translateTo.getServiceTemplate(), translatedGroupId, group); logger.info("******** Creating group '%s' for resource '%s' ********", resourceId, resourceId); - - mdcDataDebugMessage.debugExitMessage(null, null); return translatedGroupId; } @@ -178,8 +163,6 @@ public class ResourceTranslationNovaServerGroupsImpl extends ResourceTranslation } private List<String> getToscaPolicies(Resource resource, String resourceId) { - mdcDataDebugMessage.debugEntryMessage(null, null); - Map<String, Object> properties = resource.getProperties(); if (Objects.isNull(properties) || Objects.isNull(properties.get("policies"))) { return Arrays.asList(ToscaPolicyType.PLACEMENT_ANTILOCATE); @@ -192,8 +175,6 @@ public class ResourceTranslationNovaServerGroupsImpl extends ResourceTranslation retList.add(getToscaPolicyByHotPolicy(policy)); } }); - - mdcDataDebugMessage.debugExitMessage(null, null); return retList; } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationResourceGroupImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationResourceGroupImpl.java index 7083ae0449..d297d8516e 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationResourceGroupImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationResourceGroupImpl.java @@ -51,10 +51,6 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas @Override protected void translate(TranslateTo translateTo) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - final String heatFileName = translateTo.getHeatFileName(); Object resourceDef = translateTo.getResource().getProperties().get(HeatConstants.RESOURCE_DEF_PROPERTY_NAME); @@ -73,8 +69,6 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas + HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource() + "' with resourceDef which is not pointing to nested heat file is not supported and " + "will be ignored in the translation "); - - mdcDataDebugMessage.debugExitMessage(null, null); return; } @@ -102,19 +96,11 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas substitutionNodeTemplate); } } - - mdcDataDebugMessage.debugExitMessage(null, null); } private void handlingIndexVar(TranslateTo translateTo, NodeTemplate substitutionNodeTemplate) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - String indexVarValue = getIndexVarValue(translateTo); replacePropertiesIndexVarValue(indexVarValue, substitutionNodeTemplate.getProperties()); - - mdcDataDebugMessage.debugExitMessage(null, null); } private Map<String, List> getNewIndexVarValue() { @@ -129,10 +115,6 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas private void replacePropertiesIndexVarValue(String indexVarValue, Map<String, Object> properties) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (properties == null || properties.isEmpty()) { return; } @@ -144,15 +126,9 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas properties.put(propertyEntry.getKey(), newPropertyValue); } } - - mdcDataDebugMessage.debugExitMessage(null, null); } private Object getUpdatedPropertyValueWithIndex(String indexVarValue, Object propertyValue) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - if (propertyValue != null && propertyValue instanceof String) { if (propertyValue.equals(indexVarValue)) { return getNewIndexVarValue(); @@ -179,8 +155,6 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas concatMap.put(ToscaFunctions.CONCAT.getDisplayName(), concatList); return concatMap; } - - mdcDataDebugMessage.debugExitMessage(null, null); return propertyValue; //no update is needed } else if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) { replacePropertiesIndexVarValue(indexVarValue, (Map<String, Object>) propertyValue); @@ -190,19 +164,12 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas for (Object entry : ((List) propertyValue)) { newPropertyValueList.add(getUpdatedPropertyValueWithIndex(indexVarValue, entry)); } - - mdcDataDebugMessage.debugExitMessage(null, null); return newPropertyValueList; } - - mdcDataDebugMessage.debugExitMessage(null, null); return propertyValue; } private String getIndexVarValue(TranslateTo translateTo) { - - mdcDataDebugMessage.debugEntryMessage(null, null); - Object indexVar = translateTo.getResource().getProperties().get(HeatConstants.INDEX_PROPERTY_NAME); if (indexVar == null) { @@ -210,8 +177,6 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas } if (indexVar instanceof String) { - - mdcDataDebugMessage.debugExitMessage(null, null); return (String) indexVar; } else { MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, @@ -225,10 +190,6 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas private void populateServiceTemplateFilterProperties(TranslateTo translateTo, NodeTemplate substitutionNodeTemplate, Map serviceTemplateFilter) { - - - mdcDataDebugMessage.debugEntryMessage(null, null); - boolean mandatory = false; Object countValue = TranslatorHeatToToscaPropertyConverter .getToscaPropertyValue(translateTo.getServiceTemplate(),translateTo.getResourceId(), @@ -249,7 +210,5 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas mandatory = true; } serviceTemplateFilter.put("mandatory", mandatory); - - mdcDataDebugMessage.debugExitMessage(null, null); } } |