Removed message expiry code. #180

This commit is contained in:
akwizgran
2015-12-16 11:56:19 +00:00
parent 01ecfb435a
commit 6e61504d24
29 changed files with 104 additions and 1330 deletions

View File

@@ -18,21 +18,15 @@ public interface PacketReader {
boolean hasRequest() throws IOException;
Request readRequest() throws IOException;
boolean hasRetentionAck() throws IOException;
org.briarproject.api.sync.RetentionAck readRetentionAck() throws IOException;
boolean hasRetentionUpdate() throws IOException;
org.briarproject.api.sync.RetentionUpdate readRetentionUpdate() throws IOException;
boolean hasSubscriptionAck() throws IOException;
org.briarproject.api.sync.SubscriptionAck readSubscriptionAck() throws IOException;
SubscriptionAck readSubscriptionAck() throws IOException;
boolean hasSubscriptionUpdate() throws IOException;
org.briarproject.api.sync.SubscriptionUpdate readSubscriptionUpdate() throws IOException;
SubscriptionUpdate readSubscriptionUpdate() throws IOException;
boolean hasTransportAck() throws IOException;
TransportAck readTransportAck() throws IOException;
boolean hasTransportUpdate() throws IOException;
org.briarproject.api.sync.TransportUpdate readTransportUpdate() throws IOException;
TransportUpdate readTransportUpdate() throws IOException;
}

View File

@@ -7,8 +7,6 @@ public interface PacketTypes {
byte MESSAGE = 1;
byte OFFER = 2;
byte REQUEST = 3;
byte RETENTION_ACK = 4;
byte RETENTION_UPDATE = 5;
byte SUBSCRIPTION_ACK = 6;
byte SUBSCRIPTION_UPDATE = 7;
byte TRANSPORT_ACK = 8;

View File

@@ -14,21 +14,17 @@ public interface PacketWriter {
void writeMessage(byte[] raw) throws IOException;
void writeOffer(org.briarproject.api.sync.Offer o) throws IOException;
void writeOffer(Offer o) throws IOException;
void writeRequest(Request r) throws IOException;
void writeRetentionAck(org.briarproject.api.sync.RetentionAck a) throws IOException;
void writeSubscriptionAck(SubscriptionAck a) throws IOException;
void writeRetentionUpdate(org.briarproject.api.sync.RetentionUpdate u) throws IOException;
void writeSubscriptionUpdate(SubscriptionUpdate u) throws IOException;
void writeSubscriptionAck(org.briarproject.api.sync.SubscriptionAck a) throws IOException;
void writeTransportAck(TransportAck a) throws IOException;
void writeSubscriptionUpdate(org.briarproject.api.sync.SubscriptionUpdate u) throws IOException;
void writeTransportAck(org.briarproject.api.sync.TransportAck a) throws IOException;
void writeTransportUpdate(org.briarproject.api.sync.TransportUpdate u) throws IOException;
void writeTransportUpdate(TransportUpdate u) throws IOException;
void flush() throws IOException;
}

View File

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

View File

@@ -1,23 +0,0 @@
package org.briarproject.api.sync;
/**
* A packet updating the recipient's view of the retention time of the sender's
* database.
*/
public class RetentionUpdate {
private final long retention, version;
public RetentionUpdate(long retention, long version) {
this.retention = retention;
this.version = version;
}
public long getRetentionTime() {
return retention;
}
public long getVersion() {
return version;
}
}