diff --git a/api/net/sf/briar/api/transport/batch/BatchTransportCallback.java b/api/net/sf/briar/api/transport/batch/BatchTransportCallback.java index b8711fedf..79ef714be 100644 --- a/api/net/sf/briar/api/transport/batch/BatchTransportCallback.java +++ b/api/net/sf/briar/api/transport/batch/BatchTransportCallback.java @@ -1,7 +1,9 @@ package net.sf.briar.api.transport.batch; +import java.util.Map; + /** - * An interface for receiving readers and writers created by a batch-mode + * An interface for receiving readers and writers created by a batch-mode * transport plugin. */ public interface BatchTransportCallback { @@ -9,4 +11,8 @@ public interface BatchTransportCallback { void readerCreated(BatchTransportReader r); void writerCreated(BatchTransportWriter w); + + void setLocalTransports(Map transports); + + void setConfig(Map config); } diff --git a/api/net/sf/briar/api/transport/batch/BatchTransportPlugin.java b/api/net/sf/briar/api/transport/batch/BatchTransportPlugin.java index 2f16a40b3..db2ff72c0 100644 --- a/api/net/sf/briar/api/transport/batch/BatchTransportPlugin.java +++ b/api/net/sf/briar/api/transport/batch/BatchTransportPlugin.java @@ -13,16 +13,32 @@ import net.sf.briar.api.transport.InvalidTransportException; public interface BatchTransportPlugin { /** - * Initialises the plugin and returns. Any connections that are later - * established by contacts or through polling will be passed to the given - * callback. + * Returns the plugin's name, which is used to distinguish its transport + * and configuration properties from those of other plugins. */ - void start(Map> transports, + String getName(); + + /** + * Starts the plugin. Any connections that are later initiated by contacts + * or established through polling will be passed to the given callback. + */ + void start(Map localTransports, + Map> remoteTransports, Map config, BatchTransportCallback c) throws InvalidTransportException, InvalidConfigException; + /** + * Stops the plugin. No further connections will be passed to the callback + * after this method has returned. + */ + void stop(); + + /** Updates the plugin's local transport properties. */ + void setLocalTransports(Map transports) + throws InvalidTransportException; + /** Updates the plugin's transport properties for the given contact. */ - void setTransports(ContactId c, Map transports) + void setRemoteTransports(ContactId c, Map transports) throws InvalidTransportException; /** Updates the plugin's configuration properties. */ diff --git a/api/net/sf/briar/api/transport/stream/StreamTransportCallback.java b/api/net/sf/briar/api/transport/stream/StreamTransportCallback.java index 7584d38d0..3a84fc5eb 100644 --- a/api/net/sf/briar/api/transport/stream/StreamTransportCallback.java +++ b/api/net/sf/briar/api/transport/stream/StreamTransportCallback.java @@ -1,5 +1,7 @@ package net.sf.briar.api.transport.stream; +import java.util.Map; + /** * An interface for receiving connections created by a stream-mode transport * plugin. @@ -7,4 +9,8 @@ package net.sf.briar.api.transport.stream; public interface StreamTransportCallback { void connectionCreated(StreamTransportConnection c); + + void setLocalTransports(Map transports); + + void setConfig(Map config); } diff --git a/api/net/sf/briar/api/transport/stream/StreamTransportPlugin.java b/api/net/sf/briar/api/transport/stream/StreamTransportPlugin.java index 55ce007dd..67e04a204 100644 --- a/api/net/sf/briar/api/transport/stream/StreamTransportPlugin.java +++ b/api/net/sf/briar/api/transport/stream/StreamTransportPlugin.java @@ -13,16 +13,32 @@ import net.sf.briar.api.transport.InvalidTransportException; public interface StreamTransportPlugin { /** - * Initialises the plugin and returns. Any connections that are later - * established by contacts or through polling will be passed to the given - * callback. + * Returns the plugin's name, which is used to distinguish its transport + * and configuration properties from those of other plugins. */ - void start(Map> transports, + String getName(); + + /** + * Starts the plugin. Any connections that are later initiated by contacts + * or established through polling will be passed to the given callback. + */ + void start(Map localTransports, + Map> remoteTransports, Map config, StreamTransportCallback c) throws InvalidTransportException, InvalidConfigException; + /** + * Stops the plugin. No further connections will be passed to the callback + * after this method has returned. + */ + void stop(); + + /** Updates the plugin's local transport properties. */ + void setLocalTransports(Map transports) + throws InvalidTransportException; + /** Updates the plugin's transport properties for the given contact. */ - void setTransports(ContactId c, Map transports) + void setRemoteTransports(ContactId c, Map transports) throws InvalidTransportException; /** Updates the plugin's configuration properties. */