From 767b122ea026099e17a2ffde30e6718d2abf150f Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Thu, 17 Feb 2022 15:48:20 +0000 Subject: Support occurrences on node templates Issue-ID: SDC-3711 Change-Id: I9f25454faa8be6987f336b7efd3821cfa09585a1 Signed-off-by: JvD_Ericsson --- .../elements/ComponentInstanceDataDefinition.java | 21 ++++++++++++++++++++- .../be/datatypes/enums/JsonPresentationFields.java | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'common-be/src/main') diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java index afcc0e6d9f..ce8dda0b39 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java @@ -53,6 +53,8 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition { setDescription(dataDefinition.getDescription()); setPosX(dataDefinition.getPosX()); setPosY(dataDefinition.getPosY()); + setMinOccurrences(dataDefinition.getMinOccurrences()); + setMaxOccurrences(dataDefinition.getMaxOccurrences()); setPropertyValueCounter(dataDefinition.getPropertyValueCounter()); setNormalizedName(dataDefinition.getNormalizedName()); setOriginType(dataDefinition.getOriginType()); @@ -138,6 +140,22 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition { setToscaPresentationValue(JsonPresentationFields.CI_POS_Y, posY); } + public String getMinOccurrences() { + return (String) getToscaPresentationValue(JsonPresentationFields.CI_MIN_OCCURRENCES); + } + + public void setMinOccurrences(String minOccurrences) { + setToscaPresentationValue(JsonPresentationFields.CI_MIN_OCCURRENCES, minOccurrences); + } + + public String getMaxOccurrences() { + return (String) getToscaPresentationValue(JsonPresentationFields.CI_MAX_OCCURRENCES); + } + + public void setMaxOccurrences(String maxOccurrences) { + setToscaPresentationValue(JsonPresentationFields.CI_MAX_OCCURRENCES, maxOccurrences); + } + public String getComponentUid() { return (String) getToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_UID); } @@ -346,7 +364,8 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition { + getAttributeValueCounter() + ", inputValueCounter=" + getInputValueCounter() + ", originType=" + getOriginType() + ", customizationUUID=" + getCustomizationUUID() + ", componentName=" + getComponentName() + ", componentVersion=" + getComponentVersion() + ", toscaComponentName=" - + getToscaComponentName() + ", directives =" + getDirectivesString() + "]"; + + getToscaComponentName() + ", directives =" + getDirectivesString() + ", minOccurrences =" + + getMinOccurrences() + ", maxOccurrences =" + getMaxOccurrences() +"]"; } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java index 8fce664686..e36e4ef734 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java @@ -200,6 +200,8 @@ public enum JsonPresentationFields { CI_IS_PROXY("isProxy", null), CI_DIRECTIVES("directives", null), CI_ARTIFACTS("artifacts", null), + CI_MAX_OCCURRENCES("maxOccurrences", null), + CI_MIN_OCCURRENCES("minOccurrences", null), //path FORWARDING_PATH("forwardingPath", null), -- cgit 1.2.3-korg