2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.appc.flow.controller.data;
24 import java.io.IOException;
25 import java.util.ArrayList;
26 import java.util.List;
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;
33 public class Transaction {
35 @JsonProperty("transaction-id")
36 private int transactionId ;
38 @JsonProperty("action")
39 private String action ;
41 @JsonProperty("action-level")
42 private String actionLevel ;
44 @JsonProperty("action-identifier")
45 private ActionIdentifier actionIdentifier ;
47 @JsonProperty("parameters")
48 private List<Parameters> parameters ;
50 private String executionType;
54 private String statusCode;
58 private String executionEndPoint;
60 private String executionModule;
62 private String executionRPC;
64 @JsonProperty("state")
67 @JsonProperty("precheck")
68 private PreCheck precheck;
70 @JsonProperty("payload")
71 private String payload ;
73 @JsonProperty("responses")
74 private List<Response> responses ;
77 private String status = "PENDING";
79 public String getuId() {
83 public void setuId(String uId) {
87 public String getPswd() {
91 public void setPswd(String pswd) {
95 public String getExecutionEndPoint() {
96 return executionEndPoint;
99 public void setExecutionEndPoint(String executionEndPoint) {
100 this.executionEndPoint = executionEndPoint;
104 public String getExecutionType() {
105 return executionType;
108 public void setExecutionType(String executionType) {
109 this.executionType = executionType;
112 public String getExecutionModule() {
113 return executionModule;
117 public void setExecutionModule(String executionModule) {
118 this.executionModule = executionModule;
122 public String getExecutionRPC() {
127 public void setExecutionRPC(String executionRPC) {
128 this.executionRPC = executionRPC;
132 public List<Parameters> getParameters() {
137 public void setParameters(List<Parameters> parameters) {
138 this.parameters = parameters;
141 public String getState() {
145 public void setState(String state) {
149 public PreCheck getPrecheck() {
153 public void setPrecheck(PreCheck precheck) {
154 this.precheck = precheck;
157 public String getStatus() {
162 public void setStatus(String status) {
163 this.status = status;
166 public List<Response> getResponses() {
171 public void setResponses(List<Response> responses) {
172 this.responses = responses;
175 public int getTransactionId() {
176 return transactionId;
180 public void setTransactionId(int transactionId) {
181 this.transactionId = transactionId;
185 public String getAction() {
190 public void setAction(String action) {
191 this.action = action;
195 public String getActionLevel() {
200 public void setActionLevel(String actionLevel) {
201 this.actionLevel = actionLevel;
206 public String getPayload() {
211 public void setPayload(String payload) {
212 this.payload = payload;
216 public ActionIdentifier getActionIdentifier() {
217 return actionIdentifier;
221 public void setActionIdentifier(ActionIdentifier actionIdentifier) {
222 this.actionIdentifier = actionIdentifier;
225 public String getStatusCode() {
229 public void setStatusCode(String statusCode) {
230 this.statusCode = statusCode;
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 + "]";
244 public int hashCode() {
245 final int prime = 31;
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());
268 public boolean equals(Object obj) {
273 if (getClass() != obj.getClass())
275 Transaction other = (Transaction) obj;
276 if (action == null) {
277 if (other.action != null)
279 } else if (!action.equals(other.action))
281 if (actionIdentifier == null) {
282 if (other.actionIdentifier != null)
284 } else if (!actionIdentifier.equals(other.actionIdentifier))
286 if (actionLevel == null) {
287 if (other.actionLevel != null)
289 } else if (!actionLevel.equals(other.actionLevel))
291 if (executionEndPoint == null) {
292 if (other.executionEndPoint != null)
294 } else if (!executionEndPoint.equals(other.executionEndPoint))
296 if (executionModule == null) {
297 if (other.executionModule != null)
299 } else if (!executionModule.equals(other.executionModule))
301 if (executionRPC == null) {
302 if (other.executionRPC != null)
304 } else if (!executionRPC.equals(other.executionRPC))
306 if (executionType == null) {
307 if (other.executionType != null)
309 } else if (!executionType.equals(other.executionType))
311 if (parameters == null) {
312 if (other.parameters != null)
314 } else if (!parameters.equals(other.parameters))
316 if (payload == null) {
317 if (other.payload != null)
319 } else if (!payload.equals(other.payload))
321 if (precheck == null) {
322 if (other.precheck != null)
324 } else if (!precheck.equals(other.precheck))
327 if (other.pswd != null)
329 } else if (!pswd.equals(other.pswd))
331 if (responses == null) {
332 if (other.responses != null)
334 } else if (!responses.equals(other.responses))
337 if (other.state != null)
339 } else if (!state.equals(other.state))
341 if (status == null) {
342 if (other.status != null)
344 } else if (!status.equals(other.status))
346 if (statusCode == null) {
347 if (other.statusCode != null)
349 } else if (!statusCode.equals(other.statusCode))
351 if (transactionId != other.transactionId)
354 if (other.uId != null)
356 } else if (!uId.equals(other.uId))