diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java index 658fc98725..a6bb9323ee 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java @@ -16,28 +16,6 @@ package org.openecomp.sdc.enrichment.impl.tosca; -import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.HIGH_AVAIL_MODE; -import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MANDATORY; -import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MAX_INSTANCES; -import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MIN_INSTANCES; -import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.NFC_FUNCTION; -import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.NFC_NAMING_CODE; -import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_CODE; -import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VM_TYPE_TAG; -import static org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType.NATIVE_NODE; -import static org.openecomp.sdc.tosca.datatypes.ToscaNodeType.MULTIDEPLOYMENTFLAVOR_NODE_TYPE; -import static org.openecomp.sdc.tosca.datatypes.ToscaNodeType.VFC_ABSTRACT_SUBSTITUTE; -import static org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType.NATIVE_DEPENDS_ON; -import static org.openecomp.sdc.tosca.services.ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME; -import static org.openecomp.sdc.translator.services.heattotosca.Constants.VNF_NODE_TEMPLATE_ID_SUFFIX; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.onap.sdc.tosca.datatypes.model.NodeTemplate; @@ -45,6 +23,7 @@ import org.onap.sdc.tosca.datatypes.model.NodeType; import org.onap.sdc.tosca.datatypes.model.RequirementAssignment; import org.onap.sdc.tosca.datatypes.model.RequirementDefinition; import org.onap.sdc.tosca.datatypes.model.ServiceTemplate; +import org.onap.sdc.tosca.datatypes.model.TopologyTemplate; import org.openecomp.sdc.datatypes.error.ErrorMessage; import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; @@ -54,6 +33,28 @@ import org.openecomp.sdc.tosca.services.ToscaConstants; import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl; import org.openecomp.sdc.versioning.dao.types.Version; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.HIGH_AVAIL_MODE; +import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MANDATORY; +import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MAX_INSTANCES; +import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MIN_INSTANCES; +import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.NFC_FUNCTION; +import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.NFC_NAMING_CODE; +import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_CODE; +import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VM_TYPE_TAG; +import static org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType.NATIVE_NODE; +import static org.openecomp.sdc.tosca.datatypes.ToscaNodeType.MULTIDEPLOYMENTFLAVOR_NODE_TYPE; +import static org.openecomp.sdc.tosca.datatypes.ToscaNodeType.VFC_ABSTRACT_SUBSTITUTE; +import static org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType.NATIVE_DEPENDS_ON; +import static org.openecomp.sdc.tosca.services.ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME; +import static org.openecomp.sdc.translator.services.heattotosca.Constants.VNF_NODE_TEMPLATE_ID_SUFFIX; + public class AbstractSubstituteToscaEnricher { private ToscaAnalyzerService toscaAnalyzerService; @@ -80,6 +81,11 @@ public class AbstractSubstituteToscaEnricher { return errors; } + final TopologyTemplate topologyTemplate = serviceTemplate.getTopology_template(); + if (topologyTemplate == null) { + return errors; + } + final Map<String, NodeTemplate> nodeTemplates = serviceTemplate.getTopology_template().getNode_templates(); if (nodeTemplates == null) { return errors; |