info.magnolia.module.rssaggregator.importhandler
Class FeedChannel

java.lang.Object
  extended by info.magnolia.module.rssaggregator.importhandler.FeedChannel

public class FeedChannel
extends Object

A named feed channel that typically belongs to an AggregateFeed. Knows the url on which a given RSS or ATOM feed resides and holds the feed that was fetched after succesful retrieval by a RSSFeedFetcher.

Author:
Rob van der Linden Vooren
See Also:
AggregateFeed, RSSFeedFetcher, SyndFeed

Constructor Summary
FeedChannel(String name, String url, String title)
          Create a new feed channel from the given name, url and title.
 
Method Summary
 boolean equals(Object o)
          
 com.sun.syndication.feed.synd.SyndFeed getFeed()
          Return the feed (fetch result) for this feed channel.
 String getName()
          Return the name of the feed channel.
 String getTitle()
          Return the title of the feed channel.
 String getUrl()
          Return the url which points to the RSS or ATOM feed for this feed channel.
 boolean hasFeed()
          Return true when this feed channel contains a feed, false otherwise.
 int hashCode()
          
 void setFeed(com.sun.syndication.feed.synd.SyndFeed feed)
          Set the feed (fetch result) for this feed channel.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeedChannel

public FeedChannel(String name,
                   String url,
                   String title)
Create a new feed channel from the given name, url and title.

Parameters:
name - the name of the feed channel (e.g.: 'channel-0')
url - the url of the feed channel (e.g.: 'http://robl.jteam.nl/?feed=rss2'
title - the title of the feed channel (e.g.: 'I'll take the red pill ...')
Throws:
IllegalArgumentException - if the given name or url provided is blank, or title is null
Method Detail

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object

hasFeed

public boolean hasFeed()
Return true when this feed channel contains a feed, false otherwise.

Returns:
true when this feed channel contains a feed, false otherwise

getName

public String getName()
Return the name of the feed channel.

Returns:
the name of the feed channel

getUrl

public String getUrl()
Return the url which points to the RSS or ATOM feed for this feed channel.

Returns:
the url which points to the RSS or ATOM feed for this feed channel

getTitle

public String getTitle()
Return the title of the feed channel.

Returns:
the title of the feed channel

setFeed

public void setFeed(com.sun.syndication.feed.synd.SyndFeed feed)
Set the feed (fetch result) for this feed channel.

Parameters:
feed - the feed (fetch result) for this feed channel (must not be null)
Throws:
IllegalArgumentException - if the given feed is null

getFeed

public com.sun.syndication.feed.synd.SyndFeed getFeed()
Return the feed (fetch result) for this feed channel.

Returns:
the feed (fetch result) for this feed channel or null if no result was set


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