diff options
author | andre.schmid <andre.schmid@est.tech> | 2020-02-05 12:13:57 +0000 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-06-15 08:06:51 +0000 |
commit | 0b3c65c18977212bc74b1f01cefe5ebecc2586f3 (patch) | |
tree | dd81f6c5fafb4932868f505db0eddaa9af688b1a /openecomp-be/lib/openecomp-tosca-lib/src/main/java | |
parent | e3e2db1d777b89e8292b88f677bcc7d81e6bf2c0 (diff) |
Onboard TOSCA data_types defined in package
Onboard TOSCA data_types defined in a CSAR package
that does not exists in the SDC default data_types
library. Those data_types were being lost.
All data_types declared in the package will be
included in the "GlobalSubstitutionServiceTemplate".
This includes the data_types declared in the main
topology template and in its imported definition
files.
Defines a maven profile to compile the catalog-be
in the main SDC pom.
Change-Id: I39445b0f42e924dc1015945b7e605e804c1d505b
Issue-ID: SDC-2763
Signed-off-by: André Schmid <andre.schmid@est.tech>
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main/java')
-rw-r--r-- | openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java index af55aefc1a..70cae71f17 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java @@ -39,6 +39,7 @@ import org.onap.sdc.tosca.datatypes.model.AttributeDefinition; import org.onap.sdc.tosca.datatypes.model.CapabilityAssignment; import org.onap.sdc.tosca.datatypes.model.CapabilityDefinition; import org.onap.sdc.tosca.datatypes.model.Constraint; +import org.onap.sdc.tosca.datatypes.model.DataType; import org.onap.sdc.tosca.datatypes.model.EntrySchema; import org.onap.sdc.tosca.datatypes.model.GroupDefinition; import org.onap.sdc.tosca.datatypes.model.Import; @@ -317,6 +318,20 @@ public class DataModelUtil { serviceTemplate.getNode_types().put(nodeTypeId, nodeType); } + public static void addDataType(final ServiceTemplate serviceTemplate, final String key, + final DataType nodeTypeValue) { + if (serviceTemplate == null) { + throw new CoreException(new InvalidAddActionNullEntityErrorBuilder("Data Type", SERVICE_TEMPLATE).build()); + } + + if (serviceTemplate.getData_types() == null) { + serviceTemplate.setData_types(new HashMap<>()); + } + + serviceTemplate.getData_types().put(key, nodeTypeValue); + } + + /** * Add relationship template. * |