2 * ============LICENSE_START=======================================================
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
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.vid.model;
24 import java.util.UUID;
26 import org.openecomp.vid.asdc.beans.tosca.Input;
27 import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
37 /** The invariant uuid. */
38 private String invariantUuid;
40 /** The description. */
41 private String description;
47 private String version;
49 /** The model customization name. */
50 private String modelCustomizationName;
53 private Map<String, Input> inputs;
55 /** The vf modules. */
56 private Map<UUID, VfModule> vfModules;
58 /** The volume groups. */
59 private Map<UUID, VolumeGroup> volumeGroups;
62 * Instantiates a new vnf.
71 public String getUuid() {
76 * Gets the invariant uuid.
78 * @return the invariant uuid
80 public String getInvariantUuid() {
85 * Gets the description.
87 * @return the description
89 public String getDescription() {
98 public String getName() {
105 * @return the version
107 public String getVersion() {
112 * Gets the model customization name.
114 * @return the model customization name
116 public String getModelCustomizationName() {
117 return modelCustomizationName;
125 public Map<String, Input> getInputs() {
132 * @param uuid the new uuid
134 public void setUuid(String uuid) {
139 * Sets the invariant uuid.
141 * @param invariantUuid the new invariant uuid
143 public void setInvariantUuid(String invariantUuid) {
144 this.invariantUuid = invariantUuid;
148 * Sets the description.
150 * @param description the new description
152 public void setDescription(String description) {
153 this.description = description;
159 * @param name the new name
161 public void setName(String name) {
168 * @param version the new version
170 public void setVersion(String version) {
171 this.version = version;
175 * Gets the vf modules.
177 * @return the vf modules
179 public Map<UUID, VfModule> getVfModules() {
184 * Sets the vf modules.
186 * @param vfModules the vf modules
188 public void setVfModules(Map<UUID, VfModule> vfModules) {
189 this.vfModules = vfModules;
193 * Gets the volume groups.
195 * @return the volume groups
197 public Map<UUID, VolumeGroup> getVolumeGroups() {
202 * Sets the volume groups.
204 * @param volumeGroups the volume groups
206 public void setVolumeGroups(Map<UUID, VolumeGroup> volumeGroups) {
207 this.volumeGroups = volumeGroups;
213 * @param inputs the inputs
215 public void setInputs(Map<String, Input> inputs) {
216 this.inputs = inputs;
222 * @param modelCustomizationName the model customization name
223 * @param nodeTemplate the node template
226 public static VNF extractVnf(String modelCustomizationName, NodeTemplate nodeTemplate) {
228 final VNF vnf = new VNF();
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());
241 * Sets the model customization name.
243 * @param modelCustomizationName the new model customization name
245 private void setModelCustomizationName(String modelCustomizationName) {
246 this.modelCustomizationName = modelCustomizationName;