X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdatabase%2FPostProvider.java;h=bea59b9cbdff71a1d62b011ee5dc32f7cb62f509;hb=914d5522692e7714ba5bdefb002fedc8e293f5fc;hp=865376bf31e4e01b3a1f12f1b76f4c1b0119c30a;hpb=658a702c550e15bd3c868ed399621606eeb4ef20;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/database/PostProvider.java b/src/main/java/net/pterodactylus/sone/database/PostProvider.java
index 865376b..bea59b9 100644
--- a/src/main/java/net/pterodactylus/sone/database/PostProvider.java
+++ b/src/main/java/net/pterodactylus/sone/database/PostProvider.java
@@ -1,5 +1,5 @@
/*
- * Sone - PostProvider.java - Copyright © 2011â2013 David Roden
+ * Sone - PostProvider.java - Copyright © 2011â2016 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,12 +20,17 @@ package net.pterodactylus.sone.database;
import java.util.Collection;
import net.pterodactylus.sone.data.Post;
+import net.pterodactylus.sone.database.memory.MemoryDatabase;
+
+import com.google.common.base.Optional;
+import com.google.inject.ImplementedBy;
/**
* Interface for objects that can provide {@link Post}s by their ID.
*
* @author David âBombeâ Roden
*/
+@ImplementedBy(MemoryDatabase.class)
public interface PostProvider {
/**
@@ -35,7 +40,16 @@ public interface PostProvider {
* The ID of the post to return
* @return The post with the given ID, or {@code null}
*/
- public Post getPost(String postId);
+ public Optional getPost(String postId);
+
+ /**
+ * Returns all posts from the given Sone.
+ *
+ * @param soneId
+ * The ID of the Sone
+ * @return All posts from the given Sone
+ */
+ public Collection getPosts(String soneId);
/**
* Returns all posts that have the given Sone as recipient.