X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdatabase%2FPostProvider.java;h=bea59b9cbdff71a1d62b011ee5dc32f7cb62f509;hp=13845daa06a6737ff18db35db6f0b6e92c5d698d;hb=d920774a69518c31b5e66d36b830bcf95a5ec237;hpb=8f02544d31f323ae9053dd9a11a99eacd8cf5bcd diff --git a/src/main/java/net/pterodactylus/sone/database/PostProvider.java b/src/main/java/net/pterodactylus/sone/database/PostProvider.java index 13845da..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,14 +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 { /** @@ -40,6 +43,15 @@ public interface PostProvider { 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. * * @see Post#getRecipient()