From 10fa1478fef15624a873c0878ed017603742bcfe Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 2 Feb 2013 22:48:56 +0100 Subject: [PATCH] Add method to get all posts of a Sone to post provider interface. --- src/main/java/net/pterodactylus/sone/core/Core.java | 8 ++++++++ src/main/java/net/pterodactylus/sone/database/PostProvider.java | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 0571e0d..9ccaa79 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -512,6 +512,14 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, } /** + * {@inheritDocs} + */ + @Override + public Collection getPosts(String soneId) { + return postDatabase.getPosts(soneId); + } + + /** * {@inheritDoc} */ @Override diff --git a/src/main/java/net/pterodactylus/sone/database/PostProvider.java b/src/main/java/net/pterodactylus/sone/database/PostProvider.java index 13845da..740373e 100644 --- a/src/main/java/net/pterodactylus/sone/database/PostProvider.java +++ b/src/main/java/net/pterodactylus/sone/database/PostProvider.java @@ -40,6 +40,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() -- 2.7.4