2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.components.merge.instance;
24 import org.openecomp.sdc.be.model.*;
29 * Created by chaya on 9/7/2017.
31 public class DataForMergeHolder {
33 private List<ComponentInstanceInput> origComponentInstanceInputs;
34 private List<ComponentInstanceProperty> origComponentInstanceProperties;
35 private List<InputDefinition> origComponentInputs;
36 private Map<String, ArtifactDefinition> origCompInstDeploymentArtifactsCreatedOnTheInstance;
37 private Map<String, ArtifactDefinition> origCompInstInformationalArtifactsCreatedOnTheInstance;
38 private Map<String, List<String>> origComponentInstanceExternalRefs;
39 private List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts;
40 private ContainerRelationsMergeInfo containerRelationsMergeInfo;
41 private List<CapabilityDefinition> origInstanceCapabilities;
42 private Component origInstanceNode;
43 private Component currInstanceNode;
44 private String origComponentInstId;
45 private List<ComponentInstanceInterface> origComponentInstanceInterfaces;
47 public DataForMergeHolder() {
48 origComponentInstanceInputs = new ArrayList<>();
49 origComponentInstanceProperties = new ArrayList<>();
50 origComponentInputs = new ArrayList<>();
51 origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
52 origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
53 origInstanceCapabilities = new ArrayList<>();
54 origComponentInstanceInterfaces = new ArrayList<>();
57 List<ArtifactDefinition> getOrigComponentInstanceHeatEnvArtifacts() {
58 return origComponentInstanceHeatEnvArtifacts;
61 void setOrigComponentInstanceHeatEnvArtifacts(List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts) {
62 this.origComponentInstanceHeatEnvArtifacts = origComponentInstanceHeatEnvArtifacts;
65 List<ComponentInstanceInput> getOrigComponentInstanceInputs() {
66 return origComponentInstanceInputs;
69 void setOrigComponentInstanceInputs(List<ComponentInstanceInput> origComponentInstanceInputs) {
70 Optional.ofNullable(origComponentInstanceInputs).orElse(Collections.emptyList()).stream().forEach(input -> {
71 ComponentInstanceInput copyInput = new ComponentInstanceInput();
72 copyInput.setType(input.getType());
73 copyInput.setPath(input.getPath());
74 copyInput.setRules(input.getRules());
75 copyInput.setValueUniqueUid(input.getValueUniqueUid());
76 copyInput.setDefaultValue(input.getDefaultValue());
77 copyInput.setDescription(input.getDescription());
78 copyInput.setGetInputValues(input.getGetInputValues());
79 copyInput.setInputId(input.getInputId());
80 copyInput.setInputPath(input.getInputPath());
81 copyInput.setInputs(input.getInputs());
82 copyInput.setLabel(input.getLabel());
83 copyInput.setName(input.getName());
84 copyInput.setParentUniqueId(input.getParentUniqueId());
85 copyInput.setProperties(input.getProperties());
86 copyInput.setPropertyId(input.getPropertyId());
87 copyInput.setSchema(input.getSchema());
88 copyInput.setStatus(input.getStatus());
89 copyInput.setDefaultValue(input.getDefaultValue());
90 copyInput.setValue(input.getValue());
91 this.origComponentInstanceInputs.add(copyInput);
95 List<ComponentInstanceProperty> getOrigComponentInstanceProperties() {
96 return origComponentInstanceProperties;
99 void setOrigComponentInstanceProperties(List<ComponentInstanceProperty> origComponentInstanceProperties) {
100 Optional.ofNullable(origComponentInstanceProperties).orElse(Collections.emptyList()).stream().forEach(property -> {
101 ComponentInstanceProperty propertyCopy = new ComponentInstanceProperty();
102 propertyCopy.setType(property.getType());
103 propertyCopy.setName(property.getName());
104 propertyCopy.setValue(property.getValue());
105 propertyCopy.setUniqueId(property.getUniqueId());
106 propertyCopy.setDefaultValue(property.getDefaultValue());
107 propertyCopy.setInputId(property.getInputId());
108 propertyCopy.setGetInputValues(property.getGetInputValues());
109 this.origComponentInstanceProperties.add(propertyCopy);
113 List<InputDefinition> getOrigComponentInputs() {
114 return origComponentInputs;
117 void setOrigComponentInputs(List<InputDefinition> origComponentInputs) {
118 this.origComponentInputs = origComponentInputs;
121 Map<String, ArtifactDefinition> getOrigComponentDeploymentArtifactsCreatedOnTheInstance(){ return this.origCompInstDeploymentArtifactsCreatedOnTheInstance;}
123 Map<String, ArtifactDefinition> getOrigComponentInformationalArtifactsCreatedOnTheInstance(){ return origCompInstInformationalArtifactsCreatedOnTheInstance;}
125 void setOrigComponentDeploymentArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origDeploymentArtifacts){
126 origCompInstDeploymentArtifactsCreatedOnTheInstance = origDeploymentArtifacts;
129 void setOrigComponentInformationalArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origInformationalArtifacts){
130 origCompInstInformationalArtifactsCreatedOnTheInstance = origInformationalArtifacts;
133 Map<String, List<String>> getOrigCompInstExternalRefs() {
134 return origComponentInstanceExternalRefs;
137 void setOrigComponentInstanceExternalRefs(Map<String, List<String>> origComponentInstanceExternalRefs) {
138 this.origComponentInstanceExternalRefs = origComponentInstanceExternalRefs;
141 void setVfRelationsInfo(ContainerRelationsMergeInfo containerRelationsMergeInfo) {
142 this.containerRelationsMergeInfo = containerRelationsMergeInfo;
145 ContainerRelationsMergeInfo getContainerRelationsMergeInfo() {
146 return containerRelationsMergeInfo;
149 List<CapabilityDefinition> getOrigInstanceCapabilities() {
150 return origInstanceCapabilities;
153 void setOrigInstanceCapabilities(List<CapabilityDefinition> origInstanceCapabilities) {
154 this.origInstanceCapabilities = origInstanceCapabilities;
157 Component getOrigInstanceNode() {
158 return origInstanceNode;
161 void setOrigInstanceNode(Component origInstanceNode) {
162 this.origInstanceNode = origInstanceNode;
165 Component getCurrInstanceNode() {
166 return currInstanceNode;
169 public void setCurrInstanceNode(Component currInstanceNode) {
170 this.currInstanceNode = currInstanceNode;
173 public String getOrigComponentInstId() {
174 return origComponentInstId;
177 public void setOrigComponentInstId(String origComponentInstId) {
178 this.origComponentInstId = origComponentInstId;
181 public List<ComponentInstanceInterface> getOrigComponentInstanceInterfaces() {
182 return origComponentInstanceInterfaces;
185 public void setOrigComponentInstanceInterfaces(List<ComponentInstanceInterface> origComponentInstanceInterfaces) {
186 this.origComponentInstanceInterfaces = origComponentInstanceInterfaces;