Remove post management methods from Sone.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 7 Dec 2014 10:33:16 +0000 (11:33 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 7 Dec 2014 10:33:16 +0000 (11:33 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java
src/main/java/net/pterodactylus/sone/data/Sone.java
src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java
src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java

index c3ac305..2e1b5fb 100644 (file)
@@ -949,7 +949,6 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                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;
index 2f529cb..2cf8bf6 100644 (file)
@@ -343,23 +343,6 @@ public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
        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
index ce224fd..018ba32 100644 (file)
@@ -121,14 +121,6 @@ public class IdOnlySone implements Sone {
        }
 
        @Override
-       public void addPost(Post post) {
-       }
-
-       @Override
-       public void removePost(Post post) {
-       }
-
-       @Override
        public Set<PostReply> getReplies() {
                return emptySet();
        }
index eb2fc6e..5d8f1c4 100644 (file)
@@ -363,31 +363,6 @@ public class SoneImpl implements LocalSone {
        }
 
        /**
-        * 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