Merge branch '555-blog-controller' into 'master'

Blog controller thread safety

This patch removes the mutable list of posts from the blog controller to make it thread-safe, and adds a cache of message bodies to speed up reloads.

Closes #555.

See merge request !276
This commit is contained in:
Torsten Grote
2016-08-24 19:36:06 +00:00
12 changed files with 405 additions and 297 deletions

View File

@@ -7,7 +7,6 @@ import org.briarproject.api.identity.LocalAuthor;
import org.briarproject.api.sync.ClientId;
import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.MessageId;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
@@ -47,8 +46,10 @@ public interface BlogManager {
/** Returns all blogs to which the user subscribes. */
Collection<Blog> getBlogs() throws DbException;
/** Returns the header of the blog post with the given ID. */
BlogPostHeader getPostHeader(MessageId m) throws DbException;
/** Returns the body of the blog post with the given ID. */
@Nullable
byte[] getPostBody(MessageId m) throws DbException;
/** Returns the headers of all posts in the given blog. */