final Post post = postBuilder.build();
database.storePost(post);
eventBus.post(new NewPostFoundEvent(post));
- sone.addPost(post);
touchConfiguration();
localElementTicker.schedule(new MarkPostKnown(post), 10, TimeUnit.SECONDS);
return post;
List<Post> getPosts();
/**
- * Adds the given post to this Sone. The post will not be added if its {@link
- * Post#getSone() Sone} is not this Sone.
- *
- * @param post
- * The post to add
- */
- void addPost(Post post);
-
- /**
- * Removes the given post from this Sone.
- *
- * @param post
- * The post to remove
- */
- void removePost(Post post);
-
- /**
* Returns all replies this Sone made.
*
* @return All replies this Sone made
}
@Override
- public void addPost(Post post) {
- }
-
- @Override
- public void removePost(Post post) {
- }
-
- @Override
public Set<PostReply> getReplies() {
return emptySet();
}
}
/**
- * Adds the given post to this Sone. The post will not be added if its {@link
- * Post#getSone() Sone} is not this Sone.
- *
- * @param post
- * The post to add
- */
- public void addPost(Post post) {
- if (post.getSone().equals(this) && posts.add(post)) {
- logger.log(Level.FINEST, String.format("Adding %s to “%s”.", post, getName()));
- }
- }
-
- /**
- * Removes the given post from this Sone.
- *
- * @param post
- * The post to remove
- */
- public void removePost(Post post) {
- if (post.getSone().equals(this)) {
- posts.remove(post);
- }
- }
-
- /**
* Returns all replies this Sone made.
*
* @return All replies this Sone made