Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.rss
Class RssFeedReader

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.rss.RssFeedReader

public class RssFeedReader
extends Object

Wrapper class for the ROME functionality used in the RSS implementation in SIP Communicator. The class provides the means for identifying feed items, formatting and displaying the actual feed items.

Author:
Jean-Albert Vescovo, Mihai Balan, Vincent Lucas

Constructor Summary
RssFeedReader(URL contactRssURL)
          Creates an instance of a RSS reader with the specified string used as an URL for the actual feed.
 
Method Summary
static RssFeedReader deserialize(URL contactRssURL, String settings)
           
 com.sun.syndication.feed.synd.SyndFeed getFeed()
          Returns a ChannelIF that can be used to know if a feed exists indeed.
 RssItemKey getLastItemKey()
          Return the key for the last item retrieved.
 String getNewFeeds()
          Returns the textual representation of the feed's items with regard to the key of the last item shown to the user.
 String getNoNewFeedString()
           
 Date getPubDate()
          Returns a Date giving the publication date of the feed on the relevant server.
 String getTitle()
          Returns a String used as a display name.
 String getURL()
          Returns a String that can be used for identifying the contact.
 String serialize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RssFeedReader

public RssFeedReader(URL contactRssURL)
              throws OperationFailedException,
                     FileNotFoundException
Creates an instance of a RSS reader with the specified string used as an URL for the actual feed.

Parameters:
contactRssURL - the URL of this feed.
Throws:
OperationFailedException
FileNotFoundException
Method Detail

getNewFeeds

public String getNewFeeds()
                   throws OperationFailedException,
                          FileNotFoundException
Returns the textual representation of the feed's items with regard to the key of the last item shown to the user. The items are sorted in reverse chronological order, if possible.

Returns:
textual representation of the feed items.
Throws:
OperationFailedException
FileNotFoundException

getNoNewFeedString

public String getNoNewFeedString()

getLastItemKey

public RssItemKey getLastItemKey()
Return the key for the last item retrieved.

Returns:
key of the last item retrieved.

getFeed

public com.sun.syndication.feed.synd.SyndFeed getFeed()
Returns a ChannelIF that can be used to know if a feed exists indeed.

Returns:
a ChannelIF containing the result of a query on a RSS server.

getPubDate

public Date getPubDate()
Returns a Date giving the publication date of the feed on the relevant server. In most case, this date doesn't exist on the server. Not used at this time in this implementation.

Returns:
a Date representing the publication date of the feed.

getTitle

public String getTitle()
Returns a String used as a display name.

Returns:
a String title representing the feed/contact.

getURL

public String getURL()
Returns a String that can be used for identifying the contact. We'll prefer to use the title of the feed as display name.

Returns:
a String id representing and uniquely identifying the contact.

serialize

public String serialize()

deserialize

public static RssFeedReader deserialize(URL contactRssURL,
                                        String settings)
                                 throws OperationFailedException,
                                        FileNotFoundException
Throws:
OperationFailedException
FileNotFoundException

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.