Move getSones() method to Sone provider interface.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 29 Jan 2013 05:43:37 +0000 (06:43 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 29 Jan 2013 05:52:42 +0000 (06:52 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java
src/main/java/net/pterodactylus/sone/database/SoneProvider.java
src/main/java/net/pterodactylus/sone/web/SearchPage.java

index 4d39c10..de6ba55 100644 (file)
@@ -347,11 +347,10 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
        }
 
        /**
-        * Returns all Sones, remote and local.
-        *
-        * @return All Sones
+        * {@inheritDocs}
         */
-       public Set<Sone> getSones() {
+       @Override
+       public Collection<Sone> getSones() {
                synchronized (sones) {
                        return Collections.unmodifiableCollection(sones.values());
                }
index bbe0abf..f484aaf 100644 (file)
@@ -17,6 +17,8 @@
 
 package net.pterodactylus.sone.database;
 
+import java.util.Collection;
+
 import net.pterodactylus.sone.data.Sone;
 
 import com.google.common.base.Optional;
@@ -38,4 +40,11 @@ public interface SoneProvider {
         */
        public Optional<Sone> getSone(String soneId);
 
+       /**
+        * Returns all Sones.
+        *
+        * @return All Sones
+        */
+       public Collection<Sone> getSones();
+
 }
index 320e7cd..01a5ed0 100644 (file)
@@ -131,7 +131,7 @@ public class SearchPage extends SoneTemplatePage {
                        redirectIfNotNull(getImageId(phrase), "imageBrowser.html?image=");
                }
 
-               Set<Sone> sones = webInterface.getCore().getSones();
+               Collection<Sone> sones = webInterface.getCore().getSones();
                Collection<Hit<Sone>> soneHits = getHits(sones, phrases, SoneStringGenerator.COMPLETE_GENERATOR);
 
                Collection<Hit<Post>> postHits = hitCache.getUnchecked(phrases);