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.JsonAlias;
26 import com.fasterxml.jackson.annotation.JsonInclude;
27 import com.fasterxml.jackson.annotation.JsonProperty;
28 import java.util.Collection;
29 import java.util.Collections;
30 import java.util.List;
32 import javax.annotation.Nullable;
33 import org.onap.vid.job.JobAdapter;
34 import org.onap.vid.job.JobType;
35 import org.onap.vid.mso.model.ModelInfo;
40 @JsonInclude(NON_NULL)
41 public class VfModule extends BaseResource implements JobAdapter.AsyncJobRequest {
43 @JsonInclude(NON_NULL) @JsonProperty("volumeGroupName") private final String volumeGroupInstanceName;
44 @JsonInclude(NON_NULL) @JsonProperty("sdncPreLoad") private Boolean usePreload;
45 private Map<String, String> supplementaryParams;
47 @JsonInclude(NON_NULL)
48 private final Boolean retainVolumeGroups;
50 @JsonInclude(NON_NULL)
51 private Boolean retainAssignments;
53 public VfModule(@JsonProperty("modelInfo") ModelInfo modelInfo,
54 @JsonProperty("instanceName") String instanceName,
55 @JsonProperty("volumeGroupName") @JsonAlias("volumeGroupInstanceName") String volumeGroupInstanceName,
56 @JsonProperty("action") String action,
57 @JsonProperty("lcpCloudRegionId") String lcpCloudRegionId,
58 @JsonProperty("legacyRegion") String legacyRegion,
59 @JsonProperty("tenantId") String tenantId,
60 @JsonProperty("instanceParams") List<Map<String, String>> instanceParams,
61 @JsonProperty("supplementaryFileContent") Map<String, String> supplementaryParams,
62 @JsonProperty("rollbackOnFailure") boolean rollbackOnFailure,
63 @JsonProperty("sdncPreLoad") @JsonAlias("usePreload") Boolean usePreload,
64 @JsonProperty("instanceId") String instanceId,
65 @JsonProperty("trackById") String trackById,
66 @JsonProperty("isFailed") Boolean isFailed,
67 @JsonProperty("statusMessage") String statusMessage,
68 @Nullable @JsonProperty("retainAssignments") Boolean retainAssignments,
69 @Nullable @JsonProperty("retainVolumeGroups") Boolean retainVolumeGroups,
70 @JsonProperty("position") Integer position) {
71 super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId, trackById, isFailed, statusMessage,
73 this.volumeGroupInstanceName = volumeGroupInstanceName;
74 this.usePreload = usePreload;
75 this.supplementaryParams = supplementaryParams;
76 this.retainAssignments = retainAssignments;
77 this.retainVolumeGroups = retainVolumeGroups;
80 public String getVolumeGroupInstanceName() {
81 return volumeGroupInstanceName;
84 public Boolean isUsePreload() {
89 public Map<String, String> getSupplementaryParams() {
90 return supplementaryParams;
94 protected String getModelType() {
99 public Collection<BaseResource> getChildren() {
100 return Collections.emptyList();
104 public JobType getJobType() {
105 return JobType.VfmoduleInstantiation;
109 public Boolean isRetainAssignments() {
110 return retainAssignments;
114 public Boolean isRetainVolumeGroups() {
115 return retainVolumeGroups;
118 public VfModule cloneWith(ModelInfo modelInfo) {
121 this.getInstanceName(),
122 this.getVolumeGroupInstanceName(),
123 this.getAction().toString(),
124 this.getLcpCloudRegionId(),
125 this.getLcpCloudRegionId(),
127 this.getInstanceParams(),
128 this.getSupplementaryParams(),
129 this.isRollbackOnFailure(),
131 this.getInstanceId(),
134 this.getStatusMessage(),
135 this.isRetainAssignments(),
136 this.isRetainVolumeGroups(),