Replace vfmodule: expect optional retainVolumeGroups param
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / NewVNF.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 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.onap.vid.model;
22
23 import java.util.HashMap;
24 import java.util.Map;
25 import java.util.regex.Pattern;
26
27 public class NewVNF extends NewNode {
28
29         /** The pattern used to normalize VNF names */
30         static final Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
31         
32         /** The model customization name. */
33         private String modelCustomizationName;
34         
35         /** The vf modules. */
36         private Map<String, VfModule> vfModules = new HashMap<>();
37         
38         /** The volume groups. */
39         private Map<String, VolumeGroup> volumeGroups = new HashMap<>();
40         
41         /**
42          * Instantiates a newvnf.
43          */
44         public NewVNF() {
45                 super();
46         }
47
48         /**
49          * Gets the model customization name.
50          *
51          * @return the model customization name
52          */
53         public String getModelCustomizationName() {
54                 return modelCustomizationName;
55         }
56
57         /**
58          * Gets the vf modules.
59          *
60          * @return the vf modules
61          */
62         public Map<String, VfModule> getVfModules() {
63                 return vfModules;
64         }
65
66         /**
67          * Sets the vf modules.
68          *
69          * @param vfModules the vf modules
70          */
71         public void setVfModules(Map<String, VfModule> vfModules) {
72                 this.vfModules = vfModules;
73         }
74
75         /**
76          * Gets the volume groups.
77          *
78          * @return the volume groups
79          */
80         public Map<String, VolumeGroup> getVolumeGroups() {
81                 return volumeGroups;
82         }
83
84         /**
85          * Sets the volume groups.
86          *
87          * @param volumeGroups the volume groups
88          */
89         public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
90                 this.volumeGroups = volumeGroups;
91         }
92
93
94         /**
95          * Sets the model customization name.
96          *
97          * @param modelCustomizationName the new model customization name
98          */
99         public void setModelCustomizationName(String modelCustomizationName) {
100                 this.modelCustomizationName = modelCustomizationName;
101         }
102         /**
103          * Normalize the VNF name
104          * @param originalName
105          * @return the normalized name
106          */
107         public static String normalizeName (String originalName) {
108                         return VNF.normalizeName(originalName);
109         }
110 }