001package ca.cdr.api.model.json;
002
003/*
004 * #%L
005 * Smile CDR - CDR
006 * %%
007 * Copyright (C) 2016 - 2024 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                @JsonRawValue
186                @JsonProperty("additionalJson")
187                private String myAdditionalJson;
188
189                public String getEndpointLocalHost() {
190                        return myEndpointLocalHost;
191                }
192
193                public void setEndpointLocalHost(String theEndpointLocalHost) {
194                        myEndpointLocalHost = theEndpointLocalHost;
195                }
196
197                public Integer getEndpointLocalPort() {
198                        return myEndpointLocalPort;
199                }
200
201                public void setEndpointLocalPort(Integer theEndpointLocalPort) {
202                        myEndpointLocalPort = theEndpointLocalPort;
203                }
204
205                public String getEndpointModuleId() {
206                        return myEndpointModuleId;
207                }
208
209                public void setEndpointModuleId(String theEntpointId) {
210                        myEndpointModuleId = theEntpointId;
211                }
212
213                public String getEndpointNodeId() {
214                        return myEndpointNodeId;
215                }
216
217                public void setEndpointNodeId(String theNodeId) {
218                        myEndpointNodeId = theNodeId;
219                }
220
221                public String getEndpointRemoteHost() {
222                        return myEndpointRemoteHost;
223                }
224
225                public void setEndpointRemoteHost(String theEndpointRemoteHost) {
226                        myEndpointRemoteHost = theEndpointRemoteHost;
227                }
228
229                public Integer getEndpointRemotePort() {
230                        return myEndpointRemotePort;
231                }
232
233                public void setEndpointRemotePort(Integer theEndpointRemotePort) {
234                        myEndpointRemotePort = theEndpointRemotePort;
235                }
236
237                public List<TransactionLogStepJson> getEvents() {
238                        if (myEvents_ == null) {
239                                myEvents_ = new ArrayList<>();
240                        }
241                        return myEvents_;
242                }
243
244                public Long getId() {
245                        return myId;
246                }
247
248                public void setId(Long thePid) {
249                        myId = thePid;
250                }
251
252                public Date getInitialTimestamp() {
253                        return myInitialTimestamp;
254                }
255
256                public void setInitialTimestamp(Date theTimestamp) {
257                        myInitialTimestamp = theTimestamp;
258                        if (myInitialTimestamp instanceof Timestamp) {
259                                myInitialTimestamp = new Date(myInitialTimestamp.getTime());
260                        }
261                }
262
263                public TransactionLogOutcomeEnum getOutcome() {
264                        return myOutcome;
265                }
266
267                public void setOutcome(TransactionLogOutcomeEnum theOutcome) {
268                        myOutcome = theOutcome;
269                }
270
271                public long getProcessingTime() {
272                        return myProcessingTime;
273                }
274
275                public void setProcessingTime(long theProcessingTime) {
276                        myProcessingTime = theProcessingTime;
277                }
278
279                public TransactionLogEventSubTypeEnum getSubType() {
280                        return mySubType;
281                }
282
283                public void setSubType(TransactionLogEventSubTypeEnum theSubType) {
284                        mySubType = theSubType;
285                }
286
287                public TransactionLogEventTypeEnum getType() {
288                        return myType;
289                }
290
291                public void setType(TransactionLogEventTypeEnum theTransactionLogEventTypeEnum) {
292                        myType = theTransactionLogEventTypeEnum;
293                }
294
295                public String getRequestId() {
296                        return myRequestId;
297                }
298
299                public void setRequestId(String theRequestId) {
300                        myRequestId = theRequestId;
301                }
302
303                public Long getUserId() {
304                        return myUserId;
305                }
306
307                public void setUserId(Long userId) {
308                        this.myUserId = userId;
309                }
310
311                public String getUserModuleId() {
312                        return myUserModuleId;
313                }
314
315                public void setUserModuleId(String userModuleId) {
316                        this.myUserModuleId = userModuleId;
317                }
318
319                public String getUserNodeId() {
320                        return myUserNodeId;
321                }
322
323                public void setUserNodeId(String userNodeId) {
324                        this.myUserNodeId = userNodeId;
325                }
326
327                public String getUsername() {
328                        return username;
329                }
330
331                public void setUsername(String username) {
332                        this.username = username;
333                }
334
335                public String getUserFamilyName() {
336                        return myUserFamilyName;
337                }
338
339                public void setUserFamilyName(String userFamilyName) {
340                        this.myUserFamilyName = userFamilyName;
341                }
342
343                public String getUserGivenName() {
344                        return myUserGivenName;
345                }
346
347                public void setUserGivenName(String userGivenName) {
348                        this.myUserGivenName = userGivenName;
349                }
350
351                public String getClientId() {
352                        return myClientId;
353                }
354
355                public void setClientId(String clientId) {
356                        this.myClientId = clientId;
357                }
358
359                public String getClientModuleId() {
360                        return myClientModuleId;
361                }
362
363                public void setClientModuleId(String clientModuleId) {
364                        this.myClientModuleId = clientModuleId;
365                }
366
367                public String getClientNodeId() {
368                        return myClientNodeId;
369                }
370
371                public void setClientNodeId(String clientNodeId) {
372                        this.myClientNodeId = clientNodeId;
373                }
374
375                public Long getClientPid() {
376                        return myClientPid;
377                }
378
379                public void setClientPid(Long clientPid) {
380                        this.myClientPid = clientPid;
381                }
382
383                public String getClientName() {
384                        return myClientName;
385                }
386
387                public void setClientName(String clientName) {
388                        this.myClientName = clientName;
389                }
390
391                public String getTransactionGuid() {
392                        return myTransactionGuid;
393                }
394
395                public void setTransactionGuid(String theTransactionGuid) {
396                        myTransactionGuid = theTransactionGuid;
397                }
398
399                public String getAdditionalJson() {
400                        return myAdditionalJson;
401                }
402
403                public void setAdditionalJson(String theAdditionalJson) {
404                        this.myAdditionalJson = theAdditionalJson;
405                }
406        }
407}