diff options
author | mcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-21 10:34:37 +0000 |
---|---|---|
committer | mcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-21 10:34:37 +0000 |
commit | 5b4d883b3d365e151392872ed3a2897622c8e159 (patch) | |
tree | 6172c918d9485025d3f1a58fc6beb44e8d46d76f | |
parent | b17facb628587573b6a08f43e315ac17df17d7a2 (diff) |
TUSCANY-3113 - Added get() method to the rss.Collections interface as this is the method that the RSSBindingListenerServlet class is looking for to see if the Java component implementation class supports RSS feeds.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@786986 13f79535-47bb-0310-9956-ffa450edef68
2 files changed, 21 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java b/branches/sca-java-1.x/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java index bb8dab391b..ed86dc4848 100644 --- a/branches/sca-java-1.x/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java +++ b/branches/sca-java-1.x/modules/binding-rss-rome/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java @@ -20,6 +20,7 @@ package org.apache.tuscany.sca.binding.rss.collection; import org.osoa.sca.annotations.Remotable; +import com.sun.syndication.feed.synd.SyndEntry; import com.sun.syndication.feed.synd.SyndFeed; @@ -46,4 +47,12 @@ public interface Collection { */ SyndFeed query(String queryString); + /** + * Retrieves an RSS entry. + * + * @param id The entry ID + * @return The requested entry + * @throws NotFoundException No entry found with the given ID + */ + SyndEntry get(String id) throws NotFoundException; } diff --git a/branches/sca-java-1.x/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java b/branches/sca-java-1.x/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java index 409d3994a6..02d73ab3ae 100644 --- a/branches/sca-java-1.x/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java +++ b/branches/sca-java-1.x/modules/binding-rss-rome/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java @@ -28,6 +28,7 @@ import java.util.Map; import java.util.UUID; import org.apache.tuscany.sca.binding.rss.collection.Collection; +import org.apache.tuscany.sca.binding.rss.collection.NotFoundException; import org.osoa.sca.annotations.Scope; import com.sun.syndication.feed.synd.SyndContent; @@ -98,5 +99,16 @@ public class CustomerCollectionImpl implements Collection { feed.getEntries().addAll(entries.values()); return feed; } + + /** + * {@inheritDoc} + */ + public SyndEntry get(String id) throws NotFoundException { + final SyndEntry entry = entries.get(id); + if (id == null) { + throw new NotFoundException("No entry found with ID " + id); + } + return entry; + } } |