mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Store group details in the database. Some tests are still failing...
This commit is contained in:
@@ -11,6 +11,7 @@ import net.sf.briar.api.protocol.AckWriter;
|
||||
import net.sf.briar.api.protocol.AuthorId;
|
||||
import net.sf.briar.api.protocol.Batch;
|
||||
import net.sf.briar.api.protocol.BatchWriter;
|
||||
import net.sf.briar.api.protocol.Group;
|
||||
import net.sf.briar.api.protocol.GroupId;
|
||||
import net.sf.briar.api.protocol.Message;
|
||||
import net.sf.briar.api.protocol.SubscriptionWriter;
|
||||
@@ -81,7 +82,7 @@ public interface DatabaseComponent {
|
||||
Rating getRating(AuthorId a) throws DbException;
|
||||
|
||||
/** Returns the set of groups to which the user subscribes. */
|
||||
Collection<GroupId> getSubscriptions() throws DbException;
|
||||
Collection<Group> getSubscriptions() throws DbException;
|
||||
|
||||
/** Returns the local transport details. */
|
||||
Map<String, String> getTransports() throws DbException;
|
||||
@@ -108,7 +109,7 @@ public interface DatabaseComponent {
|
||||
void setRating(AuthorId a, Rating r) throws DbException;
|
||||
|
||||
/** Subscribes to the given group. */
|
||||
void subscribe(GroupId g) throws DbException;
|
||||
void subscribe(Group g) throws DbException;
|
||||
|
||||
/**
|
||||
* Unsubscribes from the given group. Any messages belonging to the group
|
||||
|
||||
@@ -5,7 +5,10 @@ import java.security.PublicKey;
|
||||
/** A group to which users may subscribe. */
|
||||
public interface Group {
|
||||
|
||||
/** Returns the name of the group. */
|
||||
/** Returns the group's unique identifier. */
|
||||
GroupId getId();
|
||||
|
||||
/** Returns the group's name. */
|
||||
String getName();
|
||||
|
||||
/**
|
||||
|
||||
6
api/net/sf/briar/api/protocol/GroupFactory.java
Normal file
6
api/net/sf/briar/api/protocol/GroupFactory.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package net.sf.briar.api.protocol;
|
||||
|
||||
public interface GroupFactory {
|
||||
|
||||
Group createGroup(GroupId id, String name, byte[] salt, byte[] publicKey);
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import java.io.IOException;
|
||||
/** An interface for creating a subscription update. */
|
||||
public interface SubscriptionWriter {
|
||||
|
||||
// FIXME: This should work with groups, not IDs
|
||||
/** Sets the contents of the update. */
|
||||
void setSubscriptions(Iterable<GroupId> subs) throws IOException;
|
||||
void setSubscriptions(Iterable<Group> subs) throws IOException;
|
||||
}
|
||||
|
||||
@@ -5,9 +5,8 @@ import java.util.Collection;
|
||||
/** A packet updating the sender's subscriptions. */
|
||||
public interface Subscriptions {
|
||||
|
||||
// FIXME: This should work with groups, not IDs
|
||||
/** Returns the subscriptions contained in the update. */
|
||||
Collection<GroupId> getSubscriptions();
|
||||
Collection<Group> getSubscriptions();
|
||||
|
||||
/**
|
||||
* Returns the update's timestamp. Updates that are older than the newest
|
||||
|
||||
Reference in New Issue
Block a user