Separated contact transports from secrets and cleaned up some tests.

This commit is contained in:
akwizgran
2012-09-24 18:27:20 +01:00
parent 96b3d88ece
commit 2ff439ffe6
12 changed files with 154 additions and 89 deletions

View File

@@ -1,23 +1,33 @@
package net.sf.briar.api;
package net.sf.briar.api.db;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.protocol.TransportId;
public class ContactTransport extends TemporarySecret {
public class ContactTransport {
private final ContactId contactId;
private final TransportId transportId;
private final long epoch, clockDiff, latency;
private final boolean alice;
public ContactTransport(ContactId contactId, TransportId transportId,
long epoch, long clockDiff, long latency, boolean alice,
long period, byte[] secret, long outgoing, long centre,
byte[] bitmap) {
super(contactId, transportId, period, secret, outgoing, centre, bitmap);
long epoch, long clockDiff, long latency, boolean alice) {
this.contactId = contactId;
this.transportId = transportId;
this.epoch = epoch;
this.clockDiff = clockDiff;
this.latency = latency;
this.alice = alice;
}
public ContactId getContactId() {
return contactId;
}
public TransportId getTransportId() {
return transportId;
}
public long getEpoch() {
return epoch;
}

View File

@@ -5,9 +5,7 @@ import java.util.Collection;
import java.util.Map;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.ContactTransport;
import net.sf.briar.api.Rating;
import net.sf.briar.api.TemporarySecret;
import net.sf.briar.api.TransportConfig;
import net.sf.briar.api.TransportProperties;
import net.sf.briar.api.db.event.DatabaseListener;

View File

@@ -1,13 +1,14 @@
package net.sf.briar.api;
package net.sf.briar.api.db;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.protocol.TransportId;
public class TemporarySecret {
protected final ContactId contactId;
protected final TransportId transportId;
protected final long period, outgoing, centre;
protected final byte[] secret, bitmap;
private final ContactId contactId;
private final TransportId transportId;
private final long period, outgoing, centre;
private final byte[] secret, bitmap;
public TemporarySecret(ContactId contactId, TransportId transportId,
long period, byte[] secret, long outgoing, long centre,