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