|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.rssowl.controller.thread.FeedDiscoveryManager
The FeedDiscoveryManager performs a search for RSS / RDF feeds on a certain website. Each link that is in the result is checked for a valid feed. If the link is a newsfeed, a new line is added to the table of the FeedDiscoveryDialog.
Field Summary | |
private static int |
COLLECTOR_THREAD_COUNT
Number of collector threads |
(package private) int |
collectorsDone
Count the number of collector threads that have finished |
private ExtendedThread[] |
collectorThreads
Collector threads to collect and parse links from the results of the search |
private Thread |
discoveryThread
Thread that performs the search |
private Vector |
links
List of links from the results |
private static int |
MAX_CACHE_PER_RUN
The maximum number of newsfeeds to cache per search |
(package private) Vector |
normalUrlObjects
Synchronized list of normal URL objects |
(package private) org.jdom.input.SAXBuilder[] |
parser
Create one parser for each Collector thread |
(package private) Vector |
preferredUrlObjects
Synchronized list of preferred URL objects |
(package private) Random |
randomNumberGenerator
Random Number Generator for sleep Time of Threads |
private int |
resultCounter
Count the resulting Feeds |
(package private) FeedDiscoveryDialog |
rssOwlFeedDiscoveryDialog
The opened rss feeddiscovery dialog |
(package private) boolean |
running
Flag indicates the running threads |
(package private) boolean |
searchDone
Flag indicates when the search has finished |
private URL |
webSiteURL
Website to perform the search on |
Constructor Summary | |
FeedDiscoveryManager(String webSiteURL,
FeedDiscoveryDialog rssOwlFeedDiscoveryDialog)
Instantiate a new FeedDiscoveryManager |
Method Summary | |
(package private) void |
buildChannel(URL url,
int parserNumber)
Build RSS channel object from the given URl |
private org.jdom.Document |
buildDocument(URL xmlUrl,
boolean forceDefaultEncoding,
int parserNumber)
Build the XML document from the given URL |
private void |
createCollectorThreads()
Collector thread checks if URLs in "urlObj" are RSS / RDF / Atom feeds |
private void |
createSearchThread()
Search thread performs the search for the topic |
private void |
filterLink(String url)
Filter the given link. |
private void |
initXMLParsers()
Init one SAX Parser for each collector thread |
boolean |
isRunning()
Get the state of the search |
(package private) void |
performSearch()
Perform a search on the given website and add every link to the Stack, that was found. |
void |
startSearch()
Start search- and collector threads |
void |
stopSearch()
Interrupt the search- and collector threads |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int COLLECTOR_THREAD_COUNT
private static final int MAX_CACHE_PER_RUN
private ExtendedThread[] collectorThreads
private Thread discoveryThread
private Vector links
private int resultCounter
private URL webSiteURL
int collectorsDone
Vector normalUrlObjects
org.jdom.input.SAXBuilder[] parser
Vector preferredUrlObjects
Random randomNumberGenerator
FeedDiscoveryDialog rssOwlFeedDiscoveryDialog
boolean running
boolean searchDone
Constructor Detail |
public FeedDiscoveryManager(String webSiteURL, FeedDiscoveryDialog rssOwlFeedDiscoveryDialog) throws MalformedURLException
webSiteURL
- The website to perform the search onrssOwlFeedDiscoveryDialog
- This dialog called the FeedSearchManager
MalformedURLException
- In case the URL is malformedMethod Detail |
public boolean isRunning()
public void startSearch()
public void stopSearch()
private org.jdom.Document buildDocument(URL xmlUrl, boolean forceDefaultEncoding, int parserNumber)
xmlUrl
- The XML Url objectforceDefaultEncoding
- If set to TRUE the encoding is not being
detected from the XMl document and the OS default encoding is usedparserNumber
- The number of the index in the parser array to use
private void createCollectorThreads()
private void createSearchThread()
private void filterLink(String url) throws MalformedURLException
url
- Any URL to filter
MalformedURLException
- In case the URL is not validprivate void initXMLParsers()
void buildChannel(URL url, int parserNumber)
url
- The URL of the newsfeedparserNumber
- The number of the index in the parser array to usevoid performSearch() throws IOException
IOException
- If connection fails
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |