Create local state for clients at startup. #279

This commit is contained in:
akwizgran
2016-04-01 15:51:57 +01:00
parent 845d3fa47e
commit 945b5eb1ac
20 changed files with 209 additions and 105 deletions

View File

@@ -44,6 +44,7 @@ public interface DatabaseComponent {
* <p/>
* This method acquires locks, so it must not be called while holding a
* lock.
*
* @param readOnly true if the transaction will only be used for reading.
*/
Transaction startTransaction(boolean readOnly) throws DbException;
@@ -90,13 +91,27 @@ public interface DatabaseComponent {
void addTransportKeys(Transaction txn, ContactId c, TransportKeys k)
throws DbException;
/**
* Returns true if the database contains the given contact for the given
* local pseudonym.
*/
boolean containsContact(Transaction txn, AuthorId remote, AuthorId local)
throws DbException;
/**
* Returns true if the database contains the given group.
*/
boolean containsGroup(Transaction txn, GroupId g) throws DbException;
/**
* Deletes the message with the given ID. The message ID and any other
* associated data are not deleted.
*/
void deleteMessage(Transaction txn, MessageId m) throws DbException;
/** Deletes any metadata associated with the given message. */
/**
* Deletes any metadata associated with the given message.
*/
void deleteMessageMetadata(Transaction txn, MessageId m) throws DbException;
/**
@@ -162,13 +177,6 @@ public interface DatabaseComponent {
Collection<ContactId> getContacts(Transaction txn, AuthorId a)
throws DbException;
/**
* Returns true if the database contains the given contact for the given
* local pseudonym.
*/
boolean containsContact(Transaction txn, AuthorId remote, AuthorId local)
throws DbException;
/**
* Returns the unique ID for this device.
* <p/>
@@ -359,7 +367,7 @@ public interface DatabaseComponent {
* Marks the given contact as active or inactive.
*/
void setContactActive(Transaction txn, ContactId c, boolean active)
throws DbException;
throws DbException;
/**
* Marks the given message as shared or unshared.