org.archive.wayback.requestparser
Class BaseRequestParser
java.lang.Object
org.archive.wayback.requestparser.BaseRequestParser
- All Implemented Interfaces:
- RequestParser
- Direct Known Subclasses:
- CompositeRequestParser, DomainPrefixRequestParser, FormRequestParser, OpenSearchRequestParser, PathRequestParser, ProxyReplayRequestParser
public abstract class BaseRequestParser
- extends java.lang.Object
- implements RequestParser
Class that implements the RequestParser interface, and also understands how
to:
This class will attempt to use the overridable parseCustom() method to
create the WaybackRequest object, but if that fails (returns null), it will
fall back to:
A) attempting to parse out an incoming OpenSearch format query
B) attempting to parse out any and all incoming form elements submitted as
either GET or POST arguments
This class also contains the functionality to extract HTTP header
information into WaybackRequest objects, including Http auth info, referer,
remote IPs, etc.
- Version:
- $Date$, $Revision$
- Author:
- brad
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QUERY_BASE
protected static final java.lang.String QUERY_BASE
- See Also:
- Constant Field Values
XQUERY_BASE
protected static final java.lang.String XQUERY_BASE
- See Also:
- Constant Field Values
REPLAY_BASE
protected static final java.lang.String REPLAY_BASE
- See Also:
- Constant Field Values
DEFAULT_MAX_RECORDS
protected static final int DEFAULT_MAX_RECORDS
- See Also:
- Constant Field Values
maxRecords
protected int maxRecords
earliestTimestamp
protected java.lang.String earliestTimestamp
latestTimestamp
protected java.lang.String latestTimestamp
BaseRequestParser
public BaseRequestParser()
getMapParam
protected static java.lang.String getMapParam(java.util.Map<java.lang.String,java.lang.String[]> queryMap,
java.lang.String field)
getRequiredMapParam
protected static java.lang.String getRequiredMapParam(java.util.Map<java.lang.String,java.lang.String[]> queryMap,
java.lang.String field)
throws BadQueryException
- Throws:
BadQueryException
getMapParamOrEmpty
protected static java.lang.String getMapParamOrEmpty(java.util.Map<java.lang.String,java.lang.String[]> map,
java.lang.String param)
parse
public abstract WaybackRequest parse(javax.servlet.http.HttpServletRequest httpRequest,
AccessPoint wbContext)
throws BadQueryException
- Description copied from interface:
RequestParser
- attempt to transform an incoming HttpServletRequest into a
WaybackRequest object. returns null if there is missing information.
- Specified by:
parse in interface RequestParser
- Returns:
- populated WaybackRequest object if successful, null otherwise.
- Throws:
BadQueryException
getMaxRecords
public int getMaxRecords()
- Returns:
- the maxRecords
setMaxRecords
public void setMaxRecords(int maxRecords)
- Specified by:
setMaxRecords in interface RequestParser
- Parameters:
maxRecords - the maxRecords to set
setEarliestTimestamp
public void setEarliestTimestamp(java.lang.String timestamp)
- Specified by:
setEarliestTimestamp in interface RequestParser
- Parameters:
timestamp -
getEarliestTimestamp
public java.lang.String getEarliestTimestamp()
- Returns:
getLatestTimestamp
public java.lang.String getLatestTimestamp()
setLatestTimestamp
public void setLatestTimestamp(java.lang.String timestamp)
- Specified by:
setLatestTimestamp in interface RequestParser
Copyright © 2005-2009 Internet Archive. All Rights Reserved.