2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.vid.model.serviceInstantiation;
23 import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
25 import com.fasterxml.jackson.annotation.JsonInclude;
26 import com.fasterxml.jackson.annotation.JsonProperty;
27 import java.util.Collection;
28 import java.util.Collections;
29 import java.util.List;
31 import org.onap.vid.job.JobAdapter;
32 import org.onap.vid.job.JobType;
33 import org.onap.vid.mso.model.ModelInfo;
38 @JsonInclude(NON_NULL)
39 public class VfModule extends BaseResource implements JobAdapter.AsyncJobRequest {
41 @JsonInclude(NON_NULL) private final String volumeGroupInstanceName;
42 @JsonInclude(NON_NULL) private Boolean usePreload;
43 private Map<String, String> supplementaryParams;
45 public VfModule( @JsonProperty("modelInfo") ModelInfo modelInfo,
46 @JsonProperty("instanceName") String instanceName,
47 @JsonProperty("volumeGroupName") String volumeGroupInstanceName,
48 @JsonProperty("action") String action,
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("supplementaryFileContent") Map<String, String> supplementaryParams,
54 @JsonProperty("rollbackOnFailure") boolean rollbackOnFailure,
55 @JsonProperty("sdncPreLoad") Boolean usePreload,
56 @JsonProperty("instanceId") String instanceId,
57 @JsonProperty("trackById") String trackById,
58 @JsonProperty("isFailed") Boolean isFailed,
59 @JsonProperty("statusMessage") String statusMessage) {
60 super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId, trackById, isFailed, statusMessage);
61 this.volumeGroupInstanceName = volumeGroupInstanceName;
62 this.usePreload = usePreload;
63 this.supplementaryParams = supplementaryParams;
66 public String getVolumeGroupInstanceName() {
67 return volumeGroupInstanceName;
70 public Boolean isUsePreload() {
75 public Map<String, String> getSupplementaryParams() {
76 return supplementaryParams;
80 protected String getModelType() {
85 public Collection<BaseResource> getChildren() {
86 return Collections.emptyList();
90 public JobType getJobType() {
91 return JobType.VfmoduleInstantiation;
94 public VfModule cloneWith(ModelInfo modelInfo) {
97 this.getInstanceName(),
98 this.getVolumeGroupInstanceName(),
99 this.getAction().toString(),
100 this.getLcpCloudRegionId(),
101 this.getLcpCloudRegionId(),
103 this.getInstanceParams(),
104 this.getSupplementaryParams(),
105 this.isRollbackOnFailure(),
107 this.getInstanceId(),
110 this.getStatusMessage()