public class NutchResourceIndex extends Object implements ResourceIndex
Constructor and Description |
---|
NutchResourceIndex() |
Modifier and Type | Method and Description |
---|---|
protected Document |
getHttpDocument(String url) |
int |
getMaxRecords() |
protected String |
getNodeContent(Element e,
String key) |
protected String |
getNodeNutchContent(Element e,
String key) |
protected String |
getRequestUrl(WaybackRequest wbRequest) |
protected NodeList |
getSearchChannel(Document d) |
protected NodeList |
getSearchItems(Document d) |
String |
getSearchUrlBase() |
void |
init() |
SearchResults |
query(WaybackRequest wbRequest)
Transform a WaybackRequest into a ResourceResults.
|
void |
setMaxRecords(int maxRecords) |
void |
setSearchUrlBase(String searchUrlBase) |
void |
shutdown()
Release any resources used by this ResourceIndex cleanly
|
public void init() throws ConfigurationException
ConfigurationException
public SearchResults query(WaybackRequest wbRequest) throws ResourceIndexNotAvailableException, ResourceNotInArchiveException, BadQueryException, AccessControlException
ResourceIndex
query
in interface ResourceIndex
wbRequest
- WaybackRequest object from RequestParserResourceIndexNotAvailableException
- if the ResourceIndex
is not available (remote host down, local files missing, etc)ResourceNotInArchiveException
- if the ResourceIndex could be
contacted, but no SearchResult objects matched the requestBadQueryException
- if the WaybackRequest is lacking information
required to make a reasonable search of this ResourceIndexAccessControlException
- if SearchResult objects actually matched,
but could not be returned due to AccessControl restrictions
(robots.txt documents, Administrative URL blocks, etc)protected String getRequestUrl(WaybackRequest wbRequest) throws BadQueryException
BadQueryException
protected Document getHttpDocument(String url) throws IOException, SAXException
IOException
SAXException
public String getSearchUrlBase()
public void setSearchUrlBase(String searchUrlBase)
searchUrlBase
- the searchUrlBase to setpublic int getMaxRecords()
public void setMaxRecords(int maxRecords)
maxRecords
- the maxRecords to setpublic void shutdown() throws IOException
ResourceIndex
shutdown
in interface ResourceIndex
IOException
- for usual causesCopyright © 2005–2015 IIPC. All rights reserved.