Containerization feature of SO
[so.git] / adapters / mso-adapters-rest-interface / src / main / java / org / onap / so / openstack / beans / VnfRollback.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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.so.openstack.beans;
22
23 import org.onap.so.entity.MsoRequest;
24 /**
25  * Javabean representing the rollback criteria following a "Create VNF"
26  * operation.  This structure can be passed back to the "Rollback VNF"
27  * operation to undo the effects of the create.
28  *
29  *
30  */
31 public class VnfRollback {
32         private String vnfId;
33         private String tenantId;
34         private String cloudSiteId;
35         private boolean tenantCreated = false;
36         private boolean vnfCreated = false;
37         private MsoRequest msoRequest;
38         private String volumeGroupName;
39         private String volumeGroupId;
40         private String requestType;
41         private String volumeGroupHeatStackId;
42         private String baseGroupHeatStackId;
43         private boolean isBase = false;
44         private String vfModuleStackId;
45         private String modelCustomizationUuid; //NOTE: this is the vfModule's modelCustomizationUuid
46         private String mode = "HEAT";
47
48         public VnfRollback() {}
49
50         /**
51          * For backwards compatibility... orchestration mode defaults to HEAT
52          * 
53          * @param vnfId
54          * @param tenantId
55          * @param cloudSiteId
56          * @param tenantCreated
57          * @param vnfCreated
58          * @param msoRequest
59          * @param volumeGroupName
60          * @param volumeGroupId
61          * @param requestType
62          * @param modelCustomizationUuid
63          */
64         public VnfRollback(String vnfId, String tenantId, String cloudSiteId,
65                         boolean tenantCreated, boolean vnfCreated,
66                         MsoRequest msoRequest,
67                         String volumeGroupName, String volumeGroupId, String requestType, String modelCustomizationUuid) {
68                 super();
69                 this.vnfId = vnfId;
70                 this.tenantId = tenantId;
71                 this.cloudSiteId = cloudSiteId;
72                 this.tenantCreated = tenantCreated;
73                 this.vnfCreated = vnfCreated;
74                 this.msoRequest = msoRequest;
75                 this.volumeGroupName = volumeGroupName;
76                 this.volumeGroupId = volumeGroupId;
77                 this.requestType = requestType;
78                 this.modelCustomizationUuid = modelCustomizationUuid;
79         }
80
81         /**
82          * 
83          * @param vnfId
84          * @param tenantId
85          * @param cloudSiteId
86          * @param tenantCreated
87          * @param vnfCreated
88          * @param msoRequest
89          * @param volumeGroupName
90          * @param volumeGroupId
91          * @param requestType
92          * @param modelCustomizationUuid
93          */
94         public VnfRollback(String vnfId, String tenantId, String cloudSiteId,
95                         boolean tenantCreated, boolean vnfCreated,
96                         MsoRequest msoRequest, String volumeGroupName, String volumeGroupId,
97                         String requestType, String modelCustomizationUuid, String orchestrationMode) {
98                 super();
99                 this.vnfId = vnfId;
100                 this.tenantId = tenantId;
101                 this.cloudSiteId = cloudSiteId;
102                 this.tenantCreated = tenantCreated;
103                 this.vnfCreated = vnfCreated;
104                 this.msoRequest = msoRequest;
105                 this.volumeGroupName = volumeGroupName;
106                 this.volumeGroupId = volumeGroupId;
107                 this.requestType = requestType;
108                 this.modelCustomizationUuid = modelCustomizationUuid;
109                 this.mode = orchestrationMode;
110         }
111
112         public String getVnfId() {
113                 return vnfId;
114         }
115         public void setVnfId(String vnfId) {
116                 this.vnfId = vnfId;
117         }
118         public String getTenantId() {
119                 return tenantId;
120         }
121
122         public void setTenantId(String tenantId) {
123                 this.tenantId = tenantId;
124         }
125         public String getCloudSiteId() {
126                 return cloudSiteId;
127         }
128         public void setCloudSiteId(String cloudId) {
129                 this.cloudSiteId = cloudId;
130         }
131         public boolean getTenantCreated() {
132                 return tenantCreated;
133         }
134         public void setTenantCreated(boolean tenantCreated) {
135                 this.tenantCreated = tenantCreated;
136         }
137         public boolean getVnfCreated() {
138                 return vnfCreated;
139         }
140         public void setVnfCreated(boolean vnfCreated) {
141                 this.vnfCreated = vnfCreated;
142         }
143         public MsoRequest getMsoRequest() {
144                 return msoRequest;
145         }
146         public void setMsoRequest (MsoRequest msoRequest) {
147                 this.msoRequest = msoRequest;
148         }
149         public String getVolumeGroupName() {
150                 return this.volumeGroupName;
151         }
152         public void setVolumeGroupName(String volumeGroupName) {
153                 this.volumeGroupName = volumeGroupName;
154         }
155         public String getVolumeGroupId() {
156                 return this.volumeGroupId;
157         }
158         public void setVolumeGroupId(String volumeGroupId) {
159                 this.volumeGroupId = volumeGroupId;
160         }
161         public String getRequestType() {
162                 return this.requestType;
163         }
164         public void setRequestType(String requestType) {
165                 this.requestType = requestType;
166         }
167         public String getVolumeGroupHeatStackId() {
168                 return this.volumeGroupHeatStackId;
169         }
170         public void setVolumeGroupHeatStackId(String volumeGroupHeatStackId) {
171                 this.volumeGroupHeatStackId = volumeGroupHeatStackId;
172         }
173
174         public String getBaseGroupHeatStackId() {
175                 return this.baseGroupHeatStackId;
176         }
177         public void setBaseGroupHeatStackId(String baseGroupHeatStackId) {
178                 this.baseGroupHeatStackId = baseGroupHeatStackId;
179         }
180
181         public boolean isBase() {
182                 return this.isBase;
183         }
184         public void setIsBase(boolean isBase) {
185                 this.isBase = isBase;
186         }
187         public String getVfModuleStackId() {
188                 return this.vfModuleStackId;
189         }
190         public void setVfModuleStackId(String vfModuleStackId) {
191                 this.vfModuleStackId = vfModuleStackId;
192         }
193         public String getModelCustomizationUuid() {
194                 return this.modelCustomizationUuid;
195         }
196         public void setModelCustomizationUuid(String modelCustomizationUuid) {
197                 this.modelCustomizationUuid = modelCustomizationUuid;
198         }
199         public String getMode() {
200                 return this.mode;
201         }
202         public void setMode(String mode) {
203                 this.mode = mode;
204         }
205         @Override
206     public String toString() {
207                 return "VnfRollback: cloud=" + cloudSiteId + ", tenant=" + tenantId +
208                                 ", vnf=" + vnfId + ", tenantCreated=" + tenantCreated +
209                                 ", vnfCreated=" + vnfCreated + ", requestType = " + requestType
210                                 + ", modelCustomizationUuid=" + this.modelCustomizationUuid
211                                 + ", mode=" + mode;
212         }
213 }