org.datamanager.simpleton
Class WebSearchSimpleton
java.lang.Object
|
+--org.datamanager.kernel.Simpleton
|
+--org.datamanager.simpleton.WebSearchSimpleton
- All Implemented Interfaces:
- EventHandler
- public class WebSearchSimpleton
- extends Simpleton
- implements EventHandler
This Simpleton hangs around until it gets a WebSearchRequestEvent.
Once it has received the event it tries to form a web query,
a query to a search engine such as webcrawler, and the
resulting page is downloaded and added to the pool.
- See Also:
Debug
,
IOException
,
MalformedURLException
,
URL
,
URLEncoder
Method Summary |
protected void |
download(String engine,
String keywords)
This method take a String representation of a URL to some
web search engine, and a String of keywords. |
void |
handle(DataManagerEvent event)
Handle a DataManagerEvent that has been fired. |
void |
process()
Performs the work of this Simpleton. |
WebSearchSimpleton
public WebSearchSimpleton()
- This is the default constructor. It calls the constructor that
takes a String with a default name.
process
public void process()
- Description copied from class:
Simpleton
- Performs the work of this Simpleton. Simpleton
implementation must override this class.
- Specified by:
process
in class Simpleton
handle
public void handle(DataManagerEvent event)
- Description copied from interface:
EventHandler
- Handle a DataManagerEvent that has been fired.
- Specified by:
handle
in interface EventHandler
- Parameters:
event
- The event to handle.
download
protected void download(String engine,
String keywords)
- This method take a String representation of a URL to some
web search engine, and a String of keywords. It uses those
Strings to download a webpage containing the results of
a search on the given keywords.
See the Helium Website