org.archive.wayback.requestparser
Class PathRequestParser

java.lang.Object
  extended by org.archive.wayback.requestparser.BaseRequestParser
      extended by org.archive.wayback.requestparser.WrappedRequestParser
          extended by org.archive.wayback.requestparser.PathRequestParser
All Implemented Interfaces:
RequestParser
Direct Known Subclasses:
DatelessReplayRequestParser, PathDatePrefixQueryRequestParser, PathDateRangeQueryRequestParser, PathPrefixDatePrefixQueryRequestParser, PathPrefixDateRangeQueryRequestParser, ReplayRequestParser

public abstract class PathRequestParser
extends WrappedRequestParser

Subclass of RequestParser that acquires key request information from the path component within the handling AccessPoint.

Version:
$Date: 2010-09-29 05:28:38 +0700 (Wed, 29 Sep 2010) $, $Revision: 3262 $
Author:
brad

Field Summary
 
Fields inherited from class org.archive.wayback.requestparser.BaseRequestParser
DEFAULT_MAX_RECORDS, QUERY_BASE, REPLAY_BASE, XQUERY_BASE
 
Constructor Summary
PathRequestParser(BaseRequestParser wrapped)
           
 
Method Summary
 WaybackRequest parse(javax.servlet.http.HttpServletRequest httpRequest, AccessPoint accessPoint)
          attempt to transform an incoming HttpServletRequest into a WaybackRequest object.
abstract  WaybackRequest parse(String requestPath, AccessPoint accessPoint)
          attempt to transform an incoming HttpServletRequest into a WaybackRequest object.
 
Methods inherited from class org.archive.wayback.requestparser.WrappedRequestParser
getEarliestTimestamp, getLatestTimestamp, getMaxRecords
 
Methods inherited from class org.archive.wayback.requestparser.BaseRequestParser
setEarliestTimestamp, setLatestTimestamp, setMaxRecords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathRequestParser

public PathRequestParser(BaseRequestParser wrapped)
Parameters:
wrapped - the BaseRequestParser being wrapped
Method Detail

parse

public abstract WaybackRequest parse(String requestPath,
                                     AccessPoint accessPoint)
                              throws BetterRequestException,
                                     BadQueryException
attempt to transform an incoming HttpServletRequest into a WaybackRequest object. returns null if there is missing information.

Parameters:
requestPath - the AccessPoint relative path as received by the AccessPoint
accessPoint - AccessPoint which is attempting to parse the request
Returns:
populated WaybackRequest object if successful, null otherwise.
Throws:
BadQueryException - if the request could match this AccessPoint, but is malformed: invalid datespec, URL, or flags
BetterRequestException - if the request should be redirected to provide better user feedback (corrected URL/date in address bar)

parse

public WaybackRequest parse(javax.servlet.http.HttpServletRequest httpRequest,
                            AccessPoint accessPoint)
                     throws BadQueryException,
                            BetterRequestException
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
Specified by:
parse in class BaseRequestParser
Parameters:
httpRequest - ServletHttpRequest being handled
accessPoint - AccessPoint which is attempting to parse the request
Returns:
populated WaybackRequest object if successful, null otherwise.
Throws:
BadQueryException - if the request could match this AccessPoint, but is malformed: invalid datespec, URL, or flags
BetterRequestException - if the request should be redirected to provide better user feedback (corrected URL/date in address bar)


Copyright © 2005-2011 Internet Archive. All Rights Reserved.