Request reader and unit test.

This commit is contained in:
akwizgran
2011-07-27 11:06:54 +01:00
parent 0933092295
commit b161e5ed1d
20 changed files with 305 additions and 48 deletions

View File

@@ -12,5 +12,5 @@ public interface Ack {
static final int MAX_SIZE = (1024 * 1024) - 100;
/** Returns the IDs of the acknowledged batches. */
Collection<BatchId> getBatches();
Collection<BatchId> getBatchIds();
}

View File

@@ -12,5 +12,5 @@ public interface Offer {
static final int MAX_SIZE = (1024 * 1024) - 100;
/** Returns the message IDs contained in the offer. */
Collection<MessageId> getMessages();
Collection<MessageId> getMessageIds();
}

View File

@@ -0,0 +1,19 @@
package net.sf.briar.api.protocol;
import java.util.BitSet;
/** A packet requesting some or all of the messages from an offer. */
public interface Request {
/**
* The maximum size of a serialised request, exlcuding encryption and
* authentication.
*/
static final int MAX_SIZE = (1024 * 1024) - 100;
/**
* Returns a sequence of bits corresponding to the sequence of messages in
* the offer, where the i^th bit is set if the i^th message should be sent.
*/
BitSet getBitmap();
}