Use strings rather than hashes to identify transports. Dev task #64.

This commit is contained in:
akwizgran
2014-01-24 10:39:34 +00:00
parent 468db2a97b
commit 822392f9e7
26 changed files with 115 additions and 172 deletions

View File

@@ -36,11 +36,7 @@ import org.briarproject.util.StringUtils;
class BluetoothPlugin implements DuplexPlugin {
// Share an ID with the Android Bluetooth plugin
static final byte[] TRANSPORT_ID =
StringUtils.fromHexString("d99c9313c04417dcf22fc60d12a187ea"
+ "00a539fd260f08a13a0d8a900cde5e49"
+ "1b4df2ffd42e40c408f2db7868f518aa");
static final TransportId ID = new TransportId(TRANSPORT_ID);
static final TransportId ID = new TransportId("bt");
private static final Logger LOG =
Logger.getLogger(BluetoothPlugin.class.getName());
@@ -74,10 +70,6 @@ class BluetoothPlugin implements DuplexPlugin {
return ID;
}
public String getName() {
return "BLUETOOTH_PLUGIN_NAME";
}
public int getMaxFrameLength() {
return maxFrameLength;
}

View File

@@ -15,16 +15,11 @@ import org.briarproject.api.ContactId;
import org.briarproject.api.TransportId;
import org.briarproject.api.plugins.simplex.SimplexPluginCallback;
import org.briarproject.api.system.FileUtils;
import org.briarproject.util.StringUtils;
class RemovableDrivePlugin extends FilePlugin
implements RemovableDriveMonitor.Callback {
static final byte[] TRANSPORT_ID =
StringUtils.fromHexString("7c81bf5c9b1cd557685548c85f976bbd"
+ "e633d2418ea2e230e5710fb43c6f8cc0"
+ "68abca3a9d0edb13bcea13b851725c5d");
static final TransportId ID = new TransportId(TRANSPORT_ID);
static final TransportId ID = new TransportId("file");
private static final Logger LOG =
Logger.getLogger(RemovableDrivePlugin.class.getName());
@@ -45,10 +40,6 @@ implements RemovableDriveMonitor.Callback {
return ID;
}
public String getName() {
return "REMOVABLE_DRIVE_PLUGIN_NAME";
}
public boolean start() throws IOException {
running = true;
monitor.start(this);

View File

@@ -27,11 +27,7 @@ import org.briarproject.util.StringUtils;
class ModemPlugin implements DuplexPlugin, Modem.Callback {
static final byte[] TRANSPORT_ID =
StringUtils.fromHexString("8f573867bedf54884b5868ee5d902832" +
"ee5e522da84d0d431712bd672fbd2f79" +
"262d27b93879b94ee9afbb80e7fc87fb");
static final TransportId ID = new TransportId(TRANSPORT_ID);
static final TransportId ID = new TransportId("modem");
private static final Logger LOG =
Logger.getLogger(ModemPlugin.class.getName());
@@ -65,10 +61,6 @@ class ModemPlugin implements DuplexPlugin, Modem.Callback {
return ID;
}
public String getName() {
return "MODEM_PLUGIN_NAME";
}
public int getMaxFrameLength() {
return maxFrameLength;
}