Merge from ECOMP's repository
[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.onap.vid.job.JobAdapter;
26 import org.onap.vid.mso.model.ModelInfo;
27
28 import java.util.List;
29 import java.util.Map;
30
31 /**
32  * The Class VNF.
33  */
34 public class Vnf extends BaseResource implements JobAdapter.AsyncJobRequest {
35
36         private final String productFamilyId;
37
38         private final String platformName;
39
40         private final String lineOfBusiness;
41
42         private final Map<String, Map<String, VfModule>> vfModules;
43
44         public Vnf(@JsonProperty("modelInfo") ModelInfo modelInfo,
45                @JsonProperty("productFamilyId") String productFamilyId,
46                @JsonProperty("instanceName") String instanceName,
47                            @JsonProperty("action") String action,
48                @JsonProperty("platformName") String platformName,
49                @JsonProperty("lcpCloudRegionId") String lcpCloudRegionId,
50                @JsonProperty("legacyRegion") String legacyRegion,
51                @JsonProperty("tenantId") String tenantId,
52                @JsonProperty("instanceParams") List<Map<String, String>> instanceParams,
53                @JsonProperty("lineOfBusinessName") String lineOfBusiness,
54                @JsonProperty("rollbackOnFailure") boolean rollbackOnFailure,
55                            @JsonProperty("instanceId") String instanceId,
56                @JsonProperty("vfModules") Map<String, Map<String, VfModule>> vfModules) {
57
58                 super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId);
59                 this.productFamilyId = productFamilyId;
60                 this.platformName = platformName;
61                 this.lineOfBusiness = lineOfBusiness;
62                 this.vfModules = vfModules;
63         }
64
65         public String getProductFamilyId() {
66                 return productFamilyId;
67         }
68
69         public String getPlatformName() {
70                 return platformName;
71         }
72
73         public String getLineOfBusiness() {
74                 return lineOfBusiness;
75         }
76
77         public  Map<String, Map<String, VfModule>> getVfModules() {
78                 return vfModules;
79         }
80
81         @Override
82         protected String getModelType() {
83                 return "vnf";
84         }
85 }