mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Removed SubscriptionUpdate and SubscriptionAck.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,4 @@ public interface PacketTypes {
|
||||
byte MESSAGE = 1;
|
||||
byte OFFER = 2;
|
||||
byte REQUEST = 3;
|
||||
byte SUBSCRIPTION_ACK = 6;
|
||||
byte SUBSCRIPTION_UPDATE = 7;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user