[SDC] Onboarding 1710 rebase.
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-software-product-lib / openecomp-sdc-vendor-software-product-api / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / types / composition / ExtractCompositionDataContext.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
22
23 import java.util.ArrayList;
24 import java.util.HashMap;
25 import java.util.HashSet;
26 import java.util.List;
27 import java.util.Map;
28 import java.util.Set;
29
30 public class ExtractCompositionDataContext {
31   private List<Network> networks = new ArrayList<>();
32   private List<Component> components = new ArrayList<>();
33   private Map<String, Nic> nics = new HashMap<>();
34   private Map<String, Image> images = new HashMap<>();
35   private Map<String, ComputeData> computes = new HashMap<>();
36   private Set<String> handledServiceTemplates = new HashSet<>();
37   private Set<String> createdComponents = new HashSet<>();
38
39   public Set<String> getCreatedComponents() {
40     return createdComponents;
41   }
42
43   public void setCreatedComponents(Set<String> createdComponents) {
44     this.createdComponents = createdComponents;
45   }
46
47   public Set<String> getHandledServiceTemplates() {
48     return handledServiceTemplates;
49   }
50
51   public void setHandledServiceTemplates(Set<String> handledServiceTemplates) {
52     this.handledServiceTemplates = handledServiceTemplates;
53   }
54
55   public void addHandledServiceTemplates(String handledServiceTemplate) {
56     this.handledServiceTemplates.add(handledServiceTemplate);
57   }
58
59   public List<Network> getNetworks() {
60     return networks;
61   }
62
63   public void setNetworks(List<Network> networks) {
64     this.networks = networks;
65   }
66
67   /**
68    * Add network.
69    *
70    * @param network the network
71    */
72   public void addNetwork(Network network) {
73     if (network != null) {
74       networks.add(network);
75     }
76   }
77
78   /**
79    * Add networks.
80    *
81    * @param network the network
82    */
83   public void addNetworks(List<Network> network) {
84     if (networks != null) {
85       networks.addAll(network);
86     }
87   }
88
89   public List<Component> getComponents() {
90     return components;
91   }
92
93   public void setComponents(List<Component> components) {
94     this.components = components;
95   }
96
97   /**
98    * Add component.
99    *
100    * @param component the component
101    */
102   public void addComponent(Component component) {
103     if (component != null) {
104       components.add(component);
105     }
106   }
107
108   /**
109    * Add components.
110    *
111    * @param components the components
112    */
113   public void addComponents(List<Component> components) {
114     if (components != null) {
115       this.components.addAll(components);
116     }
117   }
118
119   public Map<String, Nic> getNics() {
120     return nics;
121   }
122
123   public void setNics(Map<String, Nic> nics) {
124     this.nics = nics;
125   }
126
127   public void addNic(String nicId, Nic nic) {
128     this.nics.put(nicId, nic);
129   }
130
131   public Map<String, Image> getImages() {
132     return images;
133   }
134
135   public void setImages(Map<String, Image> images) {
136     this.images = images;
137   }
138
139   public void addImage(String imageId, Image image) {
140     this.images.put(imageId, image);
141   }
142
143
144   public Map<String, ComputeData> getComputes() {
145     return computes;
146   }
147
148   public void setComputes(
149       Map<String, ComputeData> computes) {
150     this.computes = computes;
151   }
152
153   public void addCompute(String computeId, ComputeData computedata ){
154     this.computes.put(computeId,computedata);
155   }
156 }