- lock.readLock().lock();
- try {
- Collection<Post> posts = recipientPosts.get(recipientId);
- return (posts == null) ? Collections.<Post>emptySet() : new HashSet<Post>(posts);
- } finally {
- lock.readLock().unlock();
- }
+ return memoryPostDatabase.getDirectedPosts(recipientId);
+ }
+
+ /**
+ * Returns whether the given post is known.
+ *
+ * @param post
+ * The post
+ * @return {@code true} if the post is known, {@code false} otherwise
+ */
+ @Override
+ public boolean isPostKnown(Post post) {
+ return memoryPostDatabase.isPostKnown(post);
+ }
+
+ /**
+ * Sets whether the given post is known.
+ *
+ * @param post
+ * The post
+ */
+ @Override
+ public void setPostKnown(Post post) {
+ memoryPostDatabase.setPostKnown(post);
+ }
+
+ @Override
+ public void likePost(Post post, Sone localSone) {
+ memoryPostDatabase.likePost(post, localSone);
+ }
+
+ @Override
+ public void unlikePost(Post post, Sone localSone) {
+ memoryPostDatabase.unlikePost(post, localSone);
+ }
+
+ public boolean isLiked(Post post, Sone sone) {
+ return memoryPostDatabase.isLiked(post, sone);
+ }
+
+ @Override
+ public Set<Sone> getLikes(Post post) {
+ return memoryPostDatabase.getLikes(post);