actually adding the files to the initial commit
[vid.git] / vid / src / main / java / org / openecomp / vid / model / VNF.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
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.vid.model;
22
23 import java.util.Map;
24 import java.util.UUID;
25
26 import org.openecomp.vid.asdc.beans.tosca.Input;
27 import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
28
29 /**
30  * The Class VNF.
31  */
32 public class VNF {
33
34         /** The uuid. */
35         private String uuid;
36         
37         /** The invariant uuid. */
38         private String invariantUuid;
39         
40         /** The description. */
41         private String description;
42         
43         /** The name. */
44         private String name;
45         
46         /** The version. */
47         private String version;
48         
49         /** The model customization name. */
50         private String modelCustomizationName;
51         
52         /** The inputs. */
53         private Map<String, Input> inputs;
54         
55         /** The vf modules. */
56         private Map<UUID, VfModule> vfModules;
57         
58         /** The volume groups. */
59         private Map<UUID, VolumeGroup> volumeGroups;
60         
61         /**
62          * Instantiates a new vnf.
63          */
64         public VNF() {}
65         
66         /**
67          * Gets the uuid.
68          *
69          * @return the uuid
70          */
71         public String getUuid() {
72                 return uuid;
73         }
74
75         /**
76          * Gets the invariant uuid.
77          *
78          * @return the invariant uuid
79          */
80         public String getInvariantUuid() {
81                 return invariantUuid;
82         }
83
84         /**
85          * Gets the description.
86          *
87          * @return the description
88          */
89         public String getDescription() {
90                 return description;
91         }
92
93         /**
94          * Gets the name.
95          *
96          * @return the name
97          */
98         public String getName() {
99                 return name;
100         }
101
102         /**
103          * Gets the version.
104          *
105          * @return the version
106          */
107         public String getVersion() {
108                 return version;
109         }
110         
111         /**
112          * Gets the model customization name.
113          *
114          * @return the model customization name
115          */
116         public String getModelCustomizationName() {
117                 return modelCustomizationName;
118         }
119
120         /**
121          * Gets the inputs.
122          *
123          * @return the inputs
124          */
125         public Map<String, Input> getInputs() {
126                 return inputs;
127         }
128
129         /**
130          * Sets the uuid.
131          *
132          * @param uuid the new uuid
133          */
134         public void setUuid(String uuid) {
135                 this.uuid = uuid;
136         }
137
138         /**
139          * Sets the invariant uuid.
140          *
141          * @param invariantUuid the new invariant uuid
142          */
143         public void setInvariantUuid(String invariantUuid) {
144                 this.invariantUuid = invariantUuid;
145         }
146
147         /**
148          * Sets the description.
149          *
150          * @param description the new description
151          */
152         public void setDescription(String description) {
153                 this.description = description;
154         }
155
156         /**
157          * Sets the name.
158          *
159          * @param name the new name
160          */
161         public void setName(String name) {
162                 this.name = name;
163         }
164
165         /**
166          * Sets the version.
167          *
168          * @param version the new version
169          */
170         public void setVersion(String version) {
171                 this.version = version;
172         }
173
174         /**
175          * Gets the vf modules.
176          *
177          * @return the vf modules
178          */
179         public Map<UUID, VfModule> getVfModules() {
180                 return vfModules;
181         }
182
183         /**
184          * Sets the vf modules.
185          *
186          * @param vfModules the vf modules
187          */
188         public void setVfModules(Map<UUID, VfModule> vfModules) {
189                 this.vfModules = vfModules;
190         }
191
192         /**
193          * Gets the volume groups.
194          *
195          * @return the volume groups
196          */
197         public Map<UUID, VolumeGroup> getVolumeGroups() {
198                 return volumeGroups;
199         }
200
201         /**
202          * Sets the volume groups.
203          *
204          * @param volumeGroups the volume groups
205          */
206         public void setVolumeGroups(Map<UUID, VolumeGroup> volumeGroups) {
207                 this.volumeGroups = volumeGroups;
208         }
209
210         /**
211          * Sets the inputs.
212          *
213          * @param inputs the inputs
214          */
215         public void setInputs(Map<String, Input> inputs) {
216                 this.inputs = inputs;
217         }
218
219         /**
220          * Extract vnf.
221          *
222          * @param modelCustomizationName the model customization name
223          * @param nodeTemplate the node template
224          * @return the vnf
225          */
226         public static VNF extractVnf(String modelCustomizationName, NodeTemplate nodeTemplate) {
227                 
228                 final VNF vnf = new VNF();
229                 
230                 vnf.setUuid(nodeTemplate.getMetadata().getUUID());
231                 vnf.setInvariantUuid(nodeTemplate.getMetadata().getInvariantUUID());
232                 vnf.setDescription(nodeTemplate.getMetadata().getDescription());
233                 vnf.setName(nodeTemplate.getMetadata().getName());
234                 vnf.setModelCustomizationName(modelCustomizationName);
235                 vnf.setVersion(nodeTemplate.getMetadata().getVersion());
236                 
237                 return vnf;
238         }
239
240         /**
241          * Sets the model customization name.
242          *
243          * @param modelCustomizationName the new model customization name
244          */
245         private void setModelCustomizationName(String modelCustomizationName) {
246                 this.modelCustomizationName = modelCustomizationName;
247         }
248 }