|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnet.obxlabs.romefeeder.Feeder
public class Feeder
Feed manager.
The feeder allows to load and update one or multiple syndicated feeds using the ROME library. It provides sorting functions to view the loaded entries in different orders, and it includes a simple way to load feeds through a PHP web proxy.
| Field Summary | |
|---|---|
EntryCallback |
postloadEntryCallback
Callback after an entry is loaded. |
FeedCallback |
postloadFeedCallback
Callback after a feed is loaded. |
FeedCallback |
postupdateFeedCallback
Callback after a feed is updated. |
FeedCallback |
postupdateGlobalCallback
Callback after feeds are updated. |
EntryCallback |
preloadEntryCallback
Callback before an entry is loaded. |
FeedCallback |
preloadFeedCallback
Callback before a feed is loaded. |
FeedCallback |
preupdateFeedCallback
Callback before a feed is updated. |
FeedCallback |
preupdateGlobalCallback
Callback before feeds are updated. |
static int |
PUBLISHED_DATE
Sort option: published date. |
static int |
TITLE
Sort option: title. |
static int |
UNSORTED
Sort options: unsorted (default). |
static int |
UPDATED_DATE
Sort option: updated date. |
boolean |
verbose
Outputs process information when true. |
| Constructor Summary | |
|---|---|
Feeder()
Create an empty Feeder. |
|
Feeder(java.lang.String xml)
Create a Feeder and load a Feed from a given xml file or url. |
|
| Method Summary | |
|---|---|
void |
clear()
Clear the feeder. |
int |
count()
Return the number of loaded entries. |
int |
countFeeds()
Return the number of loaded feeds. |
void |
err(java.lang.String msg)
Outputs errors to the console. |
com.sun.syndication.feed.synd.SyndFeed |
getFeed(java.lang.String xml)
Get the loaded Feed with a given id. |
long |
getUpdateInterval()
Get the update interval. |
boolean |
hasNext()
Check if there is more entries in the list. |
com.sun.syndication.feed.synd.SyndEntry |
last()
Get the last entry in the list and move the pointer to it. |
void |
load(java.lang.String xml)
Load a Feed from a given xml file or url and uses the feed's path as id. |
com.sun.syndication.feed.synd.SyndEntry |
next()
Get the next entry in the list. |
void |
out(java.lang.String msg)
Outputs text to the console. |
com.sun.syndication.feed.synd.SyndFeed |
removeFeed(java.lang.String xml)
Remove the loaded Feed with a given id. |
com.sun.syndication.feed.synd.SyndFeed |
removeFeed(com.sun.syndication.feed.synd.SyndFeed feed)
Remove the loaded Feed. |
void |
reset()
Reset the list iterator of the entries. |
void |
run()
Main function of the loading/updating thread. |
void |
setLoadCallback(FeedCallback postloadCallback)
Deprecated. Replaced by setLoadFeedCallback |
void |
setLoadCallback(FeedCallback preloadCallback,
FeedCallback postloadCallback)
Deprecated. Replaced by setLoadFeedCallback |
void |
setLoadEntryCallback(EntryCallback postloadEntryCallback)
Set the post load entry callback. |
void |
setLoadEntryCallback(EntryCallback preloadEntryCallback,
EntryCallback postloadEntryCallback)
Set the pre and post load entry callbacks. |
void |
setLoadFeedCallback(FeedCallback postloadFeedCallback)
Set the post load feed callback. |
void |
setLoadFeedCallback(FeedCallback preloadFeedCallback,
FeedCallback postloadFeedCallback)
Set the pre and post load feed callbacks. |
void |
setProxy(java.lang.String proxy)
Set the proxy used to fetch external feeds. |
void |
setUpdateCallback(FeedCallback postupdateCallback)
Deprecated. Replaced by setUpdateFeedCallback |
void |
setUpdateCallback(FeedCallback preupdateCallback,
FeedCallback postupdateCallback)
Deprecated. Replaced by setUpdateFeedCallback |
void |
setUpdateFeedCallback(FeedCallback postupdateFeedCallback)
Set the post update feed callback. |
void |
setUpdateFeedCallback(FeedCallback preupdateFeedCallback,
FeedCallback postupdateFeedCallback)
Set the post update feed callback. |
void |
setUpdateInterval(long ui)
Set the interval between updates. |
void |
sort(int value)
Set the sorting value for loading entries |
void |
startUpdate()
Start updating loaded feeds. |
void |
startUpdate(FeedCallback postupdateGlobalCallback)
Start updating loaded feeds and set global post update callbacks. |
void |
startUpdate(FeedCallback preupdateGlobalCallback,
FeedCallback postupdateGlobalCallback)
Start updating loaded feeds and set global update callbacks. |
void |
stopUpdate()
Stop updating loaded feeds. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNSORTED
public static final int PUBLISHED_DATE
public static final int UPDATED_DATE
public static final int TITLE
public FeedCallback preloadFeedCallback
public FeedCallback postloadFeedCallback
public FeedCallback preupdateFeedCallback
public FeedCallback postupdateFeedCallback
public FeedCallback preupdateGlobalCallback
public FeedCallback postupdateGlobalCallback
public EntryCallback preloadEntryCallback
public EntryCallback postloadEntryCallback
public boolean verbose
| Constructor Detail |
|---|
public Feeder()
public Feeder(java.lang.String xml)
xml - url or file path| Method Detail |
|---|
public void sort(int value)
This must be called before any entry is added to the feeder.
value - value to sort entries by (UNSORTED, PUBLISHED_DATE, UPDATED_DATE, TITLE)public void setProxy(java.lang.String proxy)
proxy - the url of the proxypublic void load(java.lang.String xml)
xml - url or file pathpublic void setLoadCallback(FeedCallback postloadCallback)
postloadCallback - public void setLoadFeedCallback(FeedCallback postloadFeedCallback)
Sets a FeedCallback object that will be called right AFTER a feed is loaded.
postloadFeedCallback -
public void setLoadCallback(FeedCallback preloadCallback,
FeedCallback postloadCallback)
preloadCallback - postloadCallback -
public void setLoadFeedCallback(FeedCallback preloadFeedCallback,
FeedCallback postloadFeedCallback)
Sets a FeedCallback object that will be called right BEFORE and another object that will be called right AFTER a feed is loaded.
preloadFeedCallback - postloadFeedCallback - public void setUpdateCallback(FeedCallback postupdateCallback)
postupdateCallback - public void setUpdateFeedCallback(FeedCallback postupdateFeedCallback)
Sets a FeedCallback object that will be called right AFTER each time a feed is updated.
postupdateFeedCallback -
public void setUpdateCallback(FeedCallback preupdateCallback,
FeedCallback postupdateCallback)
preupdateCallback - postupdateCallback -
public void setUpdateFeedCallback(FeedCallback preupdateFeedCallback,
FeedCallback postupdateFeedCallback)
Sets a FeedCallback object that will be called right BEFORE and another object that will be called right AFTER each time a feed is updated.
preupdateFeedCallback - postupdateFeedCallback - public void setLoadEntryCallback(EntryCallback postloadEntryCallback)
Sets an EntryCallback object that will be called right AFTER an entry is loaded.
postloadEntryCallback -
public void setLoadEntryCallback(EntryCallback preloadEntryCallback,
EntryCallback postloadEntryCallback)
Sets an EntryCallback object that will be called right BEFORE and another object that will be called right AFTER an entry is loaded.
preloadEntryCallback - postloadEntryCallback - public com.sun.syndication.feed.synd.SyndFeed getFeed(java.lang.String xml)
xml - url or file path
public com.sun.syndication.feed.synd.SyndFeed removeFeed(java.lang.String xml)
xml - url or file path
public com.sun.syndication.feed.synd.SyndFeed removeFeed(com.sun.syndication.feed.synd.SyndFeed feed)
feed - public int countFeeds()
public int count()
public boolean hasNext()
public com.sun.syndication.feed.synd.SyndEntry next()
public com.sun.syndication.feed.synd.SyndEntry last()
public void reset()
public void clear()
public void startUpdate()
public void startUpdate(FeedCallback postupdateGlobalCallback)
public void startUpdate(FeedCallback preupdateGlobalCallback,
FeedCallback postupdateGlobalCallback)
public void stopUpdate()
public void setUpdateInterval(long ui)
ui - interval in millisecondspublic long getUpdateInterval()
public void run()
run in interface java.lang.Runnablepublic void err(java.lang.String msg)
public void out(java.lang.String msg)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||