|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.rssowl.controller.thread.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 Vector |
links
List of links from the results |
private static Vector |
localeSearchList
Domains that are allowed to use for search |
private static int |
MAX_CACHE_PER_RUN
The maximum number of newsfeeds to cache per search |
private boolean |
nativeLangSearch
If TRUE only display news that match the selected language |
private static String |
NEXT_IMAGE
Token for next image |
(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) FeedSearchDialog |
rssOwlFeedSearchDialog
The opened rss feedsearch dialog |
(package private) boolean |
running
Flag indicates the running threads |
private static 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 Thread |
searchThread
Thread that performs the search |
private String |
searchUrl
URL to get the results from |
private static String |
START_PARAM
Token for start parameter |
private String |
topic
Topic that the user searches for |
Constructor Summary | |
FeedSearchManager(String topic,
FeedSearchDialog rssOwlFeedSearchDialog,
boolean intensiveSearch,
boolean nativeLangSearch)
Instantiate a new FeedSearchManager |
Method Summary | |
static void |
addIntoLocaleSearchList(String value)
Add a value to the locale search list |
(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 valid RSS / RDF feeds |
private void |
createSearchThread()
Search thread performs the search for the topic |
private String |
createUrl()
Create the URL to perform the search |
private void |
filterLink(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 Vector localeSearchList
private static final int MAX_CACHE_PER_RUN
private static final String NEXT_IMAGE
private static final String[] SEARCH_DELIMITER
private static final String START_PARAM
private ExtendedThread[] collectorThreads
private boolean intensiveSearch
private Vector links
private boolean nativeLangSearch
private int resultCounter
private Thread searchThread
private String searchUrl
private String topic
int collectorsDone
Vector normalUrlObjects
org.jdom.input.SAXBuilder[] parser
Vector preferredUrlObjects
Random randomNumberGenerator
FeedSearchDialog rssOwlFeedSearchDialog
boolean running
boolean searchDone
Constructor Detail |
public FeedSearchManager(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 performedMethod Detail |
public static void addIntoLocaleSearchList(String value)
value
- The value to addpublic 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 String createUrl()
private void filterLink(String url)
url
- Any URL to filterprivate 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 |