Block Chain Transactions, Commits multiple parts version
[iotcloud.git] / version2 / backup / src / java / iotcloud / TransactionStatus.java
1 package iotcloud;
2
3 class TransactionStatus {
4     static final byte StatusAborted = 1;
5     static final byte StatusPending = 2;
6     static final byte StatusCommitted = 3;
7     // static final byte StatusRetrying = 4;
8     static final byte StatusSent = 5;
9     static final byte StatusNoEffect = 6;
10
11     private byte status = 0;
12     private boolean applicationReleased = false;
13     private long arbitrator = 0;
14     private boolean wasSentInChain = false;
15
16     public TransactionStatus(byte _status, long _arbitrator) {
17         status = _status;
18         arbitrator = _arbitrator;
19     }
20
21     public byte getStatus() {
22         return status;
23     }
24
25     public void setStatus(byte _status) {
26         status = _status;
27     }
28
29     public void setSentTransaction() {
30         wasSentInChain = true;
31     }
32
33     public boolean getSentTransaction() {
34         return wasSentInChain;
35     }
36
37
38     // public void setArbitrator(long _arbitrator) {
39     //     arbitrator = _arbitrator;
40     // }
41
42     public long getArbitrator() {
43         return arbitrator;
44     }
45
46     public void release() {
47         applicationReleased = true;
48     }
49
50     public boolean getReleased() {
51         return applicationReleased;
52     }
53 }