From dece2c1d9149fce088669baa9621e7e4a6ce093a Mon Sep 17 00:00:00 2001 From: eleonorali Date: Wed, 11 Jul 2018 20:15:47 +0300 Subject: Nested input params appears in MainServiceTemplate When Nested heat belongs to Volume HEAT and Volume Heat was associated to main HEAT (parent) input parameters came from such nested were appear in MainServiceTemplate.yaml (TOSCA) Also these parameters had annotation in nestedServiceTemplate.yaml Change-Id: I46fff53de502c7ec48b6e4c26087121be89dd0a1 Issue-ID: SDC-1498 Signed-off-by: eleonorali --- .../sdc/heat/datatypes/manifest/FileData.java | 122 +++++++++++---------- 1 file changed, 65 insertions(+), 57 deletions(-) (limited to 'openecomp-be/lib/openecomp-heat-lib/src') diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java index 81bf2fa5a9..2bc549c058 100644 --- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java @@ -22,75 +22,80 @@ package org.openecomp.sdc.heat.datatypes.manifest; import org.apache.commons.collections4.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; import java.util.function.Predicate; public class FileData { - protected static final Set heatFileTypes = - new HashSet<>(Arrays.asList(Type.HEAT, Type.HEAT_NET, Type.HEAT_VOL)); - private Boolean isBase; - private String file; - private Type type; - private List data; + protected static final Set heatFileTypes = + new HashSet<>(Arrays.asList(Type.HEAT, Type.HEAT_NET, Type.HEAT_VOL)); + private Boolean isBase; + private String parentFile; + private String file; + private Type type; + private List data; - public static Predicate buildFileDataPredicateByType(Type... types) { - return fileData -> Arrays.asList(types).contains(fileData.getType()); - } + public static Predicate buildFileDataPredicateByType(Type... types) { + return fileData -> Arrays.asList(types).contains(fileData.getType()); + } - public static boolean isHeatFile(Type type) { + public static boolean isHeatFile(Type type) { return heatFileTypes.contains(type); } - public Boolean getBase() { - return isBase; - } + public Boolean getBase() { + return isBase; + } - public void setBase(Boolean base) { - isBase = base; - } + public void setBase(Boolean base) { + isBase = base; + } - public String getFile() { - return file; - } + public String getFile() { + return file; + } + + public void setFile(String file) { + this.file = file; + } + + public String getParentFile() { + return parentFile; + } - public void setFile(String file) { - this.file = file; + public void setParentFile(String parentFile) { + this.parentFile = parentFile; } - public Type getType() { + public Type getType() { return type; } - public void setType(Type type) { + public void setType(Type type) { this.type = type; } - public List getData() { - return data; - } + public List getData() { + return data; + } - public void setData(List data) { - this.data = data; - } + public void setData(List data) { + this.data = data; + } - /** - * Add file data. - * - * @param data the data - */ - public void addFileData(FileData data) { - if (CollectionUtils.isEmpty(this.data)) { - this.data = new ArrayList<>(); + /** + * Add file data. + * + * @param data the data + */ + public void addFileData(FileData data) { + if (CollectionUtils.isEmpty(this.data)) { + this.data = new ArrayList<>(); + } + this.data.add(data); } - this.data.add(data); - } - public enum Type { + public enum Type { HEAT("HEAT"), HEAT_ENV("HEAT_ENV"), @@ -108,20 +113,23 @@ public class FileData { VF_LICENSE("VF_LICENSE"), OTHER("OTHER"); - private String displayName; + private String displayName; - Type(String displayName) { - this.displayName = displayName; - } + Type(String displayName) { + this.displayName = displayName; + } - public String getDisplayName() { - return displayName; - } + public String getDisplayName() { + return displayName; + } - public static boolean isArtifact(Type fileType) - { - return !Arrays.asList(HEAT,HEAT_ENV, HEAT_VOL).contains(fileType); - } + public static boolean isArtifact(Type fileType) { + return !Arrays.asList(HEAT,HEAT_ENV, HEAT_VOL).contains(fileType); + } - } + public static boolean canBeAssociated(Type fileType) + { + return HEAT_VOL == fileType; + } + } } -- cgit 1.2.3-korg