mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Changed the format of transport properties from (key, value) pairs to
(transport name, key, value) triples. This makes it possible for each transport plugin to update its locally stored properties atomically.
This commit is contained in:
@@ -58,7 +58,8 @@ public interface DatabaseComponent {
|
||||
* Adds a new contact to the database with the given transport properties
|
||||
* and returns an ID for the contact.
|
||||
*/
|
||||
ContactId addContact(Map<String, String> transports) throws DbException;
|
||||
ContactId addContact(Map<String, Map<String, String>> transports)
|
||||
throws DbException;
|
||||
|
||||
/** Adds a locally generated message to the database. */
|
||||
void addLocallyGeneratedMessage(Message m) throws DbException;
|
||||
@@ -111,10 +112,11 @@ public interface DatabaseComponent {
|
||||
Collection<Group> getSubscriptions() throws DbException;
|
||||
|
||||
/** Returns the local transport properties. */
|
||||
Map<String, String> getTransports() throws DbException;
|
||||
Map<String, Map<String, String>> getTransports() throws DbException;
|
||||
|
||||
/** Returns the transport properties for the given contact. */
|
||||
Map<String, String> getTransports(ContactId c) throws DbException;
|
||||
Map<String, Map<String, String>> getTransports(ContactId c)
|
||||
throws DbException;
|
||||
|
||||
/** Returns the contacts to which the given group is visible. */
|
||||
Collection<ContactId> getVisibility(GroupId g) throws DbException;
|
||||
@@ -152,9 +154,11 @@ public interface DatabaseComponent {
|
||||
void setRating(AuthorId a, Rating r) throws DbException;
|
||||
|
||||
/**
|
||||
* Sets the local transport properties, replacing any existing properties.
|
||||
* Sets the local transport properties for the transport with the given
|
||||
* name, replacing any existing properties for that transport.
|
||||
*/
|
||||
void setTransports(Map<String, String> transports) throws DbException;
|
||||
void setTransports(String name, Map<String, String> transports)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
* Makes the given group visible to the given set of contacts and invisible
|
||||
|
||||
@@ -12,7 +12,7 @@ public interface Transports {
|
||||
static final int MAX_SIZE = (1024 * 1024) - 100;
|
||||
|
||||
/** Returns the transports contained in the update. */
|
||||
Map<String, String> getTransports();
|
||||
Map<String, Map<String, String>> getTransports();
|
||||
|
||||
/**
|
||||
* Returns the update's timestamp. Updates that are older than the newest
|
||||
|
||||
@@ -7,5 +7,6 @@ import java.util.Map;
|
||||
public interface TransportWriter {
|
||||
|
||||
/** Writes the contents of the update. */
|
||||
void writeTransports(Map<String, String> transports) throws IOException;
|
||||
void writeTransports(Map<String, Map<String, String>> transports)
|
||||
throws IOException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user