621754d171499c80a2f477abf567ee3fa5ace06d
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / serviceInstantiation / 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.onap.vid.model.serviceInstantiation;
22
23
24 import com.fasterxml.jackson.annotation.JsonProperty;
25 import org.apache.commons.lang3.StringUtils;
26 import org.onap.vid.domain.mso.ModelInfo;
27
28 import java.util.Collections;
29 import java.util.List;
30 import java.util.Map;
31
32 /**
33  * The Class VNF.
34  */
35 public class Vnf  {
36         private final ModelInfo modelInfo;
37
38         private final String productFamilyId;
39
40         private final String instanceName;
41
42         private final String platformName;
43
44         private final String lcpCloudRegionId;
45
46         private final String tenantId;
47
48         private final Boolean isUserProvidedNaming;
49
50         private final List<Map<String, String>> instanceParams;
51
52         private final String lineOfBusiness;
53
54
55         private final Map<String, Map<String, VfModule>> vfModules;
56
57         public Vnf(@JsonProperty("modelInfo") ModelInfo modelInfo,
58                            @JsonProperty("productFamilyId") String productFamilyId,
59                            @JsonProperty("instanceName") String instanceName,
60                            @JsonProperty("isUserProvidedNaming") Boolean isUserProvidedNaming,
61                            @JsonProperty("platformName") String platformName,
62                            @JsonProperty("lcpCloudRegionId") String lcpCloudRegionId,
63                            @JsonProperty("tenantId") String tenantId,
64                            @JsonProperty("instanceParams") List<Map<String, String>> instanceParams,
65                            @JsonProperty("lineOfBusinessName") String lineOfBusiness,
66                            @JsonProperty("vfModules") Map<String, Map<String, VfModule>> vfModules) {
67                 this.modelInfo = modelInfo;
68                 this.modelInfo.setModelType("vnf");
69                 this.productFamilyId = productFamilyId;
70                 this.instanceName = instanceName;
71                 this.isUserProvidedNaming = isUserProvidedNaming;
72                 this.platformName = platformName;
73                 this.lcpCloudRegionId = lcpCloudRegionId;
74                 this.tenantId = tenantId;
75                 this.instanceParams = instanceParams;
76                 this.vfModules = vfModules;
77                 this.lineOfBusiness = lineOfBusiness;
78         }
79
80         public ModelInfo getModelInfo() {
81                 return modelInfo;
82         }
83
84         public String getProductFamilyId() {
85                 return productFamilyId;
86         }
87
88         public String getInstanceName() {
89                 return instanceName;
90         }
91
92         @JsonProperty("isUserProvidedNaming")
93         public Boolean isUserProvidedNaming() {
94                 return isUserProvidedNaming;
95         }
96
97         public String getPlatformName() {
98                 return platformName;
99         }
100
101         public String getLcpCloudRegionId() {
102                 return lcpCloudRegionId;
103         }
104
105         public String getTenantId() {
106                 return tenantId;
107         }
108
109         public List<Map<String, String>> getInstanceParams() {
110                 return instanceParams == null ? Collections.emptyList() : instanceParams;
111         }
112
113         public  Map<String, Map<String, VfModule>> getVfModules() {
114                 return vfModules;
115         }
116
117         public String getLineOfBusiness() {
118                 return lineOfBusiness;
119         }
120 }