Containerization feature of SO
[so.git] / adapters / mso-openstack-adapters / src / main / java / org / onap / so / adapters / valet / beans / HeatRequest.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.adapters.valet.beans;
22
23 import java.io.Serializable;
24 import java.util.HashMap;
25 import java.util.Map;
26 import java.util.Objects;
27
28 import com.fasterxml.jackson.annotation.JsonProperty;
29 import com.woorea.openstack.heat.model.CreateStackParam;
30
31 /*
32  * This class represents the heat request as sent to OpenStack as defined in the
33  * Valet Placement Operations API
34  */
35 public class HeatRequest implements Serializable {
36         private static final long serialVersionUID = 768026109321305392L;
37         @JsonProperty("stack_name")
38         private String stackName;
39         @JsonProperty("disable_rollback")
40         private Boolean disableRollback;
41         @JsonProperty("timeout_mins")
42         private Integer timeoutMins;
43         @JsonProperty("template")
44         private String template;
45         @JsonProperty("environment")
46         private String environment;
47         @JsonProperty("files")
48         private Map<String, Object> files = new HashMap<String, Object>();
49         @JsonProperty("parameters")
50         private Map<String, Object> parameters = new HashMap<String, Object>();
51         
52         public HeatRequest(String stackName, boolean disableRollback, int timeoutMins, String template, String environment, Map<String, Object> files, Map<String, Object> parameters) {
53                 super();
54                 this.stackName = stackName;
55                 this.disableRollback = disableRollback;
56                 this.timeoutMins = timeoutMins;
57                 this.template = template;
58                 this.environment = environment;
59                 this.files = files;
60                 this.parameters = parameters;
61         }
62
63         public String getStackName() {
64                 return this.stackName;
65         }
66         public void setStackName(String stackName) {
67                 this.stackName = stackName;
68         }       
69         public Boolean getDisableRollback() {
70                 return this.disableRollback;
71         }
72         public void setDisableRollback(Boolean disableRollback) {
73                 this.disableRollback = disableRollback;
74         }       
75         public Integer getTimeoutMins() {
76                 return this.timeoutMins;
77         }
78         public void setTimeoutMins(Integer timeoutMins) {
79                 this.timeoutMins = timeoutMins;
80         }       
81         public String getTemplate() {
82                 return this.template;
83         }
84         public void setTemplate(String template) {
85                 this.template = template;
86         }       
87         public String getEnvironment() {
88                 return this.environment;
89         }
90         public void setEnvironment(String environment) {
91                 this.environment = environment;
92         }       
93         public Map<String, Object> getFiles() {
94                 return this.files;
95         }
96         public void setFiles(Map<String, Object> files) {
97                 this.files = files;
98         }       
99         public Map<String, Object> getParameters() {
100                 return this.parameters;
101         }
102         public void setParameters(Map<String, Object> parameters) {
103                 this.parameters = parameters;
104         }       
105         @Override
106         public int hashCode() {
107                 return Objects.hash(stackName, disableRollback, timeoutMins, template, environment, files, parameters);
108         }
109         @Override
110         public boolean equals(Object o) {
111                 if (o == this)
112                         return true;
113                 if (!(o instanceof HeatRequest)) {
114                         return false;
115                 }
116                 HeatRequest hr = (HeatRequest) o;
117                 return Objects.equals(stackName, hr.stackName) 
118                                 && Objects.equals(disableRollback, hr.disableRollback)
119                                 && Objects.equals(timeoutMins, hr.timeoutMins)
120                                 && Objects.equals(template, hr.template)
121                                 && Objects.equals(environment, hr.environment)
122                                 && Objects.equals(files, hr.files)
123                                 && Objects.equals(parameters, hr.parameters);
124         }
125 }