diff --git a/briar-api/src/org/briarproject/api/contact/Contact.java b/briar-api/src/org/briarproject/api/contact/Contact.java index 18a2cb446c31334407bfca08f916f6a94eea2d65..5c5b9b197e8ea868595c67d622d0387fab25fa77 100644 --- a/briar-api/src/org/briarproject/api/contact/Contact.java +++ b/briar-api/src/org/briarproject/api/contact/Contact.java @@ -1,6 +1,5 @@ package org.briarproject.api.contact; -import org.briarproject.api.db.StorageStatus; import org.briarproject.api.identity.Author; import org.briarproject.api.identity.AuthorId; @@ -9,14 +8,11 @@ public class Contact { private final ContactId id; private final Author author; private final AuthorId localAuthorId; - private final StorageStatus status; - public Contact(ContactId id, Author author, AuthorId localAuthorId, - StorageStatus status) { + public Contact(ContactId id, Author author, AuthorId localAuthorId) { this.id = id; this.author = author; this.localAuthorId = localAuthorId; - this.status = status; } public ContactId getId() { @@ -31,10 +27,6 @@ public class Contact { return localAuthorId; } - public StorageStatus getStatus() { - return status; - } - @Override public int hashCode() { return id.hashCode(); diff --git a/briar-api/src/org/briarproject/api/db/DatabaseComponent.java b/briar-api/src/org/briarproject/api/db/DatabaseComponent.java index 5592042b12992ccb4cf6aed23a18a4c931f8e225..ca24976942a3d6b7dbdaa160d6825e19a32fbfa6 100644 --- a/briar-api/src/org/briarproject/api/db/DatabaseComponent.java +++ b/briar-api/src/org/briarproject/api/db/DatabaseComponent.java @@ -317,18 +317,6 @@ public interface DatabaseComponent { */ void removeTransport(Transaction txn, TransportId t) throws DbException; - /** - * Sets the status of the given contact. - */ - void setContactStatus(Transaction txn, ContactId c, StorageStatus s) - throws DbException; - - /** - * Sets the status of the given local pseudonym. - */ - void setLocalAuthorStatus(Transaction txn, AuthorId a, StorageStatus s) - throws DbException; - /** * Marks the given message as shared or unshared. */ diff --git a/briar-api/src/org/briarproject/api/db/StorageStatus.java b/briar-api/src/org/briarproject/api/db/StorageStatus.java deleted file mode 100644 index dc2d554ffb08863f6409067ca727bc169aad05e0..0000000000000000000000000000000000000000 --- a/briar-api/src/org/briarproject/api/db/StorageStatus.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.briarproject.api.db; - -public enum StorageStatus { - - ADDING(0), ACTIVE(1), REMOVING(2); - - private final int value; - - StorageStatus(int value) { - this.value = value; - } - - public int getValue() { - return value; - } - - public static StorageStatus fromValue(int value) { - for (StorageStatus s : values()) if (s.value == value) return s; - throw new IllegalArgumentException(); - } -} diff --git a/briar-api/src/org/briarproject/api/identity/LocalAuthor.java b/briar-api/src/org/briarproject/api/identity/LocalAuthor.java index 08ee121e533a7fb666705d3583032a7029390f43..cdcfdc788a4932c62625935f13fbcd1eebecd72c 100644 --- a/briar-api/src/org/briarproject/api/identity/LocalAuthor.java +++ b/briar-api/src/org/briarproject/api/identity/LocalAuthor.java @@ -1,20 +1,16 @@ package org.briarproject.api.identity; -import org.briarproject.api.db.StorageStatus; - /** A pseudonym for the local user. */ public class LocalAuthor extends Author { private final byte[] privateKey; private final long created; - private final StorageStatus status; public LocalAuthor(AuthorId id, String name, byte[] publicKey, - byte[] privateKey, long created, StorageStatus status) { + byte[] privateKey, long created) { super(id, name, publicKey); this.privateKey = privateKey; this.created = created; - this.status = status; } /** Returns the private key used to generate the pseudonym's signatures. */ @@ -29,9 +25,4 @@ public class LocalAuthor extends Author { public long getTimeCreated() { return created; } - - /** Returns the status of the pseudonym. */ - public StorageStatus getStatus() { - return status; - } } diff --git a/briar-core/src/org/briarproject/contact/ContactManagerImpl.java b/briar-core/src/org/briarproject/contact/ContactManagerImpl.java index b86e63f298a8240ead51404178d3629474910a04..2fafe8a168c4c22bdbb97f1d6143cf4ef520d24f 100644 --- a/briar-core/src/org/briarproject/contact/ContactManagerImpl.java +++ b/briar-core/src/org/briarproject/contact/ContactManagerImpl.java @@ -7,22 +7,16 @@ import org.briarproject.api.contact.ContactId; import org.briarproject.api.contact.ContactManager; import org.briarproject.api.db.DatabaseComponent; import org.briarproject.api.db.DbException; -import org.briarproject.api.db.NoSuchContactException; import org.briarproject.api.db.Transaction; import org.briarproject.api.identity.Author; import org.briarproject.api.identity.AuthorId; import org.briarproject.api.identity.IdentityManager.RemoveIdentityHook; import org.briarproject.api.identity.LocalAuthor; -import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; -import static org.briarproject.api.db.StorageStatus.ACTIVE; -import static org.briarproject.api.db.StorageStatus.REMOVING; - class ContactManagerImpl implements ContactManager, RemoveIdentityHook { private final DatabaseComponent db; @@ -56,7 +50,6 @@ class ContactManagerImpl implements ContactManager, RemoveIdentityHook { Contact contact = db.getContact(txn, c); for (AddContactHook hook : addHooks) hook.addingContact(txn, contact); - db.setContactStatus(txn, c, ACTIVE); txn.setComplete(); } finally { db.endTransaction(txn); @@ -74,8 +67,7 @@ class ContactManagerImpl implements ContactManager, RemoveIdentityHook { } finally { db.endTransaction(txn); } - if (contact.getStatus().equals(ACTIVE)) return contact; - throw new NoSuchContactException(); + return contact; } @Override @@ -88,11 +80,7 @@ class ContactManagerImpl implements ContactManager, RemoveIdentityHook { } finally { db.endTransaction(txn); } - // Filter out any contacts that are being added or removed - List<Contact> active = new ArrayList<Contact>(contacts.size()); - for (Contact c : contacts) - if (c.getStatus().equals(ACTIVE)) active.add(c); - return Collections.unmodifiableList(active); + return contacts; } @Override @@ -109,7 +97,6 @@ class ContactManagerImpl implements ContactManager, RemoveIdentityHook { private void removeContact(Transaction txn, ContactId c) throws DbException { Contact contact = db.getContact(txn, c); - db.setContactStatus(txn, c, REMOVING); for (RemoveContactHook hook : removeHooks) hook.removingContact(txn, contact); db.removeContact(txn, c); diff --git a/briar-core/src/org/briarproject/db/Database.java b/briar-core/src/org/briarproject/db/Database.java index 30c824038342911a87942e5344dbc43ddd22879a..91d17b49df5abd4f1746afb17f62f83f954b659c 100644 --- a/briar-core/src/org/briarproject/db/Database.java +++ b/briar-core/src/org/briarproject/db/Database.java @@ -6,7 +6,6 @@ import org.briarproject.api.contact.Contact; import org.briarproject.api.contact.ContactId; import org.briarproject.api.db.DbException; import org.briarproject.api.db.Metadata; -import org.briarproject.api.db.StorageStatus; import org.briarproject.api.identity.Author; import org.briarproject.api.identity.AuthorId; import org.briarproject.api.identity.LocalAuthor; @@ -441,18 +440,6 @@ interface Database<T> { */ void resetExpiryTime(T txn, ContactId c, MessageId m) throws DbException; - /** - * Sets the status of the given contact. - */ - void setContactStatus(T txn, ContactId c, StorageStatus s) - throws DbException; - - /** - * Sets the status of the given local pseudonym. - */ - void setLocalAuthorStatus(T txn, AuthorId a, StorageStatus s) - throws DbException; - /** * Marks the given message as shared or unshared. */ diff --git a/briar-core/src/org/briarproject/db/DatabaseComponentImpl.java b/briar-core/src/org/briarproject/db/DatabaseComponentImpl.java index 00e064883cf0a5fb7ebf6e4597ccbb53c53d8b29..9a271f7ab3e4136fd0b4859a61ea43b958e5e5d3 100644 --- a/briar-core/src/org/briarproject/db/DatabaseComponentImpl.java +++ b/briar-core/src/org/briarproject/db/DatabaseComponentImpl.java @@ -13,7 +13,6 @@ import org.briarproject.api.db.NoSuchGroupException; import org.briarproject.api.db.NoSuchLocalAuthorException; import org.briarproject.api.db.NoSuchMessageException; import org.briarproject.api.db.NoSuchTransportException; -import org.briarproject.api.db.StorageStatus; import org.briarproject.api.db.Transaction; import org.briarproject.api.event.ContactAddedEvent; import org.briarproject.api.event.ContactRemovedEvent; @@ -608,22 +607,6 @@ class DatabaseComponentImpl<T> implements DatabaseComponent { transaction.attach(new TransportRemovedEvent(t)); } - public void setContactStatus(Transaction transaction, ContactId c, - StorageStatus s) throws DbException { - T txn = unbox(transaction); - if (!db.containsContact(txn, c)) - throw new NoSuchContactException(); - db.setContactStatus(txn, c, s); - } - - public void setLocalAuthorStatus(Transaction transaction, AuthorId a, - StorageStatus s) throws DbException { - T txn = unbox(transaction); - if (!db.containsLocalAuthor(txn, a)) - throw new NoSuchLocalAuthorException(); - db.setLocalAuthorStatus(txn, a, s); - } - public void setMessageShared(Transaction transaction, Message m, boolean shared) throws DbException { T txn = unbox(transaction); diff --git a/briar-core/src/org/briarproject/db/JdbcDatabase.java b/briar-core/src/org/briarproject/db/JdbcDatabase.java index b1b536d7fab33ac640f8d394519023d6783f3f8b..4af26f32006d3e0c44b62e05cc639757baad8a42 100644 --- a/briar-core/src/org/briarproject/db/JdbcDatabase.java +++ b/briar-core/src/org/briarproject/db/JdbcDatabase.java @@ -9,7 +9,6 @@ import org.briarproject.api.crypto.SecretKey; import org.briarproject.api.db.DbClosedException; import org.briarproject.api.db.DbException; import org.briarproject.api.db.Metadata; -import org.briarproject.api.db.StorageStatus; import org.briarproject.api.identity.Author; import org.briarproject.api.identity.AuthorId; import org.briarproject.api.identity.LocalAuthor; @@ -48,7 +47,6 @@ import java.util.logging.Logger; import static java.util.logging.Level.WARNING; import static org.briarproject.api.db.Metadata.REMOVE; -import static org.briarproject.api.db.StorageStatus.ADDING; import static org.briarproject.api.sync.ValidationManager.Validity.INVALID; import static org.briarproject.api.sync.ValidationManager.Validity.UNKNOWN; import static org.briarproject.api.sync.ValidationManager.Validity.VALID; @@ -65,8 +63,8 @@ import static org.briarproject.db.ExponentialBackoff.calculateExpiry; */ abstract class JdbcDatabase implements Database<Connection> { - private static final int SCHEMA_VERSION = 20; - private static final int MIN_SCHEMA_VERSION = 20; + private static final int SCHEMA_VERSION = 21; + private static final int MIN_SCHEMA_VERSION = 21; private static final String CREATE_SETTINGS = "CREATE TABLE settings" @@ -82,7 +80,6 @@ abstract class JdbcDatabase implements Database<Connection> { + " publicKey BINARY NOT NULL," + " privateKey BINARY NOT NULL," + " created BIGINT NOT NULL," - + " status INT NOT NULL," + " PRIMARY KEY (authorId))"; private static final String CREATE_CONTACTS = @@ -92,7 +89,6 @@ abstract class JdbcDatabase implements Database<Connection> { + " name VARCHAR NOT NULL," + " publicKey BINARY NOT NULL," + " localAuthorId HASH NOT NULL," - + " status INT NOT NULL," + " PRIMARY KEY (contactId)," + " FOREIGN KEY (localAuthorId)" + " REFERENCES localAuthors (authorId)" @@ -452,14 +448,13 @@ abstract class JdbcDatabase implements Database<Connection> { try { // Create a contact row String sql = "INSERT INTO contacts" - + " (authorId, name, publicKey, localAuthorId, status)" - + " VALUES (?, ?, ?, ?, ?)"; + + " (authorId, name, publicKey, localAuthorId)" + + " VALUES (?, ?, ?, ?)"; ps = txn.prepareStatement(sql); ps.setBytes(1, remote.getId().getBytes()); ps.setString(2, remote.getName()); ps.setBytes(3, remote.getPublicKey()); ps.setBytes(4, local.getBytes()); - ps.setInt(5, ADDING.getValue()); int affected = ps.executeUpdate(); if (affected != 1) throw new DbStateException(); ps.close(); @@ -528,16 +523,15 @@ abstract class JdbcDatabase implements Database<Connection> { throws DbException { PreparedStatement ps = null; try { - String sql = "INSERT INTO localAuthors (authorId, name, publicKey," - + " privateKey, created, status)" - + " VALUES (?, ?, ?, ?, ?, ?)"; + String sql = "INSERT INTO localAuthors" + + " (authorId, name, publicKey, privateKey, created)" + + " VALUES (?, ?, ?, ?, ?)"; ps = txn.prepareStatement(sql); ps.setBytes(1, a.getId().getBytes()); ps.setString(2, a.getName()); ps.setBytes(3, a.getPublicKey()); ps.setBytes(4, a.getPrivateKey()); ps.setLong(5, a.getTimeCreated()); - ps.setInt(6, a.getStatus().getValue()); int affected = ps.executeUpdate(); if (affected != 1) throw new DbStateException(); ps.close(); @@ -957,8 +951,7 @@ abstract class JdbcDatabase implements Database<Connection> { PreparedStatement ps = null; ResultSet rs = null; try { - String sql = "SELECT authorId, name, publicKey, localAuthorId," - + " status" + String sql = "SELECT authorId, name, publicKey, localAuthorId" + " FROM contacts" + " WHERE contactId = ?"; ps = txn.prepareStatement(sql); @@ -969,11 +962,10 @@ abstract class JdbcDatabase implements Database<Connection> { String name = rs.getString(2); byte[] publicKey = rs.getBytes(3); AuthorId localAuthorId = new AuthorId(rs.getBytes(4)); - StorageStatus status = StorageStatus.fromValue(rs.getInt(5)); rs.close(); ps.close(); Author author = new Author(authorId, name, publicKey); - return new Contact(c, author, localAuthorId, status); + return new Contact(c, author, localAuthorId); } catch (SQLException e) { tryToClose(rs); tryToClose(ps); @@ -1007,7 +999,7 @@ abstract class JdbcDatabase implements Database<Connection> { ResultSet rs = null; try { String sql = "SELECT contactId, authorId, name, publicKey," - + " localAuthorId, status" + + " localAuthorId" + " FROM contacts"; ps = txn.prepareStatement(sql); rs = ps.executeQuery(); @@ -1019,9 +1011,7 @@ abstract class JdbcDatabase implements Database<Connection> { byte[] publicKey = rs.getBytes(4); Author author = new Author(authorId, name, publicKey); AuthorId localAuthorId = new AuthorId(rs.getBytes(5)); - StorageStatus status = StorageStatus.fromValue(rs.getInt(6)); - contacts.add(new Contact(contactId, author, localAuthorId, - status)); + contacts.add(new Contact(contactId, author, localAuthorId)); } rs.close(); ps.close(); @@ -1108,7 +1098,7 @@ abstract class JdbcDatabase implements Database<Connection> { PreparedStatement ps = null; ResultSet rs = null; try { - String sql = "SELECT name, publicKey, privateKey, created, status" + String sql = "SELECT name, publicKey, privateKey, created" + " FROM localAuthors" + " WHERE authorId = ?"; ps = txn.prepareStatement(sql); @@ -1119,9 +1109,8 @@ abstract class JdbcDatabase implements Database<Connection> { byte[] publicKey = rs.getBytes(2); byte[] privateKey = rs.getBytes(3); long created = rs.getLong(4); - StorageStatus status = StorageStatus.fromValue(rs.getInt(5)); LocalAuthor localAuthor = new LocalAuthor(a, name, publicKey, - privateKey, created, status); + privateKey, created); if (rs.next()) throw new DbStateException(); rs.close(); ps.close(); @@ -1138,8 +1127,7 @@ abstract class JdbcDatabase implements Database<Connection> { PreparedStatement ps = null; ResultSet rs = null; try { - String sql = "SELECT authorId, name, publicKey, privateKey," - + " created, status" + String sql = "SELECT authorId, name, publicKey, privateKey, created" + " FROM localAuthors"; ps = txn.prepareStatement(sql); rs = ps.executeQuery(); @@ -1150,9 +1138,8 @@ abstract class JdbcDatabase implements Database<Connection> { byte[] publicKey = rs.getBytes(3); byte[] privateKey = rs.getBytes(4); long created = rs.getLong(5); - StorageStatus status = StorageStatus.fromValue(rs.getInt(6)); authors.add(new LocalAuthor(authorId, name, publicKey, - privateKey, created, status)); + privateKey, created)); } rs.close(); ps.close(); @@ -2041,41 +2028,6 @@ abstract class JdbcDatabase implements Database<Connection> { } } - public void setContactStatus(Connection txn, ContactId c, StorageStatus s) - throws DbException { - PreparedStatement ps = null; - try { - String sql = "UPDATE contacts SET status = ? WHERE contactId = ?"; - ps = txn.prepareStatement(sql); - ps.setInt(1, s.getValue()); - ps.setInt(2, c.getInt()); - int affected = ps.executeUpdate(); - if (affected < 0 || affected > 1) throw new DbStateException(); - ps.close(); - } catch (SQLException e) { - tryToClose(ps); - throw new DbException(e); - } - } - - public void setLocalAuthorStatus(Connection txn, AuthorId a, - StorageStatus s) throws DbException { - PreparedStatement ps = null; - try { - String sql = "UPDATE localAuthors SET status = ?" - + " WHERE authorId = ?"; - ps = txn.prepareStatement(sql); - ps.setInt(1, s.getValue()); - ps.setBytes(2, a.getBytes()); - int affected = ps.executeUpdate(); - if (affected < 0 || affected > 1) throw new DbStateException(); - ps.close(); - } catch (SQLException e) { - tryToClose(ps); - throw new DbException(e); - } - } - public void setMessageShared(Connection txn, MessageId m, boolean shared) throws DbException { PreparedStatement ps = null; diff --git a/briar-core/src/org/briarproject/identity/AuthorFactoryImpl.java b/briar-core/src/org/briarproject/identity/AuthorFactoryImpl.java index 87c03a5995b19cf9615d3ed77bf530eb45bdc036..b745f5e003b5f388d8c6de4a12fb04e705579bac 100644 --- a/briar-core/src/org/briarproject/identity/AuthorFactoryImpl.java +++ b/briar-core/src/org/briarproject/identity/AuthorFactoryImpl.java @@ -14,8 +14,6 @@ import java.io.IOException; import javax.inject.Inject; -import static org.briarproject.api.db.StorageStatus.ADDING; - class AuthorFactoryImpl implements AuthorFactory { private final CryptoComponent crypto; @@ -37,7 +35,7 @@ class AuthorFactoryImpl implements AuthorFactory { public LocalAuthor createLocalAuthor(String name, byte[] publicKey, byte[] privateKey) { return new LocalAuthor(getId(name, publicKey), name, publicKey, - privateKey, clock.currentTimeMillis(), ADDING); + privateKey, clock.currentTimeMillis()); } private AuthorId getId(String name, byte[] publicKey) { diff --git a/briar-core/src/org/briarproject/identity/IdentityManagerImpl.java b/briar-core/src/org/briarproject/identity/IdentityManagerImpl.java index 49929799b3039066370db5ec645129efd927b0ed..0ae2e5aa584958e721a91befb21d0ef648337a0a 100644 --- a/briar-core/src/org/briarproject/identity/IdentityManagerImpl.java +++ b/briar-core/src/org/briarproject/identity/IdentityManagerImpl.java @@ -4,21 +4,15 @@ import com.google.inject.Inject; import org.briarproject.api.db.DatabaseComponent; import org.briarproject.api.db.DbException; -import org.briarproject.api.db.NoSuchLocalAuthorException; import org.briarproject.api.db.Transaction; import org.briarproject.api.identity.AuthorId; import org.briarproject.api.identity.IdentityManager; import org.briarproject.api.identity.LocalAuthor; -import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; -import static org.briarproject.api.db.StorageStatus.ACTIVE; -import static org.briarproject.api.db.StorageStatus.REMOVING; - class IdentityManagerImpl implements IdentityManager { private final DatabaseComponent db; @@ -49,7 +43,6 @@ class IdentityManagerImpl implements IdentityManager { db.addLocalAuthor(txn, localAuthor); for (AddIdentityHook hook : addHooks) hook.addingIdentity(txn, localAuthor); - db.setLocalAuthorStatus(txn, localAuthor.getId(), ACTIVE); txn.setComplete(); } finally { db.endTransaction(txn); @@ -66,8 +59,7 @@ class IdentityManagerImpl implements IdentityManager { } finally { db.endTransaction(txn); } - if (author.getStatus().equals(ACTIVE)) return author; - throw new NoSuchLocalAuthorException(); + return author; } @Override @@ -80,11 +72,7 @@ class IdentityManagerImpl implements IdentityManager { } finally { db.endTransaction(txn); } - // Filter out any pseudonyms that are being added or removed - List<LocalAuthor> active = new ArrayList<LocalAuthor>(authors.size()); - for (LocalAuthor a : authors) - if (a.getStatus().equals(ACTIVE)) active.add(a); - return Collections.unmodifiableList(active); + return authors; } @Override @@ -92,7 +80,6 @@ class IdentityManagerImpl implements IdentityManager { Transaction txn = db.startTransaction(); try { LocalAuthor localAuthor = db.getLocalAuthor(txn, a); - db.setLocalAuthorStatus(txn, a, REMOVING); for (RemoveIdentityHook hook : removeHooks) hook.removingIdentity(txn, localAuthor); db.removeLocalAuthor(txn, a); diff --git a/briar-tests/src/org/briarproject/db/DatabaseComponentImplTest.java b/briar-tests/src/org/briarproject/db/DatabaseComponentImplTest.java index a56542d38f28f542cf90237815945e34b4986576..b981550757b103508ea9efee6f26e6db8210cf6b 100644 --- a/briar-tests/src/org/briarproject/db/DatabaseComponentImplTest.java +++ b/briar-tests/src/org/briarproject/db/DatabaseComponentImplTest.java @@ -13,7 +13,6 @@ import org.briarproject.api.db.NoSuchGroupException; import org.briarproject.api.db.NoSuchLocalAuthorException; import org.briarproject.api.db.NoSuchMessageException; import org.briarproject.api.db.NoSuchTransportException; -import org.briarproject.api.db.StorageStatus; import org.briarproject.api.db.Transaction; import org.briarproject.api.event.ContactAddedEvent; import org.briarproject.api.event.ContactRemovedEvent; @@ -97,8 +96,7 @@ public class DatabaseComponentImplTest extends BriarTestCase { localAuthorId = new AuthorId(TestUtils.getRandomId()); long timestamp = System.currentTimeMillis(); localAuthor = new LocalAuthor(localAuthorId, "Bob", - new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp, - StorageStatus.ACTIVE); + new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp); messageId = new MessageId(TestUtils.getRandomId()); messageId1 = new MessageId(TestUtils.getRandomId()); size = 1234; @@ -109,8 +107,7 @@ public class DatabaseComponentImplTest extends BriarTestCase { transportId = new TransportId("id"); maxLatency = Integer.MAX_VALUE; contactId = new ContactId(234); - contact = new Contact(contactId, author, localAuthorId, - StorageStatus.ACTIVE); + contact = new Contact(contactId, author, localAuthorId); } private DatabaseComponent createDatabaseComponent(Database<Object> database, diff --git a/briar-tests/src/org/briarproject/db/H2DatabaseTest.java b/briar-tests/src/org/briarproject/db/H2DatabaseTest.java index 1e880356b2adddadf63a084acb8b6a7223f5c4a8..34a91d63c0e54037593038b7d2795c2df5b7fac3 100644 --- a/briar-tests/src/org/briarproject/db/H2DatabaseTest.java +++ b/briar-tests/src/org/briarproject/db/H2DatabaseTest.java @@ -8,7 +8,6 @@ import org.briarproject.api.contact.ContactId; import org.briarproject.api.crypto.SecretKey; import org.briarproject.api.db.DbException; import org.briarproject.api.db.Metadata; -import org.briarproject.api.db.StorageStatus; import org.briarproject.api.identity.Author; import org.briarproject.api.identity.AuthorId; import org.briarproject.api.identity.LocalAuthor; @@ -87,8 +86,7 @@ public class H2DatabaseTest extends BriarTestCase { localAuthorId = new AuthorId(TestUtils.getRandomId()); timestamp = System.currentTimeMillis(); localAuthor = new LocalAuthor(localAuthorId, "Bob", - new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp, - StorageStatus.ACTIVE); + new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp); messageId = new MessageId(TestUtils.getRandomId()); size = 1234; raw = new byte[size]; @@ -1060,8 +1058,7 @@ public class H2DatabaseTest extends BriarTestCase { throws Exception { AuthorId localAuthorId1 = new AuthorId(TestUtils.getRandomId()); LocalAuthor localAuthor1 = new LocalAuthor(localAuthorId1, "Carol", - new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp, - StorageStatus.ACTIVE); + new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp); Database<Connection> db = open(false); Connection txn = db.startTransaction(); diff --git a/briar-tests/src/org/briarproject/sync/SimplexMessagingIntegrationTest.java b/briar-tests/src/org/briarproject/sync/SimplexMessagingIntegrationTest.java index bfb815c2d52c1d0a4042278f1d4f641a84423f80..2c3cc4348ffaaf77234df32c5ef3e0f5b711ba93 100644 --- a/briar-tests/src/org/briarproject/sync/SimplexMessagingIntegrationTest.java +++ b/briar-tests/src/org/briarproject/sync/SimplexMessagingIntegrationTest.java @@ -12,7 +12,6 @@ import org.briarproject.api.contact.ContactId; import org.briarproject.api.contact.ContactManager; import org.briarproject.api.crypto.SecretKey; import org.briarproject.api.db.DatabaseComponent; -import org.briarproject.api.db.StorageStatus; import org.briarproject.api.db.Transaction; import org.briarproject.api.event.Event; import org.briarproject.api.event.EventBus; @@ -130,8 +129,7 @@ public class SimplexMessagingIntegrationTest extends BriarTestCase { } // Add an identity for Alice LocalAuthor aliceAuthor = new LocalAuthor(aliceId, "Alice", - new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp, - StorageStatus.ADDING); + new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp); identityManager.addLocalAuthor(aliceAuthor); // Add Bob as a contact Author bobAuthor = new Author(bobId, "Bob", @@ -201,8 +199,7 @@ public class SimplexMessagingIntegrationTest extends BriarTestCase { } // Add an identity for Bob LocalAuthor bobAuthor = new LocalAuthor(bobId, "Bob", - new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp, - StorageStatus.ADDING); + new byte[MAX_PUBLIC_KEY_LENGTH], new byte[123], timestamp); identityManager.addLocalAuthor(bobAuthor); // Add Alice as a contact Author aliceAuthor = new Author(aliceId, "Alice",