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