mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Add registry method for deciding which contacts to poll.
This commit is contained in:
@@ -40,6 +40,12 @@ public interface ConnectionRegistry {
|
||||
*/
|
||||
Collection<ContactId> getConnectedContacts(TransportId t);
|
||||
|
||||
/**
|
||||
* Returns any contacts that are connected via the given transport, or via
|
||||
* any transport that's preferred to the given transport.
|
||||
*/
|
||||
Collection<ContactId> getConnectedOrPreferredContacts(TransportId t);
|
||||
|
||||
/**
|
||||
* Returns true if the given contact is connected via the given transport.
|
||||
*/
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package org.briarproject.bramble.api.plugin;
|
||||
|
||||
import org.briarproject.bramble.api.Pair;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.bramble.api.plugin.duplex.DuplexPluginFactory;
|
||||
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginFactory;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@NotNullByDefault
|
||||
public interface PluginConfig {
|
||||
@@ -14,4 +16,10 @@ public interface PluginConfig {
|
||||
Collection<SimplexPluginFactory> getSimplexFactories();
|
||||
|
||||
boolean shouldPoll();
|
||||
|
||||
/**
|
||||
* Returns a list of transport preferences. For each pair in the list,
|
||||
* the first transport is preferred to the second.
|
||||
*/
|
||||
List<Pair<TransportId, TransportId>> getTransportPreferences();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user