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
This commit is contained in:
parent
b17facb628
commit
5b4d883b3d
2 changed files with 21 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue