Add method to get all posts of a Sone to post provider interface.
[Sone.git] / src / main / java / net / pterodactylus / sone / database / SoneProvider.java
index b1b1eb4..993804f 100644 (file)
 
 package net.pterodactylus.sone.database;
 
+import java.util.Collection;
+
 import net.pterodactylus.sone.data.Sone;
 
+import com.google.common.base.Optional;
+
 /**
  * Interface for objects that can provide {@link Sone}s by their ID.
  *
@@ -27,12 +31,34 @@ import net.pterodactylus.sone.data.Sone;
 public interface SoneProvider {
 
        /**
-        * Returns the Sone with the given ID, if it exists.
+        * Returns the Sone with the given ID, or {@link Optional#absent()} if it
+        * does not exist.
         *
         * @param soneId
         *            The ID of the Sone to return
-        * @return The Sone with the given ID, or {@code null}
+        * @return The Sone with the given ID, or {@link Optional#absent()}
+        */
+       public Optional<Sone> getSone(String soneId);
+
+       /**
+        * Returns all Sones.
+        *
+        * @return All Sones
+        */
+       public Collection<Sone> getSones();
+
+       /**
+        * Returns all local Sones.
+        *
+        * @return All local Sones
+        */
+       public Collection<Sone> getLocalSones();
+
+       /**
+        * Returns all remote Sones.
+        *
+        * @return All remote Sones
         */
-       public Sone getSone(String soneId);
+       public Collection<Sone> getRemoteSones();
 
 }