com.sun.syndication.fetcher
Interface FeedFetcher

All Known Implementing Classes:
AbstractFeedFetcher, HttpClientFeedFetcher, HttpURLFeedFetcher

public interface FeedFetcher


Field Summary
static java.lang.String DEFAULT_USER_AGENT
          The default user agent.
 
Method Summary
 void addFetcherEventListener(FetcherListener listener)
          Add a FetcherListener.
 java.lang.String getUserAgent()
           
 boolean isUsingDeltaEncoding()
          Is this fetcher using rfc3229 delta encoding?
 void removeFetcherEventListener(FetcherListener listener)
          Remove a FetcherListener
 com.sun.syndication.feed.synd.SyndFeed retrieveFeed(java.net.URL feedUrl)
          Retrieve a feed over HTTP
 void setPreserveWireFeed(boolean preserveWireFeed)
          If set to true, the WireFeed will be made accessible from the SyndFeed object returned from the Fetcher via the originalWireFeed() method.
 void setUserAgent(java.lang.String string)
           
 void setUsingDeltaEncoding(boolean useDeltaEncoding)
          Turn on or off rfc3229 delta encoding
 

Field Detail

DEFAULT_USER_AGENT

static final java.lang.String DEFAULT_USER_AGENT

The default user agent. It is not marked final so buggy java compiler will not write this string into all classes that reference it.

http://tinyurl.com/64t5n points to https://rome.dev.java.net/ Some servers ban user agents with "Java" in the name.

See Also:
Constant Field Values
Method Detail

getUserAgent

java.lang.String getUserAgent()
Returns:
the User-Agent currently being sent to servers

setUserAgent

void setUserAgent(java.lang.String string)
Parameters:
string - The User-Agent to sent to servers

retrieveFeed

com.sun.syndication.feed.synd.SyndFeed retrieveFeed(java.net.URL feedUrl)
                                                    throws java.lang.IllegalArgumentException,
                                                           java.io.IOException,
                                                           com.sun.syndication.io.FeedException,
                                                           FetcherException
Retrieve a feed over HTTP

Parameters:
feedUrl - A non-null URL of a RSS/Atom feed to retrieve
Returns:
A SyndFeed object
Throws:
java.lang.IllegalArgumentException - if the URL is null;
java.io.IOException - if a TCP error occurs
com.sun.syndication.io.FeedException - if the feed is not valid
FetcherException - if a HTTP error occurred

addFetcherEventListener

void addFetcherEventListener(FetcherListener listener)

Add a FetcherListener.

The FetcherListener will receive an FetcherEvent when a Fetcher event (feed polled, retrieved, etc) occurs

Parameters:
listener - The FetcherListener to recieve the event

removeFetcherEventListener

void removeFetcherEventListener(FetcherListener listener)

Remove a FetcherListener

Parameters:
listener - The FetcherListener to remove

isUsingDeltaEncoding

boolean isUsingDeltaEncoding()

Is this fetcher using rfc3229 delta encoding?

Returns:

setUsingDeltaEncoding

void setUsingDeltaEncoding(boolean useDeltaEncoding)

Turn on or off rfc3229 delta encoding

See http://www.ietf.org/rfc/rfc3229.txt and http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html

NOTE: This is experimental and feedback is welcome!

Parameters:
useDeltaEncoding -

setPreserveWireFeed

void setPreserveWireFeed(boolean preserveWireFeed)
If set to true, the WireFeed will be made accessible from the SyndFeed object returned from the Fetcher via the originalWireFeed() method. Each Entry in the feed will have the corresponding wireEntry property set.



Copyright © 2004-2009 Sun Microsystems. All Rights Reserved.