2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-18 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.
19 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
20 * ============LICENSE_END=========================================================
23 package org.onap.appc.flow.controller.data;
25 import java.io.IOException;
26 import java.util.ArrayList;
27 import java.util.List;
29 import com.fasterxml.jackson.annotation.JsonProperty;
30 import com.fasterxml.jackson.core.JsonGenerationException;
31 import com.fasterxml.jackson.databind.JsonMappingException;
32 import com.fasterxml.jackson.databind.ObjectMapper;
34 public class Transaction {
36 @JsonProperty("transaction-id")
37 private int transactionId ;
39 @JsonProperty("action")
40 private String action ;
42 @JsonProperty("action-level")
43 private String actionLevel ;
45 @JsonProperty("action-identifier")
46 private ActionIdentifier actionIdentifier ;
48 @JsonProperty("parameters")
49 private List<Parameters> parameters ;
51 private String executionType;
55 private String statusCode;
59 private String executionEndPoint;
61 private String executionModule;
63 private String executionRPC;
65 @JsonProperty("state")
68 @JsonProperty("precheck")
69 private PreCheck precheck;
71 @JsonProperty("payload")
72 private String payload ;
74 @JsonProperty("responses")
75 private List<Response> responses ;
78 private String status = "PENDING";
80 public String getuId() {
84 public void setuId(String uId) {
88 public String getPswd() {
92 public void setPswd(String pswd) {
96 public String getExecutionEndPoint() {
97 return executionEndPoint;
100 public void setExecutionEndPoint(String executionEndPoint) {
101 this.executionEndPoint = executionEndPoint;
105 public String getExecutionType() {
106 return executionType;
109 public void setExecutionType(String executionType) {
110 this.executionType = executionType;
113 public String getExecutionModule() {
114 return executionModule;
118 public void setExecutionModule(String executionModule) {
119 this.executionModule = executionModule;
123 public String getExecutionRPC() {
128 public void setExecutionRPC(String executionRPC) {
129 this.executionRPC = executionRPC;
133 public List<Parameters> getParameters() {
138 public void setParameters(List<Parameters> parameters) {
139 this.parameters = parameters;
142 public String getState() {
146 public void setState(String state) {
150 public PreCheck getPrecheck() {
154 public void setPrecheck(PreCheck precheck) {
155 this.precheck = precheck;
158 public String getStatus() {
163 public void setStatus(String status) {
164 this.status = status;
167 public List<Response> getResponses() {
172 public void setResponses(List<Response> responses) {
173 this.responses = responses;
176 public int getTransactionId() {
177 return transactionId;
181 public void setTransactionId(int transactionId) {
182 this.transactionId = transactionId;
186 public String getAction() {
191 public void setAction(String action) {
192 this.action = action;
196 public String getActionLevel() {
201 public void setActionLevel(String actionLevel) {
202 this.actionLevel = actionLevel;
207 public String getPayload() {
212 public void setPayload(String payload) {
213 this.payload = payload;
217 public ActionIdentifier getActionIdentifier() {
218 return actionIdentifier;
222 public void setActionIdentifier(ActionIdentifier actionIdentifier) {
223 this.actionIdentifier = actionIdentifier;
226 public String getStatusCode() {
230 public void setStatusCode(String statusCode) {
231 this.statusCode = statusCode;
235 public String toString() {
236 return "Transaction [transactionId=" + transactionId + ", action=" + action + ", actionLevel=" + actionLevel
237 + ", actionIdentifier=" + actionIdentifier + ", parameters=" + parameters + ", executionType="
238 + executionType + ", uId=" + uId + ", statusCode=" + statusCode + ", pswd=" + pswd
239 + ", executionEndPoint=" + executionEndPoint + ", executionModule=" + executionModule
240 + ", executionRPC=" + executionRPC + ", state=" + state + ", precheck=" + precheck + ", payload="
241 + payload + ", responses=" + responses + ", status=" + status + "]";
245 public int hashCode() {
246 final int prime = 31;
248 result = prime * result + ((action == null) ? 0 : action.hashCode());
249 result = prime * result + ((actionIdentifier == null) ? 0 : actionIdentifier.hashCode());
250 result = prime * result + ((actionLevel == null) ? 0 : actionLevel.hashCode());
251 result = prime * result + ((executionEndPoint == null) ? 0 : executionEndPoint.hashCode());
252 result = prime * result + ((executionModule == null) ? 0 : executionModule.hashCode());
253 result = prime * result + ((executionRPC == null) ? 0 : executionRPC.hashCode());
254 result = prime * result + ((executionType == null) ? 0 : executionType.hashCode());
255 result = prime * result + ((parameters == null) ? 0 : parameters.hashCode());
256 result = prime * result + ((payload == null) ? 0 : payload.hashCode());
257 result = prime * result + ((precheck == null) ? 0 : precheck.hashCode());
258 result = prime * result + ((pswd == null) ? 0 : pswd.hashCode());
259 result = prime * result + ((responses == null) ? 0 : responses.hashCode());
260 result = prime * result + ((state == null) ? 0 : state.hashCode());
261 result = prime * result + ((status == null) ? 0 : status.hashCode());
262 result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
263 result = prime * result + transactionId;
264 result = prime * result + ((uId == null) ? 0 : uId.hashCode());
269 public boolean equals(Object obj) {
274 if (getClass() != obj.getClass())
276 Transaction other = (Transaction) obj;
277 if (action == null) {
278 if (other.action != null)
280 } else if (!action.equals(other.action))
282 if (actionIdentifier == null) {
283 if (other.actionIdentifier != null)
285 } else if (!actionIdentifier.equals(other.actionIdentifier))
287 if (actionLevel == null) {
288 if (other.actionLevel != null)
290 } else if (!actionLevel.equals(other.actionLevel))
292 if (executionEndPoint == null) {
293 if (other.executionEndPoint != null)
295 } else if (!executionEndPoint.equals(other.executionEndPoint))
297 if (executionModule == null) {
298 if (other.executionModule != null)
300 } else if (!executionModule.equals(other.executionModule))
302 if (executionRPC == null) {
303 if (other.executionRPC != null)
305 } else if (!executionRPC.equals(other.executionRPC))
307 if (executionType == null) {
308 if (other.executionType != null)
310 } else if (!executionType.equals(other.executionType))
312 if (parameters == null) {
313 if (other.parameters != null)
315 } else if (!parameters.equals(other.parameters))
317 if (payload == null) {
318 if (other.payload != null)
320 } else if (!payload.equals(other.payload))
322 if (precheck == null) {
323 if (other.precheck != null)
325 } else if (!precheck.equals(other.precheck))
328 if (other.pswd != null)
330 } else if (!pswd.equals(other.pswd))
332 if (responses == null) {
333 if (other.responses != null)
335 } else if (!responses.equals(other.responses))
338 if (other.state != null)
340 } else if (!state.equals(other.state))
342 if (status == null) {
343 if (other.status != null)
345 } else if (!status.equals(other.status))
347 if (statusCode == null) {
348 if (other.statusCode != null)
350 } else if (!statusCode.equals(other.statusCode))
352 if (transactionId != other.transactionId)
355 if (other.uId != null)
357 } else if (!uId.equals(other.uId))