info.magnolia.module.rssaggregator.importhandler
Class SimpleRSSFeedFetcher

java.lang.Object
  extended by info.magnolia.module.rssaggregator.importhandler.SimpleRSSFeedFetcher
All Implemented Interfaces:
RSSFeedFetcher

public class SimpleRSSFeedFetcher
extends Object
implements RSSFeedFetcher

A simple single threaded RSSFeedFetcher for feed retrieval http that follows redirects and supports conditional gets.

Will attempt to fetch all feed channels defined in the provided aggregate feeds. Failures to fetch a feed result for a given feed channel are logged at ERROR level.

Because of the single threaded nature of this implementation, it is suited for situations where the number feed channels to retrieve is small and the time window between update checks is large enough.

For more demanding situations, use a more performant RSSFeedFetcher implementation.

Author:
Rob van der Linden Vooren
See Also:
RSSFeedFetcher

Constructor Summary
SimpleRSSFeedFetcher()
           
 
Method Summary
 Set<AggregateFeed> fetchAggregateFeeds(Set<AggregateFeed> aggregateFeeds)
          Fetch feeds for channels of provided aggregates.
protected  com.sun.syndication.feed.synd.SyndFeed fetchFeedChannel(FeedChannel channel)
          Fetch the given feed channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleRSSFeedFetcher

public SimpleRSSFeedFetcher()
Method Detail

fetchAggregateFeeds

public Set<AggregateFeed> fetchAggregateFeeds(Set<AggregateFeed> aggregateFeeds)
Description copied from interface: RSSFeedFetcher
Fetch feeds for channels of provided aggregates.

Specified by:
fetchAggregateFeeds in interface RSSFeedFetcher
Parameters:
aggregateFeeds - the aggregates to fetch feed content for (must not be null)
Returns:
the aggregates holding resulting feed content from the fetch

fetchFeedChannel

protected com.sun.syndication.feed.synd.SyndFeed fetchFeedChannel(FeedChannel channel)
Fetch the given feed channel. A failed fetch results in a null feed property set.

Parameters:
channel - the feed channel to fetch
Returns:
the feed channel with its feed property set to the result of the fetch


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.