All Packages Class Hierarchy This Package Previous Next Index
Class com.andthehorseyourodeinon.netgrep.SearchEngineMonitorService
java.lang.Object
|
+----java.lang.Thread
|
+----com.andthehorseyourodeinon.ghear.Service
|
+----com.andthehorseyourodeinon.netgrep.SearchEngineMonitorService
- public abstract class SearchEngineMonitorService
- extends Service
Abstract class for a Search Engine Monitor (or Tracker) Service.
A general Search Engine Monitor will query a serach engine for specific
terms, and keep track of the results and the order of the results. A
Tracker has the additional functionality of tracking the position of a
given site for particular keywords.
- Version:
- $Id: SearchEngineMonitorService.java,v 1.1 2000/05/16 22:44:24 samuelg Exp $
-
depth
-
-
firstTime
-
-
hasNewUrls
-
-
lastAccessed
-
-
mets
-
-
postFix
-
-
queryString
-
-
searchHost
-
-
searchTerm
-
-
soughtSite
-
-
theRequest
-
-
updateFrequency
-
-
urls
-
-
SearchEngineMonitorService(Properties, Metrics, String, String, String, String, String, int)
-
-
currentPosition()
- Override this method if writing a Tracker
-
getRequest()
-
-
getResultCount()
-
-
getSearchDepth()
-
-
getSearchHost()
-
-
getSearchString()
-
-
getServiceName()
- Override this method
-
getSiteString()
- Override this method
-
getTimestamp()
-
-
getUrl(String)
- Get a specific result URL.
-
getUrls()
- Get all result URLs.
-
getUrlsCreatedAfter(Calendar)
- Get all result URLs created after a given time.
-
getUrlsModifiedAfter(Calendar)
- Get all result URLs modified after a given time.
-
grabUrlList()
- Used in the initialization of the Monitor or Tracker to populate the list of
URLs for a given query
-
hasNewUrl()
- Is there any new data?
-
hasUrl(String)
- Is a given URL in the list of results?
-
history()
- Override this method, writing a Tracker
-
isMonitor()
- Override this method
-
refreshUrlList()
- Used to refresh the list of URLs for all subsequent queries
-
refreshUrlList(boolean)
- This code should be overridden for the specific task of Monitoring or Tracking
-
run()
- Main thread.
-
sendUpdate(String, String)
- Wrapper method to send a notification email.
-
updateTimestamp()
-
searchTerm
protected String searchTerm
searchHost
protected String searchHost
queryString
protected String queryString
postFix
protected String postFix
soughtSite
protected String soughtSite
depth
protected int depth
urls
protected Hashtable urls
hasNewUrls
protected boolean hasNewUrls
updateFrequency
protected long updateFrequency
lastAccessed
protected Calendar lastAccessed
mets
protected Metrics mets
theRequest
protected String theRequest
firstTime
protected boolean firstTime
SearchEngineMonitorService
public SearchEngineMonitorService(Properties options,
Metrics mets,
String searchTerm,
String searchHost,
String queryString,
String postFix,
String site,
int depth)
- Parameters:
- options - Properties general to all the search engine Monitors and Trackers.
- mets - Metrics for all the search engine Monitors and Trackers.
- searchTerm - a String containing the search terms to use against the search engine.
- searchHost - the base address of the URL for the search engine.
- queryString - a template for a query to the search engine.
- postFix - a template for anything on the URL after the search terms.
- site - the base URL (e.g., www.site.com) for a site to be tracked.
- depth - the number of results from the search engine to consider.
run
public void run()
- Main thread. Sleeps for a given period of time, then updates the query results
- Overrides:
- run in class Service
grabUrlList
public void grabUrlList()
- Used in the initialization of the Monitor or Tracker to populate the list of
URLs for a given query
refreshUrlList
public void refreshUrlList()
- Used to refresh the list of URLs for all subsequent queries
refreshUrlList
public void refreshUrlList(boolean reportNewUrls)
- This code should be overridden for the specific task of Monitoring or Tracking
hasUrl
public boolean hasUrl(String theUrl)
- Is a given URL in the list of results?
- Parameters:
- theUrl - String representation of the URL
- Returns:
- true if URL is in the list
getUrl
public SearchEngineRecord getUrl(String theUrl)
- Get a specific result URL.
- Parameters:
- theUrl - String representation of the URL
- Returns:
- a SearchEngineRecord of the URL requested, or null if it's not in the
list of results.
getUrlsModifiedAfter
public Vector getUrlsModifiedAfter(Calendar cal)
- Get all result URLs modified after a given time.
- Parameters:
- cal - Calendar containing the threshhold time
- Returns:
- a Vector of SearchEngineRecords of URLs modified after specified time.
getUrls
public Vector getUrls()
- Get all result URLs.
- Returns:
- a Vector of SearchEngineRecords of URLs.
getUrlsCreatedAfter
public Vector getUrlsCreatedAfter(Calendar cal)
- Get all result URLs created after a given time.
- Parameters:
- cal - Calendar containing the threshhold time
- Returns:
- a Vector of SearchEngineRecords of URLs created after specified time.
sendUpdate
public void sendUpdate(String subject,
String text)
- Wrapper method to send a notification email.
- Parameters:
- subject - subject of the email.
- text - body of the email.
updateTimestamp
public void updateTimestamp()
getTimestamp
public Calendar getTimestamp()
hasNewUrl
public boolean hasNewUrl()
- Is there any new data?
- Returns:
- true if new URLs exist in the result list
getSearchString
public String getSearchString()
getSiteString
public String getSiteString()
- Override this method
currentPosition
public String currentPosition()
- Override this method if writing a Tracker
isMonitor
public boolean isMonitor()
- Override this method
getSearchHost
public String getSearchHost()
history
public String history()
- Override this method, writing a Tracker
getSearchDepth
public int getSearchDepth()
getResultCount
public int getResultCount()
getRequest
public String getRequest()
getServiceName
public String getServiceName()
- Override this method
- Overrides:
- getServiceName in class Service
All Packages Class Hierarchy This Package Previous Next Index