Add database method for retrieving a contact by author ID

and use it for retreiving the status of an author faster.
Also add tests for both.
This commit is contained in:
Torsten Grote
2016-08-31 16:49:02 -03:00
parent 61c05c1dd4
commit 6f0ffa8439
7 changed files with 197 additions and 11 deletions

View File

@@ -176,6 +176,14 @@ public interface DatabaseComponent {
*/
Collection<Contact> getContacts(Transaction txn) throws DbException;
/**
* Returns a possibly empty collection of contacts with the given author ID.
* <p/>
* Read-only.
*/
Collection<Contact> getContactsByAuthorId(Transaction txn, AuthorId remote)
throws DbException;
/**
* Returns all contacts associated with the given local pseudonym.
* <p/>