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;
25 private List<ComponentInstanceInterface> origComponentInstanceInterfaces;
27 public DataForMergeHolder() {
28 origComponentInstanceInputs = new ArrayList<>();
29 origComponentInstanceProperties = new ArrayList<>();
30 origComponentInputs = new ArrayList<>();
31 origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
32 origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
33 origInstanceCapabilities = new ArrayList<>();
34 origComponentInstanceInterfaces = new ArrayList<>();
37 List<ArtifactDefinition> getOrigComponentInstanceHeatEnvArtifacts() {
38 return origComponentInstanceHeatEnvArtifacts;
41 void setOrigComponentInstanceHeatEnvArtifacts(List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts) {
42 this.origComponentInstanceHeatEnvArtifacts = origComponentInstanceHeatEnvArtifacts;
45 List<ComponentInstanceInput> getOrigComponentInstanceInputs() {
46 return origComponentInstanceInputs;
49 void setOrigComponentInstanceInputs(List<ComponentInstanceInput> origComponentInstanceInputs) {
50 Optional.ofNullable(origComponentInstanceInputs).orElse(Collections.emptyList()).stream().forEach(input -> {
51 ComponentInstanceInput copyInput = new ComponentInstanceInput();
52 copyInput.setType(input.getType());
53 copyInput.setPath(input.getPath());
54 copyInput.setRules(input.getRules());
55 copyInput.setValueUniqueUid(input.getValueUniqueUid());
56 copyInput.setDefaultValue(input.getDefaultValue());
57 copyInput.setDescription(input.getDescription());
58 copyInput.setGetInputValues(input.getGetInputValues());
59 copyInput.setInputId(input.getInputId());
60 copyInput.setInputPath(input.getInputPath());
61 copyInput.setInputs(input.getInputs());
62 copyInput.setLabel(input.getLabel());
63 copyInput.setName(input.getName());
64 copyInput.setParentUniqueId(input.getParentUniqueId());
65 copyInput.setProperties(input.getProperties());
66 copyInput.setPropertyId(input.getPropertyId());
67 copyInput.setSchema(input.getSchema());
68 copyInput.setStatus(input.getStatus());
69 copyInput.setDefaultValue(input.getDefaultValue());
70 copyInput.setValue(input.getValue());
71 this.origComponentInstanceInputs.add(copyInput);
75 List<ComponentInstanceProperty> getOrigComponentInstanceProperties() {
76 return origComponentInstanceProperties;
79 void setOrigComponentInstanceProperties(List<ComponentInstanceProperty> origComponentInstanceProperties) {
80 Optional.ofNullable(origComponentInstanceProperties).orElse(Collections.emptyList()).stream().forEach(property -> {
81 ComponentInstanceProperty propertyCopy = new ComponentInstanceProperty();
82 propertyCopy.setType(property.getType());
83 propertyCopy.setName(property.getName());
84 propertyCopy.setValue(property.getValue());
85 propertyCopy.setUniqueId(property.getUniqueId());
86 propertyCopy.setDefaultValue(property.getDefaultValue());
87 propertyCopy.setInputId(property.getInputId());
88 propertyCopy.setGetInputValues(property.getGetInputValues());
89 this.origComponentInstanceProperties.add(propertyCopy);
93 List<InputDefinition> getOrigComponentInputs() {
94 return origComponentInputs;
97 void setOrigComponentInputs(List<InputDefinition> origComponentInputs) {
98 this.origComponentInputs = origComponentInputs;
101 Map<String, ArtifactDefinition> getOrigComponentDeploymentArtifactsCreatedOnTheInstance(){ return this.origCompInstDeploymentArtifactsCreatedOnTheInstance;}
103 Map<String, ArtifactDefinition> getOrigComponentInformationalArtifactsCreatedOnTheInstance(){ return origCompInstInformationalArtifactsCreatedOnTheInstance;}
105 void setOrigComponentDeploymentArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origDeploymentArtifacts){
106 origCompInstDeploymentArtifactsCreatedOnTheInstance = origDeploymentArtifacts;
109 void setOrigComponentInformationalArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origInformationalArtifacts){
110 origCompInstInformationalArtifactsCreatedOnTheInstance = origInformationalArtifacts;
113 Map<String, List<String>> getOrigCompInstExternalRefs() {
114 return origComponentInstanceExternalRefs;
117 void setOrigComponentInstanceExternalRefs(Map<String, List<String>> origComponentInstanceExternalRefs) {
118 this.origComponentInstanceExternalRefs = origComponentInstanceExternalRefs;
121 void setVfRelationsInfo(ContainerRelationsMergeInfo containerRelationsMergeInfo) {
122 this.containerRelationsMergeInfo = containerRelationsMergeInfo;
125 ContainerRelationsMergeInfo getContainerRelationsMergeInfo() {
126 return containerRelationsMergeInfo;
129 List<CapabilityDefinition> getOrigInstanceCapabilities() {
130 return origInstanceCapabilities;
133 void setOrigInstanceCapabilities(List<CapabilityDefinition> origInstanceCapabilities) {
134 this.origInstanceCapabilities = origInstanceCapabilities;
137 Component getOrigInstanceNode() {
138 return origInstanceNode;
141 void setOrigInstanceNode(Component origInstanceNode) {
142 this.origInstanceNode = origInstanceNode;
145 Component getCurrInstanceNode() {
146 return currInstanceNode;
149 public void setCurrInstanceNode(Component currInstanceNode) {
150 this.currInstanceNode = currInstanceNode;
153 public String getOrigComponentInstId() {
154 return origComponentInstId;
157 public void setOrigComponentInstId(String origComponentInstId) {
158 this.origComponentInstId = origComponentInstId;
161 public List<ComponentInstanceInterface> getOrigComponentInstanceInterfaces() {
162 return origComponentInstanceInterfaces;
165 public void setOrigComponentInstanceInterfaces(List<ComponentInstanceInterface> origComponentInstanceInterfaces) {
166 this.origComponentInstanceInterfaces = origComponentInstanceInterfaces;