aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/DataForMergeHolder.java
blob: 9d2df73e00a7d993359ae65346557c50cac4394d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/*-
 * ============LICENSE_START=======================================================
 * SDC
 * ================================================================================
 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

package org.openecomp.sdc.be.components.merge.instance;


import org.openecomp.sdc.be.model.*;

import java.util.*;

/**
 * Created by chaya on 9/7/2017.
 */
public class DataForMergeHolder {

    private List<ComponentInstanceInput> origComponentInstanceInputs;
    private List<ComponentInstanceProperty> origComponentInstanceProperties;
    private List<InputDefinition> origComponentInputs;
    private Map<String, ArtifactDefinition> origCompInstDeploymentArtifactsCreatedOnTheInstance;
    private Map<String, ArtifactDefinition> origCompInstInformationalArtifactsCreatedOnTheInstance;
    private Map<String, List<String>> origComponentInstanceExternalRefs;
    private List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts;
    private ContainerRelationsMergeInfo containerRelationsMergeInfo;
    private List<CapabilityDefinition> origInstanceCapabilities;
    private Component origInstanceNode;
    private Component currInstanceNode;
    private String origComponentInstId;
    private List<ComponentInstanceInterface> origComponentInstanceInterfaces;

    public DataForMergeHolder() {
        origComponentInstanceInputs = new ArrayList<>();
        origComponentInstanceProperties = new ArrayList<>();
        origComponentInputs = new ArrayList<>();
        origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
        origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>();
        origInstanceCapabilities = new ArrayList<>();
        origComponentInstanceInterfaces = new ArrayList<>();
    }

    List<ArtifactDefinition> getOrigComponentInstanceHeatEnvArtifacts() {
        return origComponentInstanceHeatEnvArtifacts;
    }

    void setOrigComponentInstanceHeatEnvArtifacts(List<ArtifactDefinition> origComponentInstanceHeatEnvArtifacts) {
        this.origComponentInstanceHeatEnvArtifacts = origComponentInstanceHeatEnvArtifacts;
    }

    List<ComponentInstanceInput> getOrigComponentInstanceInputs() {
        return origComponentInstanceInputs;
    }

    void setOrigComponentInstanceInputs(List<ComponentInstanceInput> origComponentInstanceInputs) {
        Optional.ofNullable(origComponentInstanceInputs).orElse(Collections.emptyList()).stream().forEach(input -> {
            ComponentInstanceInput copyInput = new ComponentInstanceInput();
            copyInput.setType(input.getType());
            copyInput.setPath(input.getPath());
            copyInput.setRules(input.getRules());
            copyInput.setValueUniqueUid(input.getValueUniqueUid());
            copyInput.setDefaultValue(input.getDefaultValue());
            copyInput.setDescription(input.getDescription());
            copyInput.setGetInputValues(input.getGetInputValues());
            copyInput.setInputId(input.getInputId());
            copyInput.setInputPath(input.getInputPath());
            copyInput.setInputs(input.getInputs());
            copyInput.setLabel(input.getLabel());
            copyInput.setName(input.getName());
            copyInput.setParentUniqueId(input.getParentUniqueId());
            copyInput.setProperties(input.getProperties());
            copyInput.setPropertyId(input.getPropertyId());
            copyInput.setSchema(input.getSchema());
            copyInput.setStatus(input.getStatus());
            copyInput.setDefaultValue(input.getDefaultValue());
            copyInput.setValue(input.getValue());
            this.origComponentInstanceInputs.add(copyInput);
        });
    }

    List<ComponentInstanceProperty> getOrigComponentInstanceProperties() {
        return origComponentInstanceProperties;
    }

    void setOrigComponentInstanceProperties(List<ComponentInstanceProperty> origComponentInstanceProperties) {
        Optional.ofNullable(origComponentInstanceProperties).orElse(Collections.emptyList()).stream().forEach(property -> {
            ComponentInstanceProperty propertyCopy = new ComponentInstanceProperty();
            propertyCopy.setType(property.getType());
            propertyCopy.setName(property.getName());
            propertyCopy.setValue(property.getValue());
            propertyCopy.setUniqueId(property.getUniqueId());
            propertyCopy.setDefaultValue(property.getDefaultValue());
            propertyCopy.setInputId(property.getInputId());
            propertyCopy.setGetInputValues(property.getGetInputValues());
            this.origComponentInstanceProperties.add(propertyCopy);
        });
    }

    List<InputDefinition> getOrigComponentInputs() {
        return origComponentInputs;
    }

    void setOrigComponentInputs(List<InputDefinition> origComponentInputs) {
        this.origComponentInputs = origComponentInputs;
    }

    Map<String, ArtifactDefinition> getOrigComponentDeploymentArtifactsCreatedOnTheInstance(){ return this.origCompInstDeploymentArtifactsCreatedOnTheInstance;}

    Map<String, ArtifactDefinition> getOrigComponentInformationalArtifactsCreatedOnTheInstance(){ return origCompInstInformationalArtifactsCreatedOnTheInstance;}

    void setOrigComponentDeploymentArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origDeploymentArtifacts){
        origCompInstDeploymentArtifactsCreatedOnTheInstance = origDeploymentArtifacts;
    }

    void setOrigComponentInformationalArtifactsCreatedOnTheInstance(Map<String, ArtifactDefinition> origInformationalArtifacts){
        origCompInstInformationalArtifactsCreatedOnTheInstance = origInformationalArtifacts;
    }

    Map<String, List<String>> getOrigCompInstExternalRefs() {
        return origComponentInstanceExternalRefs;
    }

    void setOrigComponentInstanceExternalRefs(Map<String, List<String>> origComponentInstanceExternalRefs) {
        this.origComponentInstanceExternalRefs = origComponentInstanceExternalRefs;
    }

    void setVfRelationsInfo(ContainerRelationsMergeInfo containerRelationsMergeInfo) {
        this.containerRelationsMergeInfo = containerRelationsMergeInfo;
    }

    ContainerRelationsMergeInfo getContainerRelationsMergeInfo() {
        return containerRelationsMergeInfo;
    }

    List<CapabilityDefinition> getOrigInstanceCapabilities() {
        return origInstanceCapabilities;
    }

    void setOrigInstanceCapabilities(List<CapabilityDefinition> origInstanceCapabilities) {
        this.origInstanceCapabilities = origInstanceCapabilities;
    }

    Component getOrigInstanceNode() {
        return origInstanceNode;
    }

    void setOrigInstanceNode(Component origInstanceNode) {
        this.origInstanceNode = origInstanceNode;
    }

    Component getCurrInstanceNode() {
        return currInstanceNode;
    }

    public void setCurrInstanceNode(Component currInstanceNode) {
        this.currInstanceNode = currInstanceNode;
    }

    public String getOrigComponentInstId() {
        return origComponentInstId;
    }

    public void setOrigComponentInstId(String origComponentInstId) {
        this.origComponentInstId = origComponentInstId;
    }

    public List<ComponentInstanceInterface> getOrigComponentInstanceInterfaces() {
        return origComponentInstanceInterfaces;
    }

    public void setOrigComponentInstanceInterfaces(List<ComponentInstanceInterface> origComponentInstanceInterfaces) {
        this.origComponentInstanceInterfaces = origComponentInstanceInterfaces;
    }
}