Second part of onap rename
[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 : APP-C
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.appc.flow.controller.data;
22
23 import java.io.File;
24 import java.io.IOException;
25 import java.util.ArrayList;
26 import java.util.List;
27
28 import com.fasterxml.jackson.annotation.JsonProperty;
29 import com.fasterxml.jackson.core.JsonGenerationException;
30 import com.fasterxml.jackson.databind.JsonMappingException;
31 import com.fasterxml.jackson.databind.ObjectMapper;
32
33 public class Transaction {
34
35     @JsonProperty("transaction-id")
36     private int transactionId ;
37
38     @JsonProperty("action")
39     private String action ;
40
41     @JsonProperty("action-level")
42     private String actionLevel ;
43
44     @JsonProperty("action-identifier")
45     private ActionIdentifier actionIdentifier ;
46     
47     @JsonProperty("parameters")
48     private List<Parameters> parameters ;
49
50     private String executionType;
51     
52     private String uId;
53     
54     private String statusCode;
55
56     private String pswd;
57     
58     private String executionEndPoint;
59     
60     private String executionModule;
61     
62     private String executionRPC;
63     
64     @JsonProperty("state")
65     private String state;
66     
67     @JsonProperty("precheck")
68     private PreCheck precheck;
69
70     @JsonProperty("payload")
71     private String payload ;
72
73     @JsonProperty("responses")
74     private List<Response> responses ;
75     
76     
77     private String status = "PENDING";
78     
79     public String getuId() {
80         return uId;
81     }
82
83     public void setuId(String uId) {
84         this.uId = uId;
85     }
86
87     public String getPswd() {
88         return pswd;
89     }
90
91     public void setPswd(String pswd) {
92         this.pswd = pswd;
93     }
94     
95     public String getExecutionEndPoint() {
96         return executionEndPoint;
97     }
98
99     public void setExecutionEndPoint(String executionEndPoint) {
100         this.executionEndPoint = executionEndPoint;
101     }
102
103
104     public String getExecutionType() {
105         return executionType;
106     }
107
108     public void setExecutionType(String executionType) {
109         this.executionType = executionType;
110     }
111
112     public String getExecutionModule() {
113         return executionModule;
114     }
115
116
117     public void setExecutionModule(String executionModule) {
118         this.executionModule = executionModule;
119     }
120
121
122     public String getExecutionRPC() {
123         return executionRPC;
124     }
125
126
127     public void setExecutionRPC(String executionRPC) {
128         this.executionRPC = executionRPC;
129     }
130
131
132     public List<Parameters> getParameters() {
133         return parameters;
134     }
135
136
137     public void setParameters(List<Parameters> parameters) {
138         this.parameters = parameters;
139     }
140     
141     public String getState() {
142         return state;
143     }
144
145     public void setState(String state) {
146         this.state = state;
147     }
148
149     public PreCheck getPrecheck() {
150         return precheck;
151     }
152
153     public void setPrecheck(PreCheck precheck) {
154         this.precheck = precheck;
155     }
156
157     public String getStatus() {
158         return status;
159     }
160
161
162     public void setStatus(String status) {
163         this.status = status;
164     }
165
166     public List<Response> getResponses() {
167         return responses;
168     }
169
170
171     public void setResponses(List<Response> responses) {
172         this.responses = responses;
173     }
174
175     public int getTransactionId() {
176         return transactionId;
177     }
178
179
180     public void setTransactionId(int transactionId) {
181         this.transactionId = transactionId;
182     }
183
184
185     public String getAction() {
186         return action;
187     }
188
189
190     public void setAction(String action) {
191         this.action = action;
192     }
193
194
195     public String getActionLevel() {
196         return actionLevel;
197     }
198
199
200     public void setActionLevel(String actionLevel) {
201         this.actionLevel = actionLevel;
202     }
203
204
205
206     public String getPayload() {
207         return payload;
208     }
209
210
211     public void setPayload(String payload) {
212         this.payload = payload;
213     }
214
215
216     public ActionIdentifier getActionIdentifier() {
217         return actionIdentifier;
218     }
219
220
221     public void setActionIdentifier(ActionIdentifier actionIdentifier) {
222         this.actionIdentifier = actionIdentifier;
223     }
224     
225     public String getStatusCode() {
226         return statusCode;
227     }
228
229     public void setStatusCode(String statusCode) {
230         this.statusCode = statusCode;
231     }
232
233     @Override
234     public String toString() {
235         return "Transaction [transactionId=" + transactionId + ", action=" + action + ", actionLevel=" + actionLevel
236                 + ", actionIdentifier=" + actionIdentifier + ", parameters=" + parameters + ", executionType="
237                 + executionType + ", uId=" + uId + ", statusCode=" + statusCode + ", pswd=" + pswd
238                 + ", executionEndPoint=" + executionEndPoint + ", executionModule=" + executionModule
239                 + ", executionRPC=" + executionRPC + ", state=" + state + ", precheck=" + precheck + ", payload="
240                 + payload + ", responses=" + responses + ", status=" + status + "]";
241     }
242
243     @Override
244     public int hashCode() {
245         final int prime = 31;
246         int result = 1;
247         result = prime * result + ((action == null) ? 0 : action.hashCode());
248         result = prime * result + ((actionIdentifier == null) ? 0 : actionIdentifier.hashCode());
249         result = prime * result + ((actionLevel == null) ? 0 : actionLevel.hashCode());
250         result = prime * result + ((executionEndPoint == null) ? 0 : executionEndPoint.hashCode());
251         result = prime * result + ((executionModule == null) ? 0 : executionModule.hashCode());
252         result = prime * result + ((executionRPC == null) ? 0 : executionRPC.hashCode());
253         result = prime * result + ((executionType == null) ? 0 : executionType.hashCode());
254         result = prime * result + ((parameters == null) ? 0 : parameters.hashCode());
255         result = prime * result + ((payload == null) ? 0 : payload.hashCode());
256         result = prime * result + ((precheck == null) ? 0 : precheck.hashCode());
257         result = prime * result + ((pswd == null) ? 0 : pswd.hashCode());
258         result = prime * result + ((responses == null) ? 0 : responses.hashCode());
259         result = prime * result + ((state == null) ? 0 : state.hashCode());
260         result = prime * result + ((status == null) ? 0 : status.hashCode());
261         result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
262         result = prime * result + transactionId;
263         result = prime * result + ((uId == null) ? 0 : uId.hashCode());
264         return result;
265     }
266
267     @Override
268     public boolean equals(Object obj) {
269         if (this == obj)
270             return true;
271         if (obj == null)
272             return false;
273         if (getClass() != obj.getClass())
274             return false;
275         Transaction other = (Transaction) obj;
276         if (action == null) {
277             if (other.action != null)
278                 return false;
279         } else if (!action.equals(other.action))
280             return false;
281         if (actionIdentifier == null) {
282             if (other.actionIdentifier != null)
283                 return false;
284         } else if (!actionIdentifier.equals(other.actionIdentifier))
285             return false;
286         if (actionLevel == null) {
287             if (other.actionLevel != null)
288                 return false;
289         } else if (!actionLevel.equals(other.actionLevel))
290             return false;
291         if (executionEndPoint == null) {
292             if (other.executionEndPoint != null)
293                 return false;
294         } else if (!executionEndPoint.equals(other.executionEndPoint))
295             return false;
296         if (executionModule == null) {
297             if (other.executionModule != null)
298                 return false;
299         } else if (!executionModule.equals(other.executionModule))
300             return false;
301         if (executionRPC == null) {
302             if (other.executionRPC != null)
303                 return false;
304         } else if (!executionRPC.equals(other.executionRPC))
305             return false;
306         if (executionType == null) {
307             if (other.executionType != null)
308                 return false;
309         } else if (!executionType.equals(other.executionType))
310             return false;
311         if (parameters == null) {
312             if (other.parameters != null)
313                 return false;
314         } else if (!parameters.equals(other.parameters))
315             return false;
316         if (payload == null) {
317             if (other.payload != null)
318                 return false;
319         } else if (!payload.equals(other.payload))
320             return false;
321         if (precheck == null) {
322             if (other.precheck != null)
323                 return false;
324         } else if (!precheck.equals(other.precheck))
325             return false;
326         if (pswd == null) {
327             if (other.pswd != null)
328                 return false;
329         } else if (!pswd.equals(other.pswd))
330             return false;
331         if (responses == null) {
332             if (other.responses != null)
333                 return false;
334         } else if (!responses.equals(other.responses))
335             return false;
336         if (state == null) {
337             if (other.state != null)
338                 return false;
339         } else if (!state.equals(other.state))
340             return false;
341         if (status == null) {
342             if (other.status != null)
343                 return false;
344         } else if (!status.equals(other.status))
345             return false;
346         if (statusCode == null) {
347             if (other.statusCode != null)
348                 return false;
349         } else if (!statusCode.equals(other.statusCode))
350             return false;
351         if (transactionId != other.transactionId)
352             return false;
353         if (uId == null) {
354             if (other.uId != null)
355                 return false;
356         } else if (!uId.equals(other.uId))
357             return false;
358         return true;
359     }
360
361
362 }
363
364
365