Removed TransportUpdate and TransportAck.

This commit is contained in:
akwizgran
2016-01-21 18:18:59 +00:00
parent ea02caf577
commit cd175fd119
20 changed files with 20 additions and 1632 deletions

View File

@@ -2,7 +2,6 @@ package org.briarproject.api.db;
import org.briarproject.api.Settings;
import org.briarproject.api.TransportId;
import org.briarproject.api.TransportProperties;
import org.briarproject.api.contact.Contact;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.identity.Author;
@@ -19,8 +18,6 @@ import org.briarproject.api.sync.Offer;
import org.briarproject.api.sync.Request;
import org.briarproject.api.sync.SubscriptionAck;
import org.briarproject.api.sync.SubscriptionUpdate;
import org.briarproject.api.sync.TransportAck;
import org.briarproject.api.sync.TransportUpdate;
import org.briarproject.api.transport.TransportKeys;
import java.io.IOException;
@@ -125,21 +122,6 @@ public interface DatabaseComponent {
SubscriptionUpdate generateSubscriptionUpdate(ContactId c, int maxLatency)
throws DbException;
/**
* Returns a batch of transport acks for the given contact, or null if no
* transport acks are due.
*/
Collection<TransportAck> generateTransportAcks(ContactId c)
throws DbException;
/**
* Returns a batch of transport updates for the given contact, for
* transmission over a transport with the given latency. Returns null if no
* updates are due.
*/
Collection<TransportUpdate> generateTransportUpdates(ContactId c,
int maxLatency) throws DbException;
/**
* Returns all groups belonging to the given client to which the user could
* subscribe.
@@ -173,13 +155,6 @@ public interface DatabaseComponent {
/** Returns all local pseudonyms. */
Collection<LocalAuthor> getLocalAuthors() throws DbException;
/** Returns the local transport properties for all transports. */
Map<TransportId, TransportProperties> getLocalProperties()
throws DbException;
/** Returns the local transport properties for the given transport. */
TransportProperties getLocalProperties(TransportId t) throws DbException;
/**
* Returns the IDs of any messages that need to be validated by the given
* client.
@@ -210,10 +185,6 @@ public interface DatabaseComponent {
MessageStatus getMessageStatus(ContactId c, MessageId m)
throws DbException;
/** Returns all remote transport properties for the given transport. */
Map<ContactId, TransportProperties> getRemoteProperties(TransportId t)
throws DbException;
/** Returns all settings in the given namespace. */
Settings getSettings(String namespace) throws DbException;
@@ -243,13 +214,6 @@ public interface DatabaseComponent {
*/
void mergeGroupMetadata(GroupId g, Metadata meta) throws DbException;
/**
* Merges the given properties with the existing local properties for the
* given transport.
*/
void mergeLocalProperties(TransportId t, TransportProperties p)
throws DbException;
/**
* Merges the given metadata with the existing metadata for the given
* message.
@@ -282,13 +246,6 @@ public interface DatabaseComponent {
void receiveSubscriptionUpdate(ContactId c, SubscriptionUpdate u)
throws DbException;
/** Processes a transport ack from the given contact. */
void receiveTransportAck(ContactId c, TransportAck a) throws DbException;
/** Processes a transport update from the given contact. */
void receiveTransportUpdate(ContactId c, TransportUpdate u)
throws DbException;
/** Removes a contact (and all associated state) from the database. */
void removeContact(ContactId c) throws DbException;
@@ -320,13 +277,6 @@ public interface DatabaseComponent {
void setMessageValidity(Message m, ClientId c, boolean valid)
throws DbException;
/**
* Sets the remote transport properties for the given contact, replacing
* any existing properties.
*/
void setRemoteProperties(ContactId c,
Map<TransportId, TransportProperties> p) throws DbException;
/**
* Sets the reordering window for the given contact and transport in the
* given rotation period.

View File

@@ -23,10 +23,4 @@ public interface PacketReader {
boolean hasSubscriptionUpdate() throws IOException;
SubscriptionUpdate readSubscriptionUpdate() throws IOException;
boolean hasTransportAck() throws IOException;
TransportAck readTransportAck() throws IOException;
boolean hasTransportUpdate() throws IOException;
TransportUpdate readTransportUpdate() throws IOException;
}

View File

@@ -9,6 +9,4 @@ public interface PacketTypes {
byte REQUEST = 3;
byte SUBSCRIPTION_ACK = 6;
byte SUBSCRIPTION_UPDATE = 7;
byte TRANSPORT_ACK = 8;
byte TRANSPORT_UPDATE = 9;
}

View File

@@ -22,9 +22,5 @@ public interface PacketWriter {
void writeSubscriptionUpdate(SubscriptionUpdate u) throws IOException;
void writeTransportAck(TransportAck a) throws IOException;
void writeTransportUpdate(TransportUpdate u) throws IOException;
void flush() throws IOException;
}

View File

@@ -1,25 +0,0 @@
package org.briarproject.api.sync;
import org.briarproject.api.TransportId;
/** A packet acknowledging a {@link TransportUpdate}. */
public class TransportAck {
private final TransportId id;
private final long version;
public TransportAck(TransportId id, long version) {
this.id = id;
this.version = version;
}
/** Returns the identifier of the updated transport. */
public TransportId getId() {
return id;
}
/** Returns the version number of the acknowledged update. */
public long getVersion() {
return version;
}
}

View File

@@ -1,36 +0,0 @@
package org.briarproject.api.sync;
import org.briarproject.api.TransportId;
import org.briarproject.api.TransportProperties;
/**
* A packet updating the recipient's view of the sender's transport properties.
*/
public class TransportUpdate {
private final TransportId id;
private final TransportProperties properties;
private final long version;
public TransportUpdate(TransportId id, TransportProperties properties,
long version) {
this.id = id;
this.properties = properties;
this.version = version;
}
/** Returns the identifier of the updated transport. */
public TransportId getId() {
return id;
}
/** Returns the transport's updated properties. */
public TransportProperties getProperties() {
return properties;
}
/** Returns the update's version number. */
public long getVersion() {
return version;
}
}