More refactoring to connect ConnectionRecogniser to ConnectionReader.

Added TestDatabaseModule so tests can specify their own DB
configuration. The modules are currently too tightly coupled - see
whether any dependencies can be removed.
This commit is contained in:
akwizgran
2011-09-28 14:21:38 +01:00
parent 4aff0c4f88
commit a1b664b639
30 changed files with 260 additions and 191 deletions

View File

@@ -7,7 +7,7 @@ import net.sf.briar.api.protocol.BatchId;
/** An interface for creating a batch packet. */
public interface BatchWriter {
/** Returns the capacity of the batch. */
/** Returns the capacity of the batch in bytes. */
int getCapacity();
/**

View File

@@ -4,6 +4,6 @@ import java.io.InputStream;
public interface ConnectionReaderFactory {
ConnectionReader createConnectionReader(InputStream in, boolean initiator,
int transportId, long connection, byte[] secret);
ConnectionReader createConnectionReader(InputStream in, byte[] encryptedIv,
byte[] secret);
}

View File

@@ -0,0 +1,6 @@
package net.sf.briar.api.transport;
public interface ConnectionRecogniserFactory {
ConnectionRecogniser createConnectionRecogniser(int transportId);
}

View File

@@ -12,5 +12,5 @@ public interface ConnectionWriter {
OutputStream getOutputStream();
/** Returns the maximum number of bytes that can be written. */
long getCapacity();
long getRemainingCapacity();
}

View File

@@ -9,7 +9,7 @@ import java.io.OutputStream;
*/
public interface BatchTransportWriter {
/** Returns the maximum number of bytes that can be written. */
/** Returns the capacity of the transport in bytes. */
long getCapacity();
/** Returns an output stream for writing to the transport. */