- * Returns all posts that have the given Sone as recipient.
- *
- * @see Post#getRecipient()
- * @param recipient
- * The recipient of the posts
- * @return All posts that have the given Sone as recipient
- */
- public Set<Post> getDirectedPosts(Sone recipient) {
- checkNotNull(recipient, "recipient must not be null");
- Set<Post> directedPosts = new HashSet<Post>();
- synchronized (posts) {
- for (Post post : posts.values()) {
- if (recipient.equals(post.getRecipient())) {
- directedPosts.add(post);
- }
- }
- }
- return directedPosts;
+ * {@inheritDocs}
+ */
+ @Override
+ public Collection<Post> getPosts(String soneId) {
+ return postDatabase.getPosts(soneId);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Collection<Post> getDirectedPosts(final String recipientId) {
+ checkNotNull(recipientId, "recipient must not be null");
+ return postDatabase.getDirectedPosts(recipientId);