Changed to unmaintained
[appc.git] / appc-config / appc-flow-controller / provider / src / main / java / org / onap / appc / flow / controller / data / Transaction.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017-18 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Modifications Copyright (C) 2019 Ericsson
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * ============LICENSE_END=========================================================
22  */
23
24 package org.onap.appc.flow.controller.data;
25
26 import java.util.List;
27 import com.fasterxml.jackson.annotation.JsonProperty;
28
29 public class Transaction {
30
31     @JsonProperty("transaction-id")
32     private int transactionId ;
33
34     @JsonProperty("action")
35     private String action ;
36
37     @JsonProperty("action-level")
38     private String actionLevel ;
39
40     @JsonProperty("action-identifier")
41     private ActionIdentifier actionIdentifier ;
42
43     @JsonProperty("parameters")
44     private List<Parameters> parameters ;
45
46     private String executionType;
47
48     private String uId;
49
50     private String statusCode;
51
52     private String pswd;
53
54     private String executionEndPoint;
55
56     private String executionModule;
57
58     private String executionRPC;
59
60     @JsonProperty("state")
61     private String state;
62
63     @JsonProperty("precheck")
64     private PreCheck precheck;
65
66     @JsonProperty("payload")
67     private String payload ;
68
69     @JsonProperty("responses")
70     private List<Response> responses ;
71
72
73     private String status = "PENDING";
74
75     public String getuId() {
76         return uId;
77     }
78
79     public void setuId(String uId) {
80         this.uId = uId;
81     }
82
83     public String getPswd() {
84         return pswd;
85     }
86
87     public void setPswd(String pswd) {
88         this.pswd = pswd;
89     }
90
91     public String getExecutionEndPoint() {
92         return executionEndPoint;
93     }
94
95     public void setExecutionEndPoint(String executionEndPoint) {
96         this.executionEndPoint = executionEndPoint;
97     }
98
99
100     public String getExecutionType() {
101         return executionType;
102     }
103
104     public void setExecutionType(String executionType) {
105         this.executionType = executionType;
106     }
107
108     public String getExecutionModule() {
109         return executionModule;
110     }
111
112
113     public void setExecutionModule(String executionModule) {
114         this.executionModule = executionModule;
115     }
116
117
118     public String getExecutionRPC() {
119         return executionRPC;
120     }
121
122
123     public void setExecutionRPC(String executionRPC) {
124         this.executionRPC = executionRPC;
125     }
126
127
128     public List<Parameters> getParameters() {
129         return parameters;
130     }
131
132
133     public void setParameters(List<Parameters> parameters) {
134         this.parameters = parameters;
135     }
136
137     public String getState() {
138         return state;
139     }
140
141     public void setState(String state) {
142         this.state = state;
143     }
144
145     public PreCheck getPrecheck() {
146         return precheck;
147     }
148
149     public void setPrecheck(PreCheck precheck) {
150         this.precheck = precheck;
151     }
152
153     public String getStatus() {
154         return status;
155     }
156
157
158     public void setStatus(String status) {
159         this.status = status;
160     }
161
162     public List<Response> getResponses() {
163         return responses;
164     }
165
166
167     public void setResponses(List<Response> responses) {
168         this.responses = responses;
169     }
170
171     public int getTransactionId() {
172         return transactionId;
173     }
174
175
176     public void setTransactionId(int transactionId) {
177         this.transactionId = transactionId;
178     }
179
180
181     public String getAction() {
182         return action;
183     }
184
185
186     public void setAction(String action) {
187         this.action = action;
188     }
189
190
191     public String getActionLevel() {
192         return actionLevel;
193     }
194
195
196     public void setActionLevel(String actionLevel) {
197         this.actionLevel = actionLevel;
198     }
199
200
201
202     public String getPayload() {
203         return payload;
204     }
205
206
207     public void setPayload(String payload) {
208         this.payload = payload;
209     }
210
211
212     public ActionIdentifier getActionIdentifier() {
213         return actionIdentifier;
214     }
215
216
217     public void setActionIdentifier(ActionIdentifier actionIdentifier) {
218         this.actionIdentifier = actionIdentifier;
219     }
220
221     public String getStatusCode() {
222         return statusCode;
223     }
224
225     public void setStatusCode(String statusCode) {
226         this.statusCode = statusCode;
227     }
228
229     @Override
230     public String toString() {
231         return "Transaction [transactionId=" + transactionId + ", action=" + action + ", actionLevel=" + actionLevel
232                 + ", actionIdentifier=" + actionIdentifier + ", parameters=" + parameters + ", executionType="
233                 + executionType + ", uId=" + uId + ", statusCode=" + statusCode + ", pswd=" + pswd
234                 + ", executionEndPoint=" + executionEndPoint + ", executionModule=" + executionModule
235                 + ", executionRPC=" + executionRPC + ", state=" + state + ", precheck=" + precheck + ", payload="
236                 + payload + ", responses=" + responses + ", status=" + status + "]";
237     }
238
239     @Override
240     public int hashCode() {
241         final int prime = 31;
242         int result = 1;
243         result = prime * result + ((action == null) ? 0 : action.hashCode());
244         result = prime * result + ((actionIdentifier == null) ? 0 : actionIdentifier.hashCode());
245         result = prime * result + ((actionLevel == null) ? 0 : actionLevel.hashCode());
246         result = prime * result + ((executionEndPoint == null) ? 0 : executionEndPoint.hashCode());
247         result = prime * result + ((executionModule == null) ? 0 : executionModule.hashCode());
248         result = prime * result + ((executionRPC == null) ? 0 : executionRPC.hashCode());
249         result = prime * result + ((executionType == null) ? 0 : executionType.hashCode());
250         result = prime * result + ((parameters == null) ? 0 : parameters.hashCode());
251         result = prime * result + ((payload == null) ? 0 : payload.hashCode());
252         result = prime * result + ((precheck == null) ? 0 : precheck.hashCode());
253         result = prime * result + ((pswd == null) ? 0 : pswd.hashCode());
254         result = prime * result + ((responses == null) ? 0 : responses.hashCode());
255         result = prime * result + ((state == null) ? 0 : state.hashCode());
256         result = prime * result + ((status == null) ? 0 : status.hashCode());
257         result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
258         result = prime * result + transactionId;
259         result = prime * result + ((uId == null) ? 0 : uId.hashCode());
260         return result;
261     }
262
263     @Override
264     public boolean equals(Object obj) {
265         if (this == obj)
266             return true;
267         if (obj == null)
268             return false;
269         if (getClass() != obj.getClass())
270             return false;
271         Transaction other = (Transaction) obj;
272         if (action == null) {
273             if (other.action != null)
274                 return false;
275         } else if (!action.equals(other.action))
276             return false;
277         if (actionIdentifier == null) {
278             if (other.actionIdentifier != null)
279                 return false;
280         } else if (!actionIdentifier.equals(other.actionIdentifier))
281             return false;
282         if (actionLevel == null) {
283             if (other.actionLevel != null)
284                 return false;
285         } else if (!actionLevel.equals(other.actionLevel))
286             return false;
287         if (executionEndPoint == null) {
288             if (other.executionEndPoint != null)
289                 return false;
290         } else if (!executionEndPoint.equals(other.executionEndPoint))
291             return false;
292         if (executionModule == null) {
293             if (other.executionModule != null)
294                 return false;
295         } else if (!executionModule.equals(other.executionModule))
296             return false;
297         if (executionRPC == null) {
298             if (other.executionRPC != null)
299                 return false;
300         } else if (!executionRPC.equals(other.executionRPC))
301             return false;
302         if (executionType == null) {
303             if (other.executionType != null)
304                 return false;
305         } else if (!executionType.equals(other.executionType))
306             return false;
307         if (parameters == null) {
308             if (other.parameters != null)
309                 return false;
310         } else if (!parameters.equals(other.parameters))
311             return false;
312         if (payload == null) {
313             if (other.payload != null)
314                 return false;
315         } else if (!payload.equals(other.payload))
316             return false;
317         if (precheck == null) {
318             if (other.precheck != null)
319                 return false;
320         } else if (!precheck.equals(other.precheck))
321             return false;
322         if (pswd == null) {
323             if (other.pswd != null)
324                 return false;
325         } else if (!pswd.equals(other.pswd))
326             return false;
327         if (responses == null) {
328             if (other.responses != null)
329                 return false;
330         } else if (!responses.equals(other.responses))
331             return false;
332         if (state == null) {
333             if (other.state != null)
334                 return false;
335         } else if (!state.equals(other.state))
336             return false;
337         if (status == null) {
338             if (other.status != null)
339                 return false;
340         } else if (!status.equals(other.status))
341             return false;
342         if (statusCode == null) {
343             if (other.statusCode != null)
344                 return false;
345         } else if (!statusCode.equals(other.statusCode))
346             return false;
347         if (transactionId != other.transactionId)
348             return false;
349         if (uId == null) {
350             if (other.uId != null)
351                 return false;
352         } else if (!uId.equals(other.uId))
353             return false;
354         return true;
355     }
356 }