Removed SubscriptionUpdate and SubscriptionAck.

This commit is contained in:
akwizgran
2016-01-27 16:31:07 +00:00
parent e85b2161e4
commit 9fdc510843
27 changed files with 27 additions and 885 deletions

View File

@@ -17,10 +17,4 @@ public interface PacketReader {
boolean hasRequest() throws IOException;
Request readRequest() throws IOException;
boolean hasSubscriptionAck() throws IOException;
SubscriptionAck readSubscriptionAck() throws IOException;
boolean hasSubscriptionUpdate() throws IOException;
SubscriptionUpdate readSubscriptionUpdate() throws IOException;
}

View File

@@ -7,6 +7,4 @@ public interface PacketTypes {
byte MESSAGE = 1;
byte OFFER = 2;
byte REQUEST = 3;
byte SUBSCRIPTION_ACK = 6;
byte SUBSCRIPTION_UPDATE = 7;
}

View File

@@ -18,9 +18,5 @@ public interface PacketWriter {
void writeRequest(Request r) throws IOException;
void writeSubscriptionAck(SubscriptionAck a) throws IOException;
void writeSubscriptionUpdate(SubscriptionUpdate u) throws IOException;
void flush() throws IOException;
}

View File

@@ -1,16 +0,0 @@
package org.briarproject.api.sync;
/** A packet acknowledging a {@link SubscriptionUpdate}. */
public class SubscriptionAck {
private final long version;
public SubscriptionAck(long version) {
this.version = version;
}
/** Returns the version number of the acknowledged update. */
public long getVersion() {
return version;
}
}

View File

@@ -1,28 +0,0 @@
package org.briarproject.api.sync;
import java.util.Collection;
/** A packet updating the recipient's view of the sender's subscriptions. */
public class SubscriptionUpdate {
private final Collection<Group> groups;
private final long version;
public SubscriptionUpdate(Collection<Group> groups, long version) {
this.groups = groups;
this.version = version;
}
/**
* Returns the groups to which the sender subscribes, and which the sender
* has made visible to the recipient.
*/
public Collection<Group> getGroups() {
return groups;
}
/** Returns the update's version number. */
public long getVersion() {
return version;
}
}

View File

@@ -14,10 +14,10 @@ public interface SyncConstants {
int MAX_PACKET_PAYLOAD_LENGTH = 32 * 1024; // 32 KiB
/** The maximum number of groups a user may subscribe to. */
int MAX_SUBSCRIPTIONS = 200;
int MAX_SUBSCRIPTIONS = 200; // TODO: Remove
/** The maximum length of a group descriptor in bytes. */
int MAX_GROUP_DESCRIPTOR_LENGTH = 100;
int MAX_GROUP_DESCRIPTOR_LENGTH = 100; // TODO: Remove
/** The maximum length of a message in bytes. */
int MAX_MESSAGE_LENGTH = MAX_PACKET_PAYLOAD_LENGTH - PACKET_HEADER_LENGTH;