|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.rssowl.controller.thread.FeedSearchManager
public class FeedSearchManager
The FeedSearchManager performs a search for RSS / RDF feeds on a certain topic. 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 FeedSearchDialog.
| 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 boolean |
intensiveSearch
If TRUE parse any link from the results. |
private java.util.Vector |
links
List of links from the results |
private static java.util.Vector |
localeSearchList
Domains that are allowed to use for search |
private boolean |
nativeLangSearch
If TRUE only display news that match the selected language |
(package private) java.util.Vector |
normalUrlObjects
Synchronized list of normal URL objects |
(package private) org.jdom.input.SAXBuilder[] |
parser
Create one parser for each Collector thread |
(package private) java.util.Vector |
preferredUrlObjects
Synchronized list of preferred URL objects |
(package private) java.util.Random |
randomNumberGenerator
Random Number Generator for sleep Time of Threads |
private int |
resultCounter
Count the resulting Feeds |
(package private) FeedSearchDialog |
rssOwlFeedSearchDialog
The opened rss feedsearch dialog |
(package private) boolean |
running
Flag indicates the running threads |
private static java.lang.String[] |
SEARCH_DELIMITER
One of the words from this array is combined with the search of the user |
(package private) boolean |
searchDone
Flag indicates when the search has finished |
private java.lang.Thread |
searchThread
Thread that performs the search |
private java.lang.String |
searchUrl
URL to get the results from |
private static java.lang.String |
START_PARAM
Token for start parameter |
private java.lang.String |
topic
Topic that the user searches for |
| Constructor Summary | |
|---|---|
FeedSearchManager(java.lang.String topic,
FeedSearchDialog rssOwlFeedSearchDialog,
boolean intensiveSearch,
boolean nativeLangSearch)
Instantiate a new FeedSearchManager |
|
| Method Summary | |
|---|---|
static void |
addIntoLocaleSearchList(java.lang.String value)
Add a value to the locale search list |
(package private) void |
buildChannel(java.net.URL url,
int parserNumber)
Build RSS channel object from the given URl |
private org.jdom.Document |
buildDocument(java.net.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 valid RSS / RDF feeds |
private void |
createSearchThread()
Search thread performs the search for the topic |
private java.lang.String |
createUrl()
Create the URL to perform the search |
private void |
filterLink(java.lang.String url)
Filter the given URL. |
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 search engine 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 java.util.Vector localeSearchList
private static final java.lang.String[] SEARCH_DELIMITER
private static final java.lang.String START_PARAM
private ExtendedThread[] collectorThreads
private boolean intensiveSearch
private java.util.Vector links
private boolean nativeLangSearch
private int resultCounter
private java.lang.Thread searchThread
private java.lang.String searchUrl
private java.lang.String topic
int collectorsDone
java.util.Vector normalUrlObjects
org.jdom.input.SAXBuilder[] parser
java.util.Vector preferredUrlObjects
java.util.Random randomNumberGenerator
FeedSearchDialog rssOwlFeedSearchDialog
boolean running
boolean searchDone
| Constructor Detail |
|---|
public FeedSearchManager(java.lang.String topic,
FeedSearchDialog rssOwlFeedSearchDialog,
boolean intensiveSearch,
boolean nativeLangSearch)
topic - Topic to search forrssOwlFeedSearchDialog - This dialog called the FeedSearchManagerintensiveSearch - TRUE if intensive search is performednativeLangSearch - TRUE if native lang search is performed| Method Detail |
|---|
public static void addIntoLocaleSearchList(java.lang.String value)
value - The value to addpublic boolean isRunning()
public void startSearch()
public void stopSearch()
private org.jdom.Document buildDocument(java.net.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 java.lang.String createUrl()
private void filterLink(java.lang.String url)
url - Any URL to filterprivate void initXMLParsers()
void buildChannel(java.net.URL url,
int parserNumber)
url - The URL of the newsfeedparserNumber - The number of the index in the parser array to use
void performSearch()
throws java.io.IOException
java.io.IOException - If connection fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||