Phone app (based on Ali's Control for iotcloud benchmark) to control alarm in the...
[iot2.git] / benchmarks / other / PhoneInterface / Control / app / src / main / java / iotcloud / TransactionStatus.java
diff --git a/benchmarks/other/PhoneInterface/Control/app/src/main/java/iotcloud/TransactionStatus.java b/benchmarks/other/PhoneInterface/Control/app/src/main/java/iotcloud/TransactionStatus.java
new file mode 100644 (file)
index 0000000..e397d6c
--- /dev/null
@@ -0,0 +1,51 @@
+package iotcloud;
+
+class TransactionStatus {
+    static final byte StatusAborted = 1;
+    static final byte StatusPending = 2;
+    static final byte StatusCommitted = 3;
+    // static final byte StatusRetrying = 4;
+    static final byte StatusSentPartial = 5;
+    static final byte StatusSentFully = 6;
+    static final byte StatusNoEffect = 10;
+
+    private byte status = 0;
+    private boolean applicationReleased = false;
+    private boolean wasSentInChain = false;
+    private long transactionSequenceNumber = 0;
+    private long arbitrator = -1;
+
+
+    public TransactionStatus(byte _status, long _arbitrator) {
+        status = _status;
+        arbitrator = _arbitrator;
+    }
+
+    public byte getStatus() {
+        return status;
+    }
+
+    public void setStatus(byte _status) {
+        status = _status;
+    }
+
+    public long getTransactionSequenceNumber() {
+        return transactionSequenceNumber;
+    }
+
+    public void setTransactionSequenceNumber(long _transactionSequenceNumber) {
+        transactionSequenceNumber = _transactionSequenceNumber;
+    }
+
+    public long getTransactionArbitrator() {
+        return arbitrator;
+    }
+
+    public void release() {
+        applicationReleased = true;
+    }
+
+    public boolean getReleased() {
+        return applicationReleased;
+    }
+}
\ No newline at end of file