|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.erowid.sperowider.hsqldb.SperowiderModel
An ISperowiderModel backed by an HSQLDB database instance
Constructor Summary | |
SperowiderModel()
Default constructor for model. |
|
SperowiderModel(String repositoryName,
boolean supportSpiderMap,
boolean deleteOldData,
String archiveOldData)
A constructor, really for test purposes only. |
Method Summary | |
void |
addFileToRectificationQueue(String fileName)
Adds a filename to the rectification queue |
void |
addFoundURL(String foundIn,
String found)
Delegates to addFoundURL(String, String, boolean) with an exclude flag of false. |
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 |
protected Connection |
getConnection()
Returns the current HSQLDB connection. |
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)
Returns a List of String objects that are the URLs that the passed in URL reference. |
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)
Returns a List of String objects that are the URLs in which the passed in URL is found. |
int |
getSpiderQueueSize()
The number of URLs left in the queue. |
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)
Initializes this SperowiderModel with a configuration. |
void |
init(String repositoryName,
boolean supportSpiderMap,
boolean deleteOldData,
String archiveOldData)
Initializes this model, with default reporters. |
boolean |
isSpiderMapSupported()
This model does support getFoundURLs(String) and getSourceURLs(String) ,
so this method can return true, if "support-spider-map" is set to true in the model
declaration of the config file. |
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 SperowiderModel() throws SperowiderInstantiationException
SperowiderInstantiationException
- If the HSQLDB driver is not found.public SperowiderModel(String repositoryName, boolean supportSpiderMap, boolean deleteOldData, String archiveOldData) throws SperowiderInstantiationException
SperowiderModel()
, and then
to init(String, boolean, boolean, String)
.
SperowiderInstantiationException
- If the HSQLDB driver is not found.Method Detail |
protected Connection getConnection()
public void addFoundURL(String foundIn, String found)
addFoundURL(String, String, boolean)
with an exclude flag of false.
addFoundURL
in interface ISimpleSpiderModel
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(String repositoryName, boolean supportSpiderMap, boolean deleteOldData, String archiveOldData) throws SperowiderInstantiationException
SperowiderInstantiationException
public void init(Element configNode) throws SperowiderInstantiationException
<model class-name="org.erowid.sperowider.hsqldb.SperowiderModel" support-spider-map="true" >
<repository name="sperowider-hsqldb-data"
delete-old-data="true"
archive-old-data="sperowider-hsqldb-data.old" />
</model>
init
in interface IInitializableObject
SperowiderInstantiationException
public void destroy()
ISperowiderModel
destroy
in interface ISperowiderModel
public List getFoundURLs(String sourceURL) throws UnsupportedOperationException
ISperowiderModel
UnsupportedOperationException
rather than return
a valid value. Those models that do throw the exception
should return false for ISperowiderModel.isSpiderMapSupported()
.
getFoundURLs
in interface ISperowiderModel
UnsupportedOperationException
- If the model does not support this methodpublic List getSourceURLs(String foundURL) throws UnsupportedOperationException
ISperowiderModel
UnsupportedOperationException
rather than return
a valid value. Those models that do throw the exception
should return false for ISperowiderModel.isSpiderMapSupported()
.
getSourceURLs
in interface ISperowiderModel
UnsupportedOperationException
- If the model does not support this methodpublic boolean isSpiderMapSupported()
getFoundURLs(String)
and getSourceURLs(String)
,
so this method can return true, if "support-spider-map" is set to true in the model
declaration of the config file.
isSpiderMapSupported
in interface ISperowiderModel
public Collection getInvalidURLs()
ISperowiderModel
getInvalidURLs
in interface ISperowiderModel
public int getSpiderQueueSize()
ISimpleSpiderModel
getSpiderQueueSize
in interface ISimpleSpiderModel
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 |