Implant vid-app-common org.onap.vid.job (main and test)
[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.job.JobType;
27 import org.onap.vid.mso.model.ModelInfo;
28
29 import java.util.Collection;
30 import java.util.Collections;
31 import java.util.List;
32 import java.util.Map;
33
34 import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
35
36 /**
37  * The Class VfModule.
38  */
39 @JsonInclude(NON_NULL)
40 public class VfModule extends BaseResource implements JobAdapter.AsyncJobRequest {
41
42         @JsonInclude(NON_NULL) private final String volumeGroupInstanceName;
43         @JsonInclude(NON_NULL) private Boolean usePreload;
44         private Map<String, String> supplementaryParams;
45
46         public VfModule( @JsonProperty("modelInfo") ModelInfo modelInfo,
47                                          @JsonProperty("instanceName") String instanceName,
48                                          @JsonProperty("volumeGroupName") String volumeGroupInstanceName,
49                                          @JsonProperty("action") String action,
50                                          @JsonProperty("lcpCloudRegionId") String lcpCloudRegionId,
51                                          @JsonProperty("legacyRegion") String legacyRegion,
52                                          @JsonProperty("tenantId") String tenantId,
53                                          @JsonProperty("instanceParams") List<Map<String, String>> instanceParams,
54                                          @JsonProperty("supplementaryFileContent") Map<String, String> supplementaryParams,
55                                          @JsonProperty("rollbackOnFailure") boolean rollbackOnFailure,
56                                          @JsonProperty("sdncPreLoad") Boolean usePreload,
57                                          @JsonProperty("instanceId") String instanceId,
58                                          @JsonProperty("trackById") String trackById,
59                                          @JsonProperty("isFailed") Boolean isFailed,
60                                          @JsonProperty("statusMessage") String statusMessage) {
61                 super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId, trackById, isFailed, statusMessage);
62                 this.volumeGroupInstanceName = volumeGroupInstanceName;
63                 this.usePreload = usePreload;
64                 this.supplementaryParams = supplementaryParams;
65         }
66
67         public String getVolumeGroupInstanceName() {
68                 return volumeGroupInstanceName;
69         }
70
71         public Boolean isUsePreload() {
72
73                 return usePreload;
74         }
75
76         public Map<String, String> getSupplementaryParams() {
77                 return supplementaryParams;
78         }
79
80         @Override
81         protected String getModelType() {
82                 return "vfModule";
83         }
84
85         @Override
86         public Collection<BaseResource> getChildren() {
87                 return Collections.emptyList();
88         }
89
90         @Override
91         public JobType getJobType() {
92                 return JobType.VfmoduleInstantiation;
93         }
94 }