public abstract class BaseRequestParser extends Object implements RequestParser
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_RECORDS
Default maximum number of records to assume, overridden by configuration,
when not specified in the client request
|
static String |
QUERY_BASE
String path matching a query request, by form or OpenSearch
|
static String |
REPLAY_BASE
String path matching a replay request, by form or OpenSearch
|
static String |
XQUERY_BASE
String path matching a query request, by form or OpenSearch, indicating
user requests XML data in response
|
Constructor and Description |
---|
BaseRequestParser() |
Modifier and Type | Method and Description |
---|---|
String |
getEarliestTimestamp() |
String |
getLatestTimestamp() |
int |
getMaxRecords() |
abstract WaybackRequest |
parse(javax.servlet.http.HttpServletRequest httpRequest,
AccessPoint wbContext)
attempt to transform an incoming HttpServletRequest into a
WaybackRequest object. returns null if there is missing information.
|
void |
setEarliestTimestamp(String timestamp) |
void |
setLatestTimestamp(String timestamp) |
void |
setMaxRecords(int maxRecords) |
public static final String QUERY_BASE
public static final String XQUERY_BASE
public static final String REPLAY_BASE
public static final int DEFAULT_MAX_RECORDS
public abstract WaybackRequest parse(javax.servlet.http.HttpServletRequest httpRequest, AccessPoint wbContext) throws BadQueryException, BetterRequestException
RequestParser
parse
in interface RequestParser
httpRequest
- ServletHttpRequest being handledwbContext
- AccessPoint which is attempting to parse the requestBadQueryException
- if the request could match this AccessPoint,
but is malformed: invalid datespec, URL, or flagsBetterRequestException
- if the request should be redirected to
provide better user feedback (corrected URL/date in address bar)public int getMaxRecords()
public void setMaxRecords(int maxRecords)
maxRecords
- the maxRecords to use with this RequestParser, when not
specified by the client requestpublic void setEarliestTimestamp(String timestamp)
timestamp
- the earliest timestamp to use with this RequestParser
when none is supplied by the user requestpublic String getEarliestTimestamp()
public String getLatestTimestamp()
public void setLatestTimestamp(String timestamp)
timestamp
- the default latest timestamp to use with this
RequestParserCopyright © 2005–2015 IIPC. All rights reserved.