public abstract class VendorEngine
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
baseUri
URI for the site search engine
|
static java.lang.String |
HTML |
static java.lang.String |
JSON |
protected java.lang.String |
searchUri
URI with the current search query appended
|
protected java.util.ArrayList<java.net.URL> |
searchUrls
Lists of search result URLs
|
Constructor and Description |
---|
VendorEngine()
Create a new instance of VendorEngine.
|
Modifier and Type | Method and Description |
---|---|
static VendorEngine |
getSearchEngine(java.lang.String vendor)
Create and return a search engine object for the specified vendor type.
|
java.lang.String |
getSearchURI()
Get the last search URI that was constructed.
|
static java.util.ArrayList<java.lang.String> |
getSearchVendors()
Get a list of search vendors that supply an online search engine.
|
abstract java.lang.String |
replyFormat()
Return the type of format that the search reply is in.
|
protected abstract java.lang.String |
restOfURI(int pageNumber)
Construct a basic 'rest of the URI' to add to the search request.
|
void |
setSearchURI(java.lang.String thisSearchUri)
Set the search URI description.
|
java.util.ArrayList<java.lang.String> |
vendorSearch(SearchInfo searchInfo)
Search the web using the Vendor search engine.
|
java.util.ArrayList<java.lang.String> |
vendorSearch(SearchInfo searchInfo,
boolean constructUri)
Search the web using the Vendor search engine.
|
public static java.lang.String HTML
public static java.lang.String JSON
protected java.lang.String baseUri
protected java.lang.String searchUri
protected java.util.ArrayList<java.net.URL> searchUrls
public abstract java.lang.String replyFormat()
HTML
or JSON
.protected abstract java.lang.String restOfURI(int pageNumber)
pageNumber
- search page number to return.public java.util.ArrayList<java.lang.String> vendorSearch(SearchInfo searchInfo) throws java.lang.Exception
searchInfo
- the search configuration. Note that the searchInfo.pageEntryNumber
method can be used to set the search result page, or start search entry number.java.lang.Exception
- any error.public java.util.ArrayList<java.lang.String> vendorSearch(SearchInfo searchInfo, boolean constructUri) throws java.lang.Exception
searchInfo
- the search configuration. Note that the searchInfo.pageEntryNumber
method can be used to set the search result page, or start search entry number.constructUri
- if true construct the URI description automatically from the info. If false,
then it needs to be set beforehand and is then used as is.java.lang.Exception
- any error.public void setSearchURI(java.lang.String thisSearchUri)
thisSearchUri
- the search description for a REST service.public java.lang.String getSearchURI()
public static java.util.ArrayList<java.lang.String> getSearchVendors()
public static VendorEngine getSearchEngine(java.lang.String vendor)
vendor
- the name of the vendor.