From 95ad93091d5fa6e377e76f312d495151bddc9da8 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Wed, 14 Oct 2020 20:56:11 +0100 Subject: Support interface input during import VFC Change-Id: I097ce258a7dadbedf1aff6ce53dd1286da074552 Issue-ID: SDC-3372 Signed-off-by: andre.schmid --- .../be/datatypes/elements/InputDataDefinition.java | 30 +--------------------- .../elements/InterfaceDataDefinition.java | 26 +++++++++++-------- .../be/datatypes/enums/JsonPresentationFields.java | 1 + .../java/org/openecomp/sdc/be/utils/TypeUtils.java | 3 +++ 4 files changed, 20 insertions(+), 40 deletions(-) (limited to 'common-be/src/main/java/org') diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java index 422b7eac6c..ef2932a50b 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java @@ -24,10 +24,6 @@ import java.util.Map; public class InputDataDefinition extends PropertyDataDefinition { - private String label; - private Boolean hidden; - private Boolean immutable; - InputDataDefinition() { super(); } @@ -43,31 +39,7 @@ public class InputDataDefinition extends PropertyDataDefinition { this.setImmutable(p.isImmutable()); } - InputDataDefinition(PropertyDataDefinition p) { + public InputDataDefinition(PropertyDataDefinition p) { super(p); } - - public Boolean isHidden() { - return hidden; - } - - public void setHidden(Boolean hidden) { - this.hidden = hidden; - } - - public Boolean isImmutable() { - return immutable; - } - - public void setImmutable(Boolean immutable) { - this.immutable = immutable; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } } 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 a264d4618f..760802ec39 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 @@ -36,7 +36,6 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri this(); setType(type); setDescription(description); - } @JsonCreator @@ -45,12 +44,13 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri setOperations(new HashMap<>()); } - public InterfaceDataDefinition(InterfaceDataDefinition p) { - setUniqueId(p.getUniqueId()); - setType(p.getType()); - setDescription(p.getDescription()); - setToscaResourceName(p.getToscaResourceName()); - setOperations(p.getOperations()); + public InterfaceDataDefinition(final InterfaceDataDefinition interfaceDataDefinition) { + setUniqueId(interfaceDataDefinition.getUniqueId()); + setType(interfaceDataDefinition.getType()); + setDescription(interfaceDataDefinition.getDescription()); + setToscaResourceName(interfaceDataDefinition.getToscaResourceName()); + setOperations(interfaceDataDefinition.getOperations()); + setInputs(interfaceDataDefinition.getInputs()); } public String getUniqueId() { @@ -61,10 +61,6 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId); } - public String getType() { - return (String) getToscaPresentationValue(JsonPresentationFields.TYPE); - } - public void setType(String type) { setToscaPresentationValue(JsonPresentationFields.TYPE, type); } @@ -120,4 +116,12 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri public void setLastUpdateDate(Long lastUpdateDate) { setToscaPresentationValue(JsonPresentationFields.LAST_UPDATE_DATE, lastUpdateDate); } + + public Map getInputs() { + return (Map) getToscaPresentationValue(JsonPresentationFields.INTERFACE_INPUT); + } + + public void setInputs(final Map inputs) { + setToscaPresentationValue(JsonPresentationFields.INTERFACE_INPUT, inputs); + } } 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 76697a7223..436f958893 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 @@ -249,6 +249,7 @@ public enum JsonPresentationFields { //Interface INTERFACES("interfaces", null), + INTERFACE_INPUT("input", null), OPERATIONS("operations", null), OPERATION_IMPLEMENTATION("implementation", null), OPERATION_INPUTS("inputs", null), 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 a1b14b70ca..ee8c7db4f2 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 @@ -48,6 +48,7 @@ public class TypeUtils { PROPERTIES("properties"), TYPE("type"), STATUS("status"), ENTRY_SCHEMA("entry_schema"), REQUIRED("required"), DESCRIPTION("description"), DEFAULT_VALUE("default"), VALUE("value"), CONSTRAINTS("constraints"), + DEFAULT("default"), // Group Types MEMBERS("members"), METADATA("metadata"), // Policy Types @@ -71,6 +72,8 @@ public class TypeUtils { GET_INPUT("get_input"), // Definitions DATA_TYPES("data_types"), NODE_TYPES("node_types"), IMPORTS("imports"), + //Operations + IMPLEMENTATION("implementation"), DERIVED_FROM_NAME("derivedFromName"); -- cgit 1.2.3-korg