light cleanup

This commit is contained in:
kebernet 2011-03-01 19:59:36 +00:00
parent ecfb293405
commit 9b5acb1585
2 changed files with 57 additions and 52 deletions

View file

@ -129,18 +129,21 @@
<groupId>commons-httpclient</groupId> <groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId> <artifactId>commons-httpclient</artifactId>
<version>3.0.1</version> <version>3.0.1</version>
<optional />
</dependency> </dependency>
<dependency> <dependency>
<!-- Required at build time and to use HTTPClientFetcher --> <!-- Required at build time and to use HTTPClientFetcher -->
<groupId>commons-logging</groupId> <groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId> <artifactId>commons-logging</artifactId>
<version>1.0.4</version> <version>1.0.4</version>
<optional/>
</dependency> </dependency>
<dependency> <dependency>
<!-- Required at build time and to use HTTPClientFetcher --> <!-- Required at build time and to use HTTPClientFetcher -->
<groupId>commons-logging</groupId> <groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId> <artifactId>commons-logging-api</artifactId>
<version>1.0.4</version> <version>1.0.4</version>
<optional />
</dependency> </dependency>
<dependency> <dependency>
<!-- Only required at compile time for testing --> <!-- Only required at compile time for testing -->

View file

@ -23,59 +23,62 @@ import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.FeedException; import com.sun.syndication.io.FeedException;
public interface FeedFetcher { public interface FeedFetcher {
/**
* <p>The default user agent. It is not marked final so
* buggy java compiler will not write this string
* into all classes that reference it.</p>
*
* <p>http://tinyurl.com/64t5n points to https://rome.dev.java.net/
* Some servers ban user agents with "Java" in the name.</p>
*
*/
public static String DEFAULT_USER_AGENT = "Rome Client (http://tinyurl.com/64t5n)";
/** /**
* @return the User-Agent currently being sent to servers * <p>The default user agent. It is not marked final so
*/ * buggy java compiler will not write this string
public abstract String getUserAgent(); * into all classes that reference it.</p>
/** *
* @param string The User-Agent to sent to servers * <p>http://tinyurl.com/64t5n points to https://rome.dev.java.net/
*/ * Some servers ban user agents with "Java" in the name.</p>
public abstract void setUserAgent(String string); *
/** */
* Retrieve a feed over HTTP public static String DEFAULT_USER_AGENT = "Rome Client (http://tinyurl.com/64t5n)";
*
* @param feedUrl A non-null URL of a RSS/Atom feed to retrieve
* @return A {@link com.sun.syndication.feed.synd.SyndFeed} object
* @throws IllegalArgumentException if the URL is null;
* @throws IOException if a TCP error occurs
* @throws FeedException if the feed is not valid
* @throws FetcherException if a HTTP error occurred
*/
public abstract SyndFeed retrieveFeed(URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException;
/** /**
* <p>Add a FetcherListener.</p> * @return the User-Agent currently being sent to servers
* */
* <p>The FetcherListener will receive an FetcherEvent when public abstract String getUserAgent();
* a Fetcher event (feed polled, retrieved, etc) occurs</p>
*
* @param listener The FetcherListener to recieve the event
*/
public abstract void addFetcherEventListener(FetcherListener listener);
/** /**
* <p>Remove a FetcherListener</p> * @param string The User-Agent to sent to servers
* */
* @param listener The FetcherListener to remove public abstract void setUserAgent(String string);
*/
public abstract void removeFetcherEventListener(FetcherListener listener);
/** /**
* <p>Is this fetcher using rfc3229 delta encoding?</p> * Retrieve a feed over HTTP
* *
* @return * @param feedUrl A non-null URL of a RSS/Atom feed to retrieve
*/ * @return A {@link com.sun.syndication.feed.synd.SyndFeed} object
* @throws IllegalArgumentException if the URL is null;
* @throws IOException if a TCP error occurs
* @throws FeedException if the feed is not valid
* @throws FetcherException if a HTTP error occurred
*/
public abstract SyndFeed retrieveFeed(URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException;
/**
* <p>Add a FetcherListener.</p>
*
* <p>The FetcherListener will receive an FetcherEvent when
* a Fetcher event (feed polled, retrieved, etc) occurs</p>
*
* @param listener The FetcherListener to recieve the event
*/
public abstract void addFetcherEventListener(FetcherListener listener);
/**
* <p>Remove a FetcherListener</p>
*
* @param listener The FetcherListener to remove
*/
public abstract void removeFetcherEventListener(FetcherListener listener);
/**
* <p>Is this fetcher using rfc3229 delta encoding?</p>
*
* @return
*/
public abstract boolean isUsingDeltaEncoding(); public abstract boolean isUsingDeltaEncoding();
/** /**
@ -88,11 +91,10 @@ public interface FeedFetcher {
* @param useDeltaEncoding * @param useDeltaEncoding
*/ */
public abstract void setUsingDeltaEncoding(boolean useDeltaEncoding); public abstract void setUsingDeltaEncoding(boolean useDeltaEncoding);
/** /**
* If set to true, the WireFeed will be made accessible from the SyndFeed object returned from the Fetcher * 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. * via the originalWireFeed() method. Each Entry in the feed will have the corresponding wireEntry property set.
*/ */
void setPreserveWireFeed(boolean preserveWireFeed); void setPreserveWireFeed(boolean preserveWireFeed);
}
}