/
LRAData.java
114 lines (94 loc) · 2.88 KB
/
LRAData.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package io.narayana.lra.coordinator.domain.model;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
public class LRAData {
private String lraId;
private String clientId;
private String status;
private boolean isClosed;
private boolean isCancelled;
private boolean isRecovering;
private boolean isActive;
private boolean isTopLevel;
private long startTime;
private long finishTime;
public LRAData(String lraId, String clientId, String status,
boolean isClosed, boolean isCancelled, boolean isRecovering,
boolean isActive, boolean isTopLevel,
long startTime, long finishTime) {
this.lraId = lraId;
this.clientId = clientId;
this.status = status;
this.isClosed = isClosed;
this.isCancelled = isCancelled;
this.isRecovering = isRecovering;
this.isActive = isActive;
this.isTopLevel = isTopLevel;
this.startTime = startTime;
this.finishTime = finishTime;
}
public String getLraId() {
return this.lraId;
}
public String getClientId() {
return this.clientId;
}
public String getStatus() {
return this.status;
}
public boolean isClosed() {
return this.isClosed;
}
public boolean isCancelled() {
return this.isCancelled;
}
public boolean isRecovering() {
return this.isRecovering;
}
public boolean isActive() {
return this.isActive;
}
public boolean isTopLevel() {
return this.isTopLevel;
}
public long getStartTime() {
return startTime;
}
public long getFinishTime() {
return finishTime;
}
public long getTimeNow() {
return LocalDateTime.now().atZone(ZoneOffset.UTC).toInstant().toEpochMilli();
}
public ZoneOffset getZoneOffset() {
return ZoneOffset.UTC;
}
public boolean equals(Object o) {
if (this == o) {
return true;
} else if (!(o instanceof LRAData)) {
return false;
} else {
LRAData lraData = (LRAData) o;
return this.getLraId().equals(lraData.getLraId());
}
}
public int hashCode() {
return this.getLraId().hashCode();
}
@Override
public String toString() {
return this.getClass().getSimpleName() + "{" +
"lraId='" + lraId + '\'' +
", clientId='" + clientId + '\'' +
", status='" + status + '\'' +
", isClosed=" + isClosed +
", isCancelled=" + isCancelled +
", isRecovering=" + isRecovering +
", isActive=" + isActive +
", isTopLevel=" + isTopLevel +
", startTime=" + startTime +
", finishTime=" + finishTime +
'}';
}
}