diff options
author | andre.schmid <andre.schmid@est.tech> | 2020-05-20 14:24:40 +0100 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-05-28 07:57:32 +0000 |
commit | 9e43b160bde937c32151c8ce5a3d07701bd31924 (patch) | |
tree | d5268e69d262c43736d7215af355bc63817a8fef /common-be | |
parent | d8f14691952677771e74e688d7a1dc20e14b036b (diff) |
Fix interface types creation
Interface types creation logic was not interpreting some allowed TOSCA
entries, that, when declared, were breaking the interface type
creation. Every entry under the interface type was being considered
as an interface operation, but it is possible to have "derived_from",
"version", "metadata" and "description". Also it is not considering
the Interface Type entries "inputs", "operations" and "notifications".
Another thing is that TOSCA 1.3 changes the way operations should be
declared, deprecating the previous way. Now there should be an entry
"operations" with the operations entries under it, instead of having
the operations entries direct under the interface type. The change
allows both types, following the TOSCA rule: if operations entry is
not present, then the deprecated way is considered.
Change-Id: I13218bda60b29d19b9c5565cbfd63ae3250a78bf
Issue-ID: SDC-3075
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'common-be')
-rw-r--r-- | common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java | 12 | ||||
-rw-r--r-- | common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java index d263771002..a264d4618f 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java @@ -77,6 +77,18 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description); } + public String getDerivedFrom() { + return (String) getToscaPresentationValue(JsonPresentationFields.DERIVED_FROM); + } + + public void setDerivedFrom(final String derivedFrom) { + setToscaPresentationValue(JsonPresentationFields.DERIVED_FROM, derivedFrom); + } + + public void setVersion(final String version) { + setToscaPresentationValue(JsonPresentationFields.VERSION, version); + } + public String getToscaResourceName() { return (String) getToscaPresentationValue(TOSCA_RESOURCE_NAME); } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java b/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java index 5198be967e..f58c8fa4d9 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/utils/TypeUtils.java @@ -61,11 +61,11 @@ public class TypeUtils { SUBSTITUTION_MAPPINGS("substitution_mappings"), NODE_TYPE("node_type"), DIRECTIVES("directives"), // Attributes ATTRIBUTES("attributes"), LABEL("label"), HIDDEN("hidden"), IMMUTABLE("immutable"), ANNOTATIONS("annotations"), + VERSION("version"), OPERATIONS("operations"), NOTIFICATIONS("notifications"), //functions GET_INPUT("get_input"); - - private String elementName; + private final String elementName; ToscaTagNamesEnum(final String elementName) { this.elementName = elementName; |