com.jgoodies.bookfinder.request.query
Class SimulatedKeywordQuery

java.lang.Object
  extended by com.jgoodies.bookfinder.request.query.SimulatedKeywordQuery
All Implemented Interfaces:
XMLQuery

public final class SimulatedKeywordQuery
extends Object

An implementation of XMLQuery that simulates access a keyword request to the Amazon.com web services. It uses a prebuilt XML files from local resources.

Version:
$Revision: 1.11 $
Author:
Karsten Lentzsch

Method Summary
 SearchResult executeQuery()
          Executes this XML query and returns the SearchResult object generated by the query.
protected  SearchResult executeQuery(int pageNo)
          Executes this XML query using the specified page number and returns the SearchResult object generated by the query.
protected  String getOperation()
          Returns the query's search code, as used in the query URL, for example: 'KeywordSearch'.
protected  URL getQueryURL(int page)
          Computes and returns the URL used to execute the query for the specified page no.
protected  String getResponseGroup()
           
static XMLQuery getSampleQuery()
           
 String getSearchData()
          Returns the query's search data, for example: 'gui', or 'arno schmidt'.
protected  String getSearchIndex()
           
 String getSearchType()
          Returns the query's search type, for example: 'author', 'key', or ISBN.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSampleQuery

public static XMLQuery getSampleQuery()

getSearchType

public String getSearchType()
Returns the query's search type, for example: 'author', 'key', or ISBN.

Specified by:
getSearchType in interface XMLQuery
Returns:
this query's search type

getOperation

protected String getOperation()
Returns the query's search code, as used in the query URL, for example: 'KeywordSearch'.

Returns:
this query's search code

getQueryURL

protected URL getQueryURL(int page)
Computes and returns the URL used to execute the query for the specified page no.

Returns:
the URL used to execute this query

toString

public String toString()

executeQuery

public SearchResult executeQuery()
                          throws IOException,
                                 org.jdom.JDOMException
Executes this XML query and returns the SearchResult object generated by the query.

Specified by:
executeQuery in interface XMLQuery
Throws:
IOException
org.jdom.JDOMException

getSearchData

public String getSearchData()
Returns the query's search data, for example: 'gui', or 'arno schmidt'.

Specified by:
getSearchData in interface XMLQuery
Returns:
this query's search data

executeQuery

protected SearchResult executeQuery(int pageNo)
                             throws IOException,
                                    org.jdom.JDOMException
Executes this XML query using the specified page number and returns the SearchResult object generated by the query.

Throws:
IOException
org.jdom.JDOMException

getResponseGroup

protected String getResponseGroup()

getSearchIndex

protected String getSearchIndex()


Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.