more changes
[iotcloud.git] / src / java / iotcloud / Slot.java
index 707b5288fd1a02c75f0376ca454ddc1763b1fc3c..ff0e901081d5850817c36306d7c72807f2995599 100644 (file)
@@ -14,7 +14,8 @@ class Slot implements Liveness {
        private long machineid;
        private Vector<Entry> entries;
        private int livecount;
-
+       private boolean seqnumlive;
+       
        Slot(long _seqnum, long _machineid, byte[] _prevhmac, byte[] _hmac) {
                seqnum=_seqnum;
                machineid=_machineid;
@@ -22,10 +23,11 @@ class Slot implements Liveness {
                hmac=_hmac;
                entries=new Vector<Entry>();
                livecount=1;
+               seqnumlive=true;
        }
 
-       Slot(long _seqnum, byte[] _bytes) {
-               seqnum=_seqnum;
+       Slot(long _seqnum, long _machineid, byte[] _prevhmac) {
+               this(_seqnum, _machineid, _prevhmac, new byte[HMAC_SIZE]);
        }
 
        byte[] getHMAC() {
@@ -100,6 +102,11 @@ class Slot implements Liveness {
                return null;
        }
 
+       void setDead() {
+               decrementLiveCount();
+               seqnumlive=false;
+       }
+       
        void decrementLiveCount() {
                livecount--;
        }