+public interface PostDatabase {
+
+ /**
+ * Returns the post with the given ID.
+ *
+ * @param postId
+ * The ID of the post to return
+ * @return The post with the given ID, or {@code null}
+ */
+ Optional<Post> getPost(String postId);
+
+ /**
+ * Returns all posts from the given Sone.
+ *
+ * @param soneId
+ * The ID of the Sone
+ * @return All posts from the given Sone
+ */
+ Collection<Post> getPosts(String soneId);
+
+ /**
+ * Returns all posts that have the given Sone as recipient.
+ *
+ * @see Post#getRecipient()
+ * @param recipientId
+ * The ID of the recipient of the posts
+ * @return All posts that have the given Sone as recipient
+ */
+ Collection<Post> getDirectedPosts(String recipientId);
+
+ /**
+ * Adds the given post to the store.
+ *
+ * @param post
+ * The post to store
+ */
+ void storePost(Post post);
+
+ /**
+ * Removes the given post.
+ *
+ * @param post
+ * The post to remove
+ */
+ void removePost(Post post);
+
+ /**
+ * Stores the given posts as all posts of a single {@link Sone}. This method
+ * will removed all other posts from the Sone!
+ *
+ * @param sone
+ * The Sone to store the posts for
+ * @param posts
+ * The posts to store
+ * @throws IllegalArgumentException
+ * if posts do not all belong to the same Sone
+ */
+ void storePosts(Sone sone, Collection<Post> posts) throws IllegalArgumentException;