formatting
[iotcloud.git] / src / java / iotcloud / Slot.java
index 045259015c59d3f2a280300e81ca7031ddf7c476..707b5288fd1a02c75f0376ca454ddc1763b1fc3c 100644 (file)
@@ -14,7 +14,7 @@ class Slot implements Liveness {
        private long machineid;
        private Vector<Entry> entries;
        private int livecount;
-       
+
        Slot(long _seqnum, long _machineid, byte[] _prevhmac, byte[] _hmac) {
                seqnum=_seqnum;
                machineid=_machineid;
@@ -23,7 +23,7 @@ class Slot implements Liveness {
                entries=new Vector<Entry>();
                livecount=1;
        }
-       
+
        Slot(long _seqnum, byte[] _bytes) {
                seqnum=_seqnum;
        }
@@ -40,11 +40,11 @@ class Slot implements Liveness {
                entries.add(e);
                livecount++;
        }
-       
+
        Vector<Entry> getEntries() {
                return entries;
        }
-       
+
        static Slot decode(byte[] array, Mac mac) {
                mac.update(array, HMAC_SIZE, array.length-HMAC_SIZE);
                byte[] realmac=mac.doFinal();
@@ -61,18 +61,18 @@ class Slot implements Liveness {
                long machineid=bb.getLong();
                int numentries=bb.getInt();
                Slot slot=new Slot(seqnum, machineid, prevhmac, hmac);
-               
-               for(int i=0;i<numentries;i++) {
+
+               for(int i=0; i<numentries; i++) {
                        slot.addEntry(Entry.decode(slot, bb));
                }
-               
+
                return slot;
        }
 
        byte[] encode(Mac mac) {
                byte[] array=new byte[SLOT_SIZE];
                ByteBuffer bb=ByteBuffer.wrap(array);
-               bb.position(HMAC_SIZE); //Leave space for the HMACs
+               bb.position(HMAC_SIZE);                                                                                                                                                                                                                                                 //Leave space for the HMACs
                bb.put(prevhmac);
                bb.putLong(seqnum);
                bb.putLong(machineid);
@@ -87,7 +87,7 @@ class Slot implements Liveness {
                bb.put(realmac);
                return array;
        }
-       
+
        long getSequenceNumber() {
                return seqnum;
        }
@@ -95,7 +95,7 @@ class Slot implements Liveness {
        long getMachineID() {
                return machineid;
        }
-       
+
        byte[] getBytes() {
                return null;
        }
@@ -103,7 +103,7 @@ class Slot implements Liveness {
        void decrementLiveCount() {
                livecount--;
        }
-       
+
        boolean isLive() {
                return livecount > 0;
        }