org.jperdian.rss2
Class RssClient

java.lang.Object
  |
  +--org.jperdian.rss2.RssClient

public class RssClient
extends java.lang.Object

Implementation of a connector that can be used to read RSS channel data and transform them into a valid RSS DOM object

Author:
Christian Robert

Constructor Summary
RssClient(java.net.URL url)
          Creates a new client that receives it's data from the given URL
RssClient(java.net.URL url, java.lang.String keywords, java.lang.String title)
          Creates a new client that receives it's data from the given URL
 
Method Summary
 RssChannel getData()
          Reads the data from the remote RSS source and create a new RssChannel object that contains the data that has been read
 java.lang.String getKeywords()
          Gets the keywords to be used for sorting the current client
protected  RssParser getParser()
          Gets the RssParser through which the messages are analyzed
 java.lang.String getTitle()
          Gets the title to be used for sorting the current client
 java.net.URL getURL()
          Gets the URL from which to read the data
 void loadData(RssChannel channel)
          Loads the data into the given RssChannel
protected  void setKeywords(java.lang.String keywords)
          Sets the keywords to be used for sorting the current client
protected  void setTitle(java.lang.String title)
          Sets the title to be used for sorting the current client
protected  void setURL(java.net.URL url)
          Sets the URL from which to read the data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RssClient

public RssClient(java.net.URL url)
Creates a new client that receives it's data from the given URL

Parameters:
url - the URL from which to receive the data

RssClient

public RssClient(java.net.URL url,
                 java.lang.String keywords,
                 java.lang.String title)
Creates a new client that receives it's data from the given URL

Parameters:
url - the URL from which to receive the data
keywords - the keywords that can later be used for sorting
title - the title to be used for display
Method Detail

getData

public final RssChannel getData()
                         throws RssException
Reads the data from the remote RSS source and create a new RssChannel object that contains the data that has been read

Returns:
the data in RSS DOM format
Throws:
RssException - thrown if the data is not in valid RSS format or the connection is unreachable

loadData

public void loadData(RssChannel channel)
              throws RssException
Loads the data into the given RssChannel

RssException

getParser

protected RssParser getParser()
Gets the RssParser through which the messages are analyzed


setURL

protected void setURL(java.net.URL url)
Sets the URL from which to read the data


getURL

public java.net.URL getURL()
Gets the URL from which to read the data


setKeywords

protected void setKeywords(java.lang.String keywords)
Sets the keywords to be used for sorting the current client


getKeywords

public java.lang.String getKeywords()
Gets the keywords to be used for sorting the current client


setTitle

protected void setTitle(java.lang.String title)
Sets the title to be used for sorting the current client


getTitle

public java.lang.String getTitle()
Gets the title to be used for sorting the current client