1 package org.openecomp.sdc.be.components.merge.instance;
4 import org.openecomp.sdc.be.model.*;
9 * Created by chaya on 9/7/2017.
11 public class DataForMergeHolder {
13 private List<ComponentInstanceInput> origComponentInstanceInputs;
14 private List<ComponentInstanceProperty> origComponentInstanceProperties;
15 private List<InputDefinition> origComponentInputs;
16 private Map<String, ArtifactDefinition> origCompInstDeploymentArtifactsCreatedOnTheInstance;
17 private Map<String, ArtifactDefinition> origCompInstInformationalArtifactsCreatedOnTheInstance;
18 private Map<String, List<String>> origComponentInstanceExternalRefs;
19 private List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts;
20 private ContainerRelationsMergeInfo containerRelationsMergeInfo;
21 private List<CapabilityDefinition> origInstanceCapabilities;
22 private Component origInstanceNode;
23 private Component currInstanceNode;
24 private String origComponentInstId;
26 public DataForMergeHolder() {
27 origComponentInstanceInputs = new ArrayList<>();
28 origComponentInstanceProperties = new ArrayList<>();
29 origComponentInputs = new ArrayList<>();
30 origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
31 origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
32 origInstanceCapabilities = new ArrayList<>();
35 List<ArtifactDefinition> getOrigComponentInstanceHeatEnvArtifacts() {
36 return origComponentInstanceHeatEnvArtifacts;
39 void setOrigComponentInstanceHeatEnvArtifacts(List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts) {
40 this.origComponentInstanceHeatEnvArtifacts = origComponentInstanceHeatEnvArtifacts;
43 List<ComponentInstanceInput> getOrigComponentInstanceInputs() {
44 return origComponentInstanceInputs;
47 void setOrigComponentInstanceInputs(List<ComponentInstanceInput> origComponentInstanceInputs) {
48 Optional.ofNullable(origComponentInstanceInputs).orElse(Collections.emptyList()).stream().forEach(input -> {
49 ComponentInstanceInput copyInput = new ComponentInstanceInput();
50 copyInput.setType(input.getType());
51 copyInput.setPath(input.getPath());
52 copyInput.setRules(input.getRules());
53 copyInput.setValueUniqueUid(input.getValueUniqueUid());
54 copyInput.setDefaultValue(input.getDefaultValue());
55 copyInput.setDescription(input.getDescription());
56 copyInput.setGetInputValues(input.getGetInputValues());
57 copyInput.setInputId(input.getInputId());
58 copyInput.setInputPath(input.getInputPath());
59 copyInput.setInputs(input.getInputs());
60 copyInput.setLabel(input.getLabel());
61 copyInput.setName(input.getName());
62 copyInput.setParentUniqueId(input.getParentUniqueId());
63 copyInput.setProperties(input.getProperties());
64 copyInput.setPropertyId(input.getPropertyId());
65 copyInput.setSchema(input.getSchema());
66 copyInput.setStatus(input.getStatus());
67 copyInput.setDefaultValue(input.getDefaultValue());
68 copyInput.setValue(input.getValue());
69 this.origComponentInstanceInputs.add(copyInput);
73 List<ComponentInstanceProperty> getOrigComponentInstanceProperties() {
74 return origComponentInstanceProperties;
77 void setOrigComponentInstanceProperties(List<ComponentInstanceProperty> origComponentInstanceProperties) {
78 Optional.ofNullable(origComponentInstanceProperties).orElse(Collections.emptyList()).stream().forEach(property -> {
79 ComponentInstanceProperty propertyCopy = new ComponentInstanceProperty();
80 propertyCopy.setType(property.getType());
81 propertyCopy.setName(property.getName());
82 propertyCopy.setValue(property.getValue());
83 propertyCopy.setUniqueId(property.getUniqueId());
84 propertyCopy.setDefaultValue(property.getDefaultValue());
85 propertyCopy.setInputId(property.getInputId());
86 propertyCopy.setGetInputValues(property.getGetInputValues());
87 this.origComponentInstanceProperties.add(propertyCopy);
91 List<InputDefinition> getOrigComponentInputs() {
92 return origComponentInputs;
95 void setOrigComponentInputs(List<InputDefinition> origComponentInputs) {
96 this.origComponentInputs = origComponentInputs;
99 Map<String, ArtifactDefinition> getOrigComponentDeploymentArtifactsCreatedOnTheInstance(){ return this.origCompInstDeploymentArtifactsCreatedOnTheInstance;}
101 Map<String, ArtifactDefinition> getOrigComponentInformationalArtifactsCreatedOnTheInstance(){ return origCompInstInformationalArtifactsCreatedOnTheInstance;}
103 void setOrigComponentDeploymentArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origDeploymentArtifacts){
104 origCompInstDeploymentArtifactsCreatedOnTheInstance = origDeploymentArtifacts;
107 void setOrigComponentInformationalArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origInformationalArtifacts){
108 origCompInstInformationalArtifactsCreatedOnTheInstance = origInformationalArtifacts;
111 Map<String, List<String>> getOrigCompInstExternalRefs() {
112 return origComponentInstanceExternalRefs;
115 void setOrigComponentInstanceExternalRefs(Map<String, List<String>> origComponentInstanceExternalRefs) {
116 this.origComponentInstanceExternalRefs = origComponentInstanceExternalRefs;
119 void setVfRelationsInfo(ContainerRelationsMergeInfo containerRelationsMergeInfo) {
120 this.containerRelationsMergeInfo = containerRelationsMergeInfo;
123 ContainerRelationsMergeInfo getContainerRelationsMergeInfo() {
124 return containerRelationsMergeInfo;
127 List<CapabilityDefinition> getOrigInstanceCapabilities() {
128 return origInstanceCapabilities;
131 void setOrigInstanceCapabilities(List<CapabilityDefinition> origInstanceCapabilities) {
132 this.origInstanceCapabilities = origInstanceCapabilities;
135 Component getOrigInstanceNode() {
136 return origInstanceNode;
139 void setOrigInstanceNode(Component origInstanceNode) {
140 this.origInstanceNode = origInstanceNode;
143 Component getCurrInstanceNode() {
144 return currInstanceNode;
147 public void setCurrInstanceNode(Component currInstanceNode) {
148 this.currInstanceNode = currInstanceNode;
151 public String getOrigComponentInstId() {
152 return origComponentInstId;
155 public void setOrigComponentInstId(String origComponentInstId) {
156 this.origComponentInstId = origComponentInstId;