Class WebSearchSimpleton

All Implemented Interfaces:

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

Nested Class Summary
Nested classes inherited from class org.datamanager.kernel.Simpleton
Simpleton.Information, Simpleton.Priority
Constructor Summary
          This is the default constructor.
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.
Methods inherited from class org.datamanager.kernel.Simpleton
clone, getInformation, getPriority, setInformation, setPriority, start
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public WebSearchSimpleton()
This is the default constructor. It calls the constructor that takes a String with a default name.

Method Detail


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


public void handle(DataManagerEvent event)
Description copied from interface: EventHandler
Handle a DataManagerEvent that has been fired.

Specified by:
handle in interface EventHandler
event - The event to handle.


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