private int livecount;
private boolean seqnumlive;
private int freespace;
-
+
Slot(long _seqnum, long _machineid, byte[] _prevhmac, byte[] _hmac) {
seqnum=_seqnum;
machineid=_machineid;
int newfreespace = freespace - e.getSize();
return newfreespace >= 0;
}
-
+
Vector<Entry> getEntries() {
return entries;
}
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);
int getBaseSize() {
return 2*HMAC_SIZE+2*Long.BYTES+Integer.BYTES;
}
-
+
Vector<Entry> getLiveEntries() {
Vector<Entry> liveEntries=new Vector<Entry>();
for(Entry entry: entries)
if (seqnumlive)
liveEntries.add(new LastMessage(this, machineid, seqnum));
-
+
return liveEntries;
}
-
+
long getSequenceNumber() {
return seqnum;
}
decrementLiveCount();
seqnumlive=false;
}
-
+
void decrementLiveCount() {
livecount--;
}