forked from dtm-labs/client-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransBase.cs
More file actions
94 lines (73 loc) · 2.51 KB
/
TransBase.cs
File metadata and controls
94 lines (73 loc) · 2.51 KB
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
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace DtmCommon
{
public class TransBase
{
[JsonPropertyName("gid")]
public string Gid { get; set; }
[JsonPropertyName("trans_type")]
public string TransType { get; set; }
[JsonPropertyName("custom_data")]
public string CustomData { get; set; }
[JsonPropertyName("wait_result")]
public bool WaitResult { get; set; }
[JsonPropertyName("timeout_to_fail")]
public long TimeoutToFail { get; set; }
[JsonPropertyName("request_timeout")]
public long RequestTimeout { get; set; }
[JsonPropertyName("retry_interval")]
public long RetryInterval { get; set; }
[JsonPropertyName("branch_headers")]
public Dictionary<string, string> BranchHeaders { get; set; }
[JsonPropertyName("retry_limit")]
public long RetryLimit { get; set; }
[JsonPropertyName("retry_count")]
public long RetryCount { get; set; }
/// <summary>
/// use in MSG/SAGA
/// </summary>
[JsonPropertyName("steps")]
public List<Dictionary<string, string>> Steps { get; set; }
/// <summary>
/// used in MSG/SAGA
/// </summary>
[JsonPropertyName("payloads")]
public List<string> Payloads { get; set; }
[JsonIgnore]
public List<byte[]> BinPayloads { get; set; }
/// <summary>
/// used in XA/TCC
/// </summary>
[JsonIgnore]
public BranchIDGen BranchIDGen { get; set; }
/// <summary>
/// used in XA/TCC
/// </summary>
[JsonIgnore]
public string Op { get; set; }
/// <summary>
/// used in MSG
/// </summary>
[JsonPropertyName("query_prepared")]
public string QueryPrepared { get; set; }
[JsonPropertyName("protocol")]
public string Protocol { get; set; }
[JsonPropertyName("rollback_reason")]
public string RollbackReason { get; set; }
[JsonIgnore]
public string Dtm { get; set; }
public DateTime NextCronTime { get; set; }
public static TransBase NewTransBase(string gid, string transType, string dtm, string branchID)
{
return new TransBase
{
Gid = gid,
TransType = transType,
Dtm = dtm,
BranchIDGen = new BranchIDGen(branchID),
};
}
}
}