001package ca.cdr.api.model.json; 002 003/* 004 * #%L 005 * Smile CDR - CDR 006 * %% 007 * Copyright (C) 2016 - 2025 Smile CDR, Inc. 008 * %% 009 * All rights reserved. 010 * #L% 011 */ 012 013import ca.cdr.api.model.enm.TransactionLogEventSubTypeEnum; 014import ca.cdr.api.model.enm.TransactionLogEventTypeEnum; 015import ca.cdr.api.model.enm.TransactionLogOutcomeEnum; 016import com.fasterxml.jackson.annotation.JsonProperty; 017import com.fasterxml.jackson.annotation.JsonPropertyOrder; 018import com.fasterxml.jackson.annotation.JsonRawValue; 019import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 020import com.fasterxml.jackson.databind.annotation.JsonSerialize; 021 022import java.sql.Timestamp; 023import java.util.ArrayList; 024import java.util.Date; 025import java.util.List; 026 027@JsonPropertyOrder({"from", "to", "pageIndex", "pageSize", "events"}) 028public class TransactionLogEventsJson implements IModelJson { 029 030 @JsonProperty("events") 031 private List<TransactionLogEventJson> myEvents; 032 033 @JsonProperty("from") 034 @JsonSerialize(using = JsonDateSerializer.class) 035 @JsonDeserialize(using = JsonDateDeserializer.class) 036 private Date myFrom; 037 038 @JsonProperty("pageSize") 039 private int myPageSize; 040 041 @JsonProperty("to") 042 @JsonSerialize(using = JsonDateSerializer.class) 043 @JsonDeserialize(using = JsonDateDeserializer.class) 044 private Date myTo; 045 046 @JsonProperty("pageIndex") 047 private int myPageIndex; 048 049 public List<TransactionLogEventJson> getEvents() { 050 if (myEvents == null) { 051 myEvents = new ArrayList<>(); 052 } 053 return myEvents; 054 } 055 056 public Date getFrom() { 057 return myFrom; 058 } 059 060 public void setFrom(Date theFrom) { 061 myFrom = theFrom; 062 } 063 064 public int getPageSize() { 065 return myPageSize; 066 } 067 068 public void setPageSize(int thePageSize) { 069 myPageSize = thePageSize; 070 } 071 072 public Date getTo() { 073 return myTo; 074 } 075 076 public void setTo(Date theTo) { 077 myTo = theTo; 078 } 079 080 public int getPageIndex() { 081 return myPageIndex; 082 } 083 084 public void setPageIndex(int thePageIndex) { 085 myPageIndex = thePageIndex; 086 } 087 088 @JsonPropertyOrder({ 089 "id", 090 "initialTimestamp", 091 "type", 092 "subType", 093 "outcome", 094 "endpointNodeId", 095 "endpointModuleId", 096 "processingTime", 097 "endpointLocalHost", 098 "endpointLocalPort", 099 "endpointRemoteHost", 100 "endpointRemotePort", 101 "requestId", 102 "events", 103 "additionalJson" 104 }) 105 public static class TransactionLogEventJson implements IModelJson { 106 107 @JsonProperty("endpointLocalHost") 108 private String myEndpointLocalHost; 109 110 @JsonProperty("endpointLocalPort") 111 private Integer myEndpointLocalPort; 112 113 @JsonProperty("endpointModuleId") 114 private String myEndpointModuleId; 115 116 @JsonProperty("endpointNodeId") 117 private String myEndpointNodeId; 118 119 @JsonProperty("endpointRemoteHost") 120 private String myEndpointRemoteHost; 121 122 @JsonProperty("endpointRemotePort") 123 private Integer myEndpointRemotePort; 124 125 @JsonProperty("events") 126 private List<TransactionLogStepJson> myEvents_; 127 128 @JsonProperty("id") 129 private Long myId; 130 131 @JsonProperty("initialTimestamp") 132 @JsonSerialize(using = JsonDateSerializer.class) 133 @JsonDeserialize(using = JsonDateDeserializer.class) 134 private Date myInitialTimestamp; 135 136 @JsonProperty("outcome") 137 private TransactionLogOutcomeEnum myOutcome; 138 139 @JsonProperty("processingTime") 140 private long myProcessingTime; 141 142 @JsonProperty("subType") 143 private TransactionLogEventSubTypeEnum mySubType; 144 145 @JsonProperty("type") 146 private TransactionLogEventTypeEnum myType; 147 148 @JsonProperty("requestId") 149 private String myRequestId; 150 151 private Long myUserId; 152 153 @JsonProperty("userModuleId") 154 private String myUserModuleId; 155 156 @JsonProperty("userNodeId") 157 private String myUserNodeId; 158 159 @JsonProperty("userName") 160 private String username; 161 162 @JsonProperty("userFamilyName") 163 private String myUserFamilyName; 164 165 @JsonProperty("userGivenName") 166 private String myUserGivenName; 167 168 @JsonProperty("clientId") 169 private String myClientId; 170 171 @JsonProperty("clientNodeId") 172 private String myClientNodeId; 173 174 @JsonProperty("clientModuleId") 175 private String myClientModuleId; 176 177 private Long myClientPid; 178 179 @JsonProperty("clientName") 180 private String myClientName; 181 182 @JsonProperty("transactionGuid") 183 private String myTransactionGuid; 184 185 @JsonDeserialize(using = RawJsonDeserializer.class) 186 @JsonRawValue 187 @JsonProperty("additionalJson") 188 private String myAdditionalJson; 189 190 public String getEndpointLocalHost() { 191 return myEndpointLocalHost; 192 } 193 194 public void setEndpointLocalHost(String theEndpointLocalHost) { 195 myEndpointLocalHost = theEndpointLocalHost; 196 } 197 198 public Integer getEndpointLocalPort() { 199 return myEndpointLocalPort; 200 } 201 202 public void setEndpointLocalPort(Integer theEndpointLocalPort) { 203 myEndpointLocalPort = theEndpointLocalPort; 204 } 205 206 public String getEndpointModuleId() { 207 return myEndpointModuleId; 208 } 209 210 public void setEndpointModuleId(String theEntpointId) { 211 myEndpointModuleId = theEntpointId; 212 } 213 214 public String getEndpointNodeId() { 215 return myEndpointNodeId; 216 } 217 218 public void setEndpointNodeId(String theNodeId) { 219 myEndpointNodeId = theNodeId; 220 } 221 222 public String getEndpointRemoteHost() { 223 return myEndpointRemoteHost; 224 } 225 226 public void setEndpointRemoteHost(String theEndpointRemoteHost) { 227 myEndpointRemoteHost = theEndpointRemoteHost; 228 } 229 230 public Integer getEndpointRemotePort() { 231 return myEndpointRemotePort; 232 } 233 234 public void setEndpointRemotePort(Integer theEndpointRemotePort) { 235 myEndpointRemotePort = theEndpointRemotePort; 236 } 237 238 public List<TransactionLogStepJson> getEvents() { 239 if (myEvents_ == null) { 240 myEvents_ = new ArrayList<>(); 241 } 242 return myEvents_; 243 } 244 245 public Long getId() { 246 return myId; 247 } 248 249 public void setId(Long thePid) { 250 myId = thePid; 251 } 252 253 public Date getInitialTimestamp() { 254 return myInitialTimestamp; 255 } 256 257 public void setInitialTimestamp(Date theTimestamp) { 258 myInitialTimestamp = theTimestamp; 259 if (myInitialTimestamp instanceof Timestamp) { 260 myInitialTimestamp = new Date(myInitialTimestamp.getTime()); 261 } 262 } 263 264 public TransactionLogOutcomeEnum getOutcome() { 265 return myOutcome; 266 } 267 268 public void setOutcome(TransactionLogOutcomeEnum theOutcome) { 269 myOutcome = theOutcome; 270 } 271 272 public long getProcessingTime() { 273 return myProcessingTime; 274 } 275 276 public void setProcessingTime(long theProcessingTime) { 277 myProcessingTime = theProcessingTime; 278 } 279 280 public TransactionLogEventSubTypeEnum getSubType() { 281 return mySubType; 282 } 283 284 public void setSubType(TransactionLogEventSubTypeEnum theSubType) { 285 mySubType = theSubType; 286 } 287 288 public TransactionLogEventTypeEnum getType() { 289 return myType; 290 } 291 292 public void setType(TransactionLogEventTypeEnum theTransactionLogEventTypeEnum) { 293 myType = theTransactionLogEventTypeEnum; 294 } 295 296 public String getRequestId() { 297 return myRequestId; 298 } 299 300 public void setRequestId(String theRequestId) { 301 myRequestId = theRequestId; 302 } 303 304 public Long getUserId() { 305 return myUserId; 306 } 307 308 public void setUserId(Long userId) { 309 this.myUserId = userId; 310 } 311 312 public String getUserModuleId() { 313 return myUserModuleId; 314 } 315 316 public void setUserModuleId(String userModuleId) { 317 this.myUserModuleId = userModuleId; 318 } 319 320 public String getUserNodeId() { 321 return myUserNodeId; 322 } 323 324 public void setUserNodeId(String userNodeId) { 325 this.myUserNodeId = userNodeId; 326 } 327 328 public String getUsername() { 329 return username; 330 } 331 332 public void setUsername(String username) { 333 this.username = username; 334 } 335 336 public String getUserFamilyName() { 337 return myUserFamilyName; 338 } 339 340 public void setUserFamilyName(String userFamilyName) { 341 this.myUserFamilyName = userFamilyName; 342 } 343 344 public String getUserGivenName() { 345 return myUserGivenName; 346 } 347 348 public void setUserGivenName(String userGivenName) { 349 this.myUserGivenName = userGivenName; 350 } 351 352 public String getClientId() { 353 return myClientId; 354 } 355 356 public void setClientId(String clientId) { 357 this.myClientId = clientId; 358 } 359 360 public String getClientModuleId() { 361 return myClientModuleId; 362 } 363 364 public void setClientModuleId(String clientModuleId) { 365 this.myClientModuleId = clientModuleId; 366 } 367 368 public String getClientNodeId() { 369 return myClientNodeId; 370 } 371 372 public void setClientNodeId(String clientNodeId) { 373 this.myClientNodeId = clientNodeId; 374 } 375 376 public Long getClientPid() { 377 return myClientPid; 378 } 379 380 public void setClientPid(Long clientPid) { 381 this.myClientPid = clientPid; 382 } 383 384 public String getClientName() { 385 return myClientName; 386 } 387 388 public void setClientName(String clientName) { 389 this.myClientName = clientName; 390 } 391 392 public String getTransactionGuid() { 393 return myTransactionGuid; 394 } 395 396 public void setTransactionGuid(String theTransactionGuid) { 397 myTransactionGuid = theTransactionGuid; 398 } 399 400 public String getAdditionalJson() { 401 return myAdditionalJson; 402 } 403 404 public void setAdditionalJson(String theAdditionalJson) { 405 this.myAdditionalJson = theAdditionalJson; 406 } 407 } 408}