6736512ceed64e6e169f6a4db074b4d9f35c35be
[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 org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component;
24 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
25 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
26
27 import java.util.ArrayList;
28 import java.util.HashMap;
29 import java.util.HashSet;
30 import java.util.List;
31 import java.util.Map;
32 import java.util.Set;
33
34 public class ExtractCompositionDataContext {
35   private List<Network> networks = new ArrayList<>();
36   private List<Component> components = new ArrayList<>();
37   private Map<String, Nic> nics = new HashMap<>();
38   private Set<String> handledServiceTemplates = new HashSet<>();
39   private Set<String> createdComponents = new HashSet<>();
40
41   public Set<String> getCreatedComponents() {
42     return createdComponents;
43   }
44
45   public void setCreatedComponents(Set<String> createdComponents) {
46     this.createdComponents = createdComponents;
47   }
48
49   public Set<String> getHandledServiceTemplates() {
50     return handledServiceTemplates;
51   }
52
53   public void setHandledServiceTemplates(Set<String> handledServiceTemplates) {
54     this.handledServiceTemplates = handledServiceTemplates;
55   }
56
57   public void addHandledServiceTemplates(String handledServiceTemplate) {
58     this.handledServiceTemplates.add(handledServiceTemplate);
59   }
60
61   public List<Network> getNetworks() {
62     return networks;
63   }
64
65   public void setNetworks(List<Network> networks) {
66     this.networks = networks;
67   }
68
69   /**
70    * Add network.
71    *
72    * @param network the network
73    */
74   public void addNetwork(Network network) {
75     if (network != null) {
76       networks.add(network);
77     }
78   }
79
80   /**
81    * Add networks.
82    *
83    * @param network the network
84    */
85   public void addNetworks(List<Network> network) {
86     if (networks != null) {
87       networks.addAll(network);
88     }
89   }
90
91   public List<Component> getComponents() {
92     return components;
93   }
94
95   public void setComponents(List<Component> components) {
96     this.components = components;
97   }
98
99   /**
100    * Add component.
101    *
102    * @param component the component
103    */
104   public void addComponent(Component component) {
105     if (component != null) {
106       components.add(component);
107     }
108   }
109
110   /**
111    * Add components.
112    *
113    * @param components the components
114    */
115   public void addComponents(List<Component> components) {
116     if (components != null) {
117       this.components.addAll(components);
118     }
119   }
120
121   public Map<String, Nic> getNics() {
122     return nics;
123   }
124
125   public void setNics(Map<String, Nic> nics) {
126     this.nics = nics;
127   }
128
129   public void addNic(String nicId, Nic nic) {
130     this.nics.put(nicId, nic);
131   }
132
133
134 }