Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / serviceInstantiation / VfModule.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 import com.fasterxml.jackson.annotation.JsonInclude;
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 import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
32
33 /**
34  * The Class VfModule.
35  */
36 @JsonInclude(NON_NULL)
37 public class VfModule extends BaseResource implements JobAdapter.AsyncJobRequest {
38
39         @JsonInclude(NON_NULL) private final String volumeGroupInstanceName;
40         private boolean usePreload;
41         private Map<String, String> supplementaryParams;
42
43         public VfModule( @JsonProperty("modelInfo") ModelInfo modelInfo,
44                      @JsonProperty("instanceName") String instanceName,
45                      @JsonProperty("volumeGroupName") String volumeGroupInstanceName,
46                                          @JsonProperty("action") String action,
47                      @JsonProperty("lcpCloudRegionId") String lcpCloudRegionId,
48                      @JsonProperty("legacyRegion") String legacyRegion,
49                      @JsonProperty("tenantId") String tenantId,
50                      @JsonProperty("instanceParams") List<Map<String, String>> instanceParams,
51                      @JsonProperty("supplementaryFileContent") Map<String, String> supplementaryParams,
52                      @JsonProperty("rollbackOnFailure") boolean rollbackOnFailure,
53                      @JsonProperty("sdncPreLoad") boolean usePreload,
54                                          @JsonProperty("instanceId") String instanceId) {
55                 super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId);
56                 this.volumeGroupInstanceName = volumeGroupInstanceName;
57                 this.usePreload = usePreload;
58                 this.supplementaryParams = supplementaryParams;
59         }
60
61         public String getVolumeGroupInstanceName() {
62                 return volumeGroupInstanceName;
63         }
64
65         public boolean isUsePreload() {
66                 return usePreload;
67         }
68
69         public Map<String, String> getSupplementaryParams() {
70                 return supplementaryParams;
71         }
72
73         @Override
74         protected String getModelType() {
75                 return "vfModule";
76         }
77
78
79 }