Q - the child class that extends this abstract classR - the type the child class' execute()-function returnspublic abstract class DailyDumpQuery<Q extends DailyDumpQuery,R> extends AbstractQuery<Q,R>
userAgent| Constructor and Description |
|---|
DailyDumpQuery(IXmlConverter xmlConverter,
String baseUrl,
String userAgent,
String defaultDirectory,
DailyDumpMode mode)
Constructor, accepting a mode.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildURL()
Generates a String URL based on the supplied values.
|
Q |
downloadDir(String dir)
Sets a specific directory to download the gzip file in, which will be
used instead of the default directory.
|
<T> T |
execute(Class<T> type)
Executes this query, returning any result.
|
protected abstract String |
getFileName()
Gives the file name to use.
|
Q |
readFromDir(String dir)
Sets a specific directory to read the gzip file from, which will be used
instead of the default directory.
|
protected <T> T |
translateResponse(InputStream response,
Class<T> type)
Translates the stream response to the object this Query wishes to return
via its execute() function.
|
protected void |
validateQueryParameters()
Validates the query parameters before executing the query.
|
closeInputStreamQuietly, execute, makeRequestpublic DailyDumpQuery(IXmlConverter xmlConverter, String baseUrl, String userAgent, String defaultDirectory, DailyDumpMode mode)
xmlConverter - baseUrl - userAgent - defaultDirectory - mode - the daily dump mode to usepublic final Q downloadDir(String dir)
dir - a specific directory to download the gzip inpublic final Q readFromDir(String dir)
dir - a specific directory to download the gzip inprotected abstract String getFileName()
protected String buildURL()
AbstractQuerybuildURL in class AbstractQuery<Q extends DailyDumpQuery,R>protected <T> T translateResponse(InputStream response, Class<T> type)
AbstractQuerytranslateResponse in class AbstractQuery<Q extends DailyDumpQuery,R>T - type to parse toresponse - the response to translatetype - type to parse topublic <T> T execute(Class<T> type)
AbstractQueryexecute in class AbstractQuery<Q extends DailyDumpQuery,R>T - the type to returntype - the type to returnprotected void validateQueryParameters()
AbstractQueryvalidateQueryParameters in class AbstractQuery<Q extends DailyDumpQuery,R>Copyright © 2017. All rights reserved.