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