Allow blog posts to be loaded within one transaction

This commit is contained in:
Torsten Grote
2021-01-11 16:33:07 -03:00
parent ae923e5777
commit ad20e5230a
2 changed files with 41 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import java.util.Collection;
import java.util.List;
import javax.annotation.Nullable;
@@ -98,6 +99,11 @@ public interface BlogManager {
*/
Collection<Blog> getBlogs() throws DbException;
/**
* Returns the group IDs of all blogs to which the user subscribes.
*/
Collection<GroupId> getBlogIds(Transaction txn) throws DbException;
/**
* Returns the header of the blog post with the given ID.
*/
@@ -108,11 +114,22 @@ public interface BlogManager {
*/
String getPostText(MessageId m) throws DbException;
/**
* Returns the text of the blog post with the given ID.
*/
String getPostText(Transaction txn, MessageId m) throws DbException;
/**
* Returns the headers of all posts in the given blog.
*/
Collection<BlogPostHeader> getPostHeaders(GroupId g) throws DbException;
/**
* Returns the headers of all posts in the given blog.
*/
List<BlogPostHeader> getPostHeaders(Transaction txn, GroupId g)
throws DbException;
/**
* Marks a blog post as read or unread.
*/