|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.erowid.sperowider.BasicSperowiderModel
An in-memory implementation of ISperowiderModel
.
Constructor Summary | |
BasicSperowiderModel()
|
Method Summary | |
void |
addFileToRectificationQueue(String fileName)
Adds a filename to the rectification queue |
void |
addFoundURL(String foundIn,
String found,
boolean excludeFromDownloadQueue)
The Downloader calls this when it finds a URL in a downloaded page. |
void |
destroy()
Called by the Sperowider to close all open resources |
String |
getFileForRectifying()
Returns a file to be rectified; this will be done after the downloads are all done |
String |
getFileNameForURL(String url)
Returns the filename for a mapped URL. |
List |
getFoundURLs(String sourceURL)
This is too expensive for the BasicSperowiderModel, in terms of memory. |
int |
getGrabbedUrlCount()
The count of URLs that have been grabbed for download. |
int |
getInvalidURLCount()
The count of all bad URLs, both found and real. |
Collection |
getInvalidURLs()
Returns the list of invalid URLs |
String |
getRealURLForFoundURL(String foundURL)
Returns the mapping data as set by mapFoundURLToRealURL(String, String) |
int |
getRectifiedHTMLFileCount()
The count of all HTML files that have been "rectified", that have been processed to replace all found URLs with relative URLs to the mapped file names. |
List |
getSourceURLs(String foundURL)
This is too expensive for the BasicSperowiderModel, in terms of memory. |
int |
getUncheckedUrlCount()
A count of URLs that have not yet been checked. |
int |
getUnRectifiedFileCount()
The count of downloaded HTML files that are not yet rectified. |
String |
getUnspideredUrl()
Returns a URL that has yet to be downloaded |
boolean |
grabForSpidering(String url)
If this URL has already been downloaded, return false. |
void |
init(Element configNode)
Initiale this class with the passed in XML configuration element. |
boolean |
isSpiderMapSupported()
Returns false, because the BasicSperowiderModel does not support getFoundURLs(String)
or getSourceURLs(String) . |
void |
mapFoundURLToRealURL(String foundURL,
String realURL)
Maps a found URL to a "real URL". |
void |
mapRealURLToFileName(String realURL,
String fileName)
Maps a "real" URL to a file name. |
void |
markInvalidURL(String url,
int http_code,
String http_message)
Mark a URL as invalid |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicSperowiderModel()
Method Detail |
public void addFoundURL(String foundIn, String found, boolean excludeFromDownloadQueue)
ISperowiderModel
addFoundURL
in interface ISperowiderModel
public String getUnspideredUrl()
ISperowiderModel
getUnspideredUrl
in interface ISperowiderModel
public void mapFoundURLToRealURL(String foundURL, String realURL)
ISperowiderModel
mapFoundURLToRealURL
in interface ISperowiderModel
public void mapRealURLToFileName(String realURL, String fileName)
ISperowiderModel
mapRealURLToFileName
in interface ISperowiderModel
public void addFileToRectificationQueue(String fileName)
ISperowiderModel
addFileToRectificationQueue
in interface ISperowiderModel
public boolean grabForSpidering(String url)
ISperowiderModel
grabForSpidering
in interface ISperowiderModel
public void markInvalidURL(String url, int http_code, String http_message)
ISperowiderModel
markInvalidURL
in interface ISperowiderModel
public String getFileForRectifying()
ISperowiderModel
getFileForRectifying
in interface ISperowiderModel
public String getRealURLForFoundURL(String foundURL)
ISperowiderModel
ISperowiderModel.mapFoundURLToRealURL(String, String)
getRealURLForFoundURL
in interface ISperowiderModel
public String getFileNameForURL(String url)
ISperowiderModel
getFileNameForURL
in interface ISperowiderModel
public void init(Element configNode) throws SperowiderInstantiationException
IInitializableObject
init
in interface IInitializableObject
SperowiderInstantiationException
public void destroy()
ISperowiderModel
destroy
in interface ISperowiderModel
public List getFoundURLs(String sourceURL) throws UnsupportedOperationException
UnsupportedOperationException
, and returns false for
isSpiderMapSupported()
getFoundURLs
in interface ISperowiderModel
UnsupportedOperationException
- If the model does not support this methodpublic List getSourceURLs(String foundURL) throws UnsupportedOperationException
UnsupportedOperationException
, and returns false for
isSpiderMapSupported()
getSourceURLs
in interface ISperowiderModel
UnsupportedOperationException
- If the model does not support this methodpublic boolean isSpiderMapSupported()
getFoundURLs(String)
or getSourceURLs(String)
.
isSpiderMapSupported
in interface ISperowiderModel
public Collection getInvalidURLs()
getInvalidURLs
in interface ISperowiderModel
public int getGrabbedUrlCount()
ISperowiderModel
getGrabbedUrlCount
in interface ISperowiderModel
public int getInvalidURLCount()
ISperowiderModel
getInvalidURLCount
in interface ISperowiderModel
public int getRectifiedHTMLFileCount()
ISperowiderModel
getRectifiedHTMLFileCount
in interface ISperowiderModel
public int getUncheckedUrlCount()
ISperowiderModel
getUncheckedUrlCount
in interface ISperowiderModel
public int getUnRectifiedFileCount()
ISperowiderModel
getUnRectifiedFileCount
in interface ISperowiderModel
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |