Further progress towards incremental subscription updates.

This commit is contained in:
akwizgran
2012-05-18 23:54:03 +02:00
parent b4f0da53b5
commit 1ca4ea9dcd
16 changed files with 340 additions and 405 deletions

View File

@@ -14,8 +14,8 @@ public interface PacketFactory {
Request createRequest(BitSet requested, int length);
SubscriptionUpdate createSubscriptionUpdate(Map<Group, Long> subs,
long timestamp);
SubscriptionUpdate createSubscriptionUpdate(Map<GroupId, GroupId> holes,
Map<Group, Long> subs, long expiry, long timestamp);
TransportUpdate createTransportUpdate(Collection<Transport> transports,
long timestamp);

View File

@@ -21,9 +21,6 @@ public interface ProtocolConstants {
/** The maximum length of a property's key or value in UTF-8 bytes. */
static final int MAX_PROPERTY_LENGTH = 100;
/** The maximum number of groups a node may subscribe to. */
static final int MAX_GROUPS = 5000;
/** The maximum length of a group's name in UTF-8 bytes. */
static final int MAX_GROUP_NAME_LENGTH = 50;

View File

@@ -5,9 +5,18 @@ import java.util.Map;
/** A packet updating the sender's subscriptions. */
public interface SubscriptionUpdate {
/** Returns the holes contained in the update. */
Map<GroupId, GroupId> getHoles();
/** Returns the subscriptions contained in the update. */
Map<Group, Long> getSubscriptions();
/**
* Returns the expiry time of the contact's database. Messages that are
* older than the expiry time must not be sent to the contact.
*/
long getExpiryTime();
/**
* Returns the update's timestamp. Updates that are older than the newest
* update received from the same contact must be ignored.