org.archive.wayback.core
Class WaybackRequest

java.lang.Object
  extended by org.archive.wayback.core.WaybackRequest

public class WaybackRequest
extends java.lang.Object

Abstraction of all the data associated with a users request to the Wayback Machine.

Version:
$Date: 2009-07-17 17:14:42 -0700 (Fri, 17 Jul 2009) $, $Revision: 2771 $
Author:
Brad Tofel

Field Summary
static java.lang.String REQUEST_ANCHOR_DATE
          Replay-Only: indicates the date to tend towards when computing closest matches within time.
static java.lang.String REQUEST_ANCHOR_WINDOW
          Replay-Only: String representation of number of seconds.
static java.lang.String REQUEST_AUTH_TYPE
          Authorization Type: "BASIC", "SSL", or null if none.
static java.lang.String REQUEST_CAPTURE_QUERY
          REQUEST_TYPE option indicating a query against the ResourceIndex for captures of URLs matching the REQUEST_URL
static java.lang.String REQUEST_DATE
          GUARANTEED PRESENT for Replay requests only.
static java.lang.String REQUEST_END_DATE
          GUARANTEED PRESENT: omit results after this 14-digit String timestamp.
static java.lang.String REQUEST_EXACT_DATE
          GUARANTEED PRESENT for Replay requests only, no meaning for Query requests.
static java.lang.String REQUEST_EXACT_HOST_ONLY
          Indicates user only wants results that exactly match the hostname within REQUEST_URL -- no canonicalization.
static java.lang.String REQUEST_EXACT_SCHEME_ONLY
          Indicates user only wants results that were captured using the same scheme as that specified in REQUEST_URL.
static java.lang.String REQUEST_LOCALE_LANG
          User Locale name: Best Guess at users requested locale.
static java.lang.String REQUEST_META_MODE
          Request: replay actual document or metadata for document: "yes" means replay metadata only, not the actual document: (TimeLine mode)
static java.lang.String REQUEST_REFERER_URL
          incoming requests HTTP "Referer:" header, or null
static java.lang.String REQUEST_REMOTE_ADDRESS
          Remote Address that connected to this webapp to create the request string IP address: "127.0.0.1"
static java.lang.String REQUEST_REMOTE_USER
          Remote User or null if the request did not contain auth info.
static java.lang.String REQUEST_REPLAY_QUERY
          REQUEST_TYPE option indicating a request for Replay of the Resource matching REQUEST_URL closest in time to REQUEST_DATE
static java.lang.String REQUEST_RESOLUTION
          resolution of results to be displayed: (TimeLine mode)
static java.lang.String REQUEST_RESOLUTION_AUTO
          auto resolution (TimeLine mode)
static java.lang.String REQUEST_RESOLUTION_DAYS
          day resolution (TimeLine mode)
static java.lang.String REQUEST_RESOLUTION_HOURS
          hour resolution (TimeLine mode)
static java.lang.String REQUEST_RESOLUTION_MONTHS
          month resolution (TimeLine mode)
static java.lang.String REQUEST_RESOLUTION_TWO_MONTHS
          two-month resolution (TimeLine mode)
static java.lang.String REQUEST_RESOLUTION_YEARS
          year resolution (TimeLine mode)
static java.lang.String REQUEST_START_DATE
          GUARANTEED PRESENT: omit results before this 14-digit String timestamp.
static java.lang.String REQUEST_TYPE
          specifies the TYPE of the this particular request.
static java.lang.String REQUEST_URL
          GUARANTEED PRESENT: Original(RAW) URL or URL prefix requested, before any cleanup/fixing
static java.lang.String REQUEST_URL_QUERY
          REQUEST_TYPE option indicating a query against the ResourceIndex for summaries of URLs prefixed with the REQUEST_URL
static java.lang.String REQUEST_WAYBACK_CONTEXT
          the string (webapp) context that received this request
static java.lang.String REQUEST_WAYBACK_HOSTNAME
          incoming requests HTTP "Host:" header, or null
static java.lang.String REQUEST_WAYBACK_PORT
          the port the remote user connected to for this request
static java.lang.String REQUEST_XML_DATA
          Request: xml data requested
static java.lang.String REQUEST_YES
          indicates positive value for any request boolean flag.
 
Constructor Summary
WaybackRequest()
           
 
Method Summary
 WaybackRequest clone()
           
 boolean containsKey(java.lang.String key)
          Deprecated.  
 void fixup(javax.servlet.http.HttpServletRequest httpRequest)
          attempt to fixup this WaybackRequest, mostly with respect to dates: if only "date" was specified, infer start and end dates from it.
 java.lang.String get(java.lang.String key)
           
 AccessPoint getAccessPoint()
           
 java.util.Date getAnchorDate()
           
 java.lang.String getAnchorTimestamp()
           
 long getAnchorWindow()
           
 java.lang.String getAuthType()
           
 java.lang.String getContextPrefix()
          Construct an absolute URL that points to the root of the context that received the request, including a trailing "/".
 java.util.Date getEndDate()
           
 java.lang.String getEndTimestamp()
           
 ObjectFilter<CaptureSearchResult> getExclusionFilter()
           
 StringFormatter getFormatter()
           
 java.lang.String getLocaleLanguage()
           
 int getPageNum()
           
 java.lang.String getQueryArguments()
           
 java.lang.String getQueryArguments(int pageNum)
           
 java.lang.String getRefererUrl()
           
 java.lang.String getRemoteIPAddress()
           
 java.lang.String getRemoteUser()
           
 java.util.Date getReplayDate()
           
 java.lang.String getReplayTimestamp()
           
 java.lang.String getRequestUrl()
           
 int getResultsPerPage()
           
 java.lang.String getServerPrefix()
           
 java.util.Date getStartDate()
           
 java.lang.String getStartTimestamp()
           
 java.lang.String getTimelineResolution()
           
 java.lang.String getWaybackContext()
           
 java.lang.String getWaybackHostname()
           
 int getWaybackPort()
           
 boolean isCaptureQueryRequest()
           
 boolean isExactHost()
           
 boolean isExactScheme()
           
 boolean isMetaMode()
           
 boolean isReplayRequest()
           
 boolean isUrlQueryRequest()
           
 boolean isXMLMode()
           
 java.util.Set<java.lang.String> keySet()
          Deprecated.  
 void put(java.lang.String key, java.lang.String value)
           
 void remove(java.lang.String key)
           
 void setAccessPoint(AccessPoint accessPoint)
           
 void setAnchorDate(java.util.Date date)
           
 void setAnchorTimestamp(java.lang.String timestamp)
           
 void setAnchorWindow(long seconds)
           
 void setCaptureQueryRequest()
          marks this request as a Replay request
 void setContextPrefix(java.lang.String prefix)
           
 void setEndDate(java.util.Date date)
           
 void setEndTimestamp(java.lang.String timestamp)
           
 void setExactHost(boolean isExactHost)
           
 void setExactScheme(boolean isExactScheme)
           
 void setExclusionFilter(ObjectFilter<CaptureSearchResult> exclusionFilter)
           
 void setLocale(java.util.Locale l)
          Set the Locale for the request, which impacts UI Strings
 void setMetaMode(boolean isMetaMode)
           
 void setPageNum(int pageNum)
           
 void setReplayDate(java.util.Date date)
           
 void setReplayRequest()
          marks this request as a Replay request
 void setReplayTimestamp(java.lang.String timestamp)
           
 void setRequestUrl(java.lang.String urlStr)
          Set the request URL.
 void setResultsPerPage(int resultsPerPage)
           
 void setServerPrefix(java.lang.String prefix)
           
 void setStartDate(java.util.Date date)
           
 void setStartTimestamp(java.lang.String timestamp)
           
 void setTimelineAutoResolution()
           
 void setTimelineDayResolution()
           
 void setTimelineHourResolution()
           
 void setTimelineMonthResolution()
           
 void setTimelineTwoMonthResolution()
           
 void setTimelineYearResolution()
           
 void setUrlQueryRequest()
          marks this request as a Replay request
 void setXMLMode(boolean isXMLMode)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_TYPE

public static final java.lang.String REQUEST_TYPE
specifies the TYPE of the this particular request. One of: *) REQUEST_REPLAY_QUERY *) REQUEST_CAPTURE_QUERY *) REQUEST_URL_QUERY

See Also:
Constant Field Values

REQUEST_REPLAY_QUERY

public static final java.lang.String REQUEST_REPLAY_QUERY
REQUEST_TYPE option indicating a request for Replay of the Resource matching REQUEST_URL closest in time to REQUEST_DATE

See Also:
Constant Field Values

REQUEST_CAPTURE_QUERY

public static final java.lang.String REQUEST_CAPTURE_QUERY
REQUEST_TYPE option indicating a query against the ResourceIndex for captures of URLs matching the REQUEST_URL

See Also:
Constant Field Values

REQUEST_URL_QUERY

public static final java.lang.String REQUEST_URL_QUERY
REQUEST_TYPE option indicating a query against the ResourceIndex for summaries of URLs prefixed with the REQUEST_URL

See Also:
Constant Field Values

REQUEST_URL

public static final java.lang.String REQUEST_URL
GUARANTEED PRESENT: Original(RAW) URL or URL prefix requested, before any cleanup/fixing

See Also:
Constant Field Values

REQUEST_END_DATE

public static final java.lang.String REQUEST_END_DATE
GUARANTEED PRESENT: omit results after this 14-digit String timestamp. Possibly created from: 1) specified directly in request 2) a partial REQUEST_DATE (latest possible given a prefix) 3) RequestParser default 4) 14-digit representation of the moment the request was recieved.

See Also:
Constant Field Values

REQUEST_START_DATE

public static final java.lang.String REQUEST_START_DATE
GUARANTEED PRESENT: omit results before this 14-digit String timestamp. Possibly created from: 1) specified directly in request 2) a partial REQUEST_DATE (earliest possible given a prefix) 3) RequestParser default 4) 14-digit representation of midnight Jan 1, 1996.

See Also:
Constant Field Values

REQUEST_DATE

public static final java.lang.String REQUEST_DATE
GUARANTEED PRESENT for Replay requests only. If present for Query requests, then it will be interpreted as a partial timestamp for missing REQUEST_START_DATE and REQUEST_END_DATE fields. Original (RAW/possibly partial) 14-digit timestamp of date requested for Replay

See Also:
Constant Field Values

REQUEST_EXACT_DATE

public static final java.lang.String REQUEST_EXACT_DATE
GUARANTEED PRESENT for Replay requests only, no meaning for Query requests. Cleaned up version of original REQUEST_DATE, padded to 14 digits assuming the

See Also:
Constant Field Values

REQUEST_EXACT_HOST_ONLY

public static final java.lang.String REQUEST_EXACT_HOST_ONLY
Indicates user only wants results that exactly match the hostname within REQUEST_URL -- no canonicalization.

See Also:
Constant Field Values

REQUEST_EXACT_SCHEME_ONLY

public static final java.lang.String REQUEST_EXACT_SCHEME_ONLY
Indicates user only wants results that were captured using the same scheme as that specified in REQUEST_URL.

See Also:
Constant Field Values

REQUEST_YES

public static final java.lang.String REQUEST_YES
indicates positive value for any request boolean flag.

See Also:
Constant Field Values

REQUEST_ANCHOR_DATE

public static final java.lang.String REQUEST_ANCHOR_DATE
Replay-Only: indicates the date to tend towards when computing closest matches within time. Used to prevent "time drift" while surfing from a particular date.

See Also:
Constant Field Values

REQUEST_ANCHOR_WINDOW

public static final java.lang.String REQUEST_ANCHOR_WINDOW
Replay-Only: String representation of number of seconds. Used only in conjunction with REQUEST_ANCHOR_DATE, and indicates that documents more than this many seconds should not be shown in a replay session. Useful for QA purposes, to ensure that all content within a replay session was crawled near a particular point, the REQUEST_ANCHOR_DATE.

See Also:
Constant Field Values

REQUEST_META_MODE

public static final java.lang.String REQUEST_META_MODE
Request: replay actual document or metadata for document: "yes" means replay metadata only, not the actual document: (TimeLine mode)

See Also:
Constant Field Values

REQUEST_XML_DATA

public static final java.lang.String REQUEST_XML_DATA
Request: xml data requested

See Also:
Constant Field Values

REQUEST_WAYBACK_CONTEXT

public static final java.lang.String REQUEST_WAYBACK_CONTEXT
the string (webapp) context that received this request

See Also:
Constant Field Values

REQUEST_WAYBACK_PORT

public static final java.lang.String REQUEST_WAYBACK_PORT
the port the remote user connected to for this request

See Also:
Constant Field Values

REQUEST_WAYBACK_HOSTNAME

public static final java.lang.String REQUEST_WAYBACK_HOSTNAME
incoming requests HTTP "Host:" header, or null

See Also:
Constant Field Values

REQUEST_REFERER_URL

public static final java.lang.String REQUEST_REFERER_URL
incoming requests HTTP "Referer:" header, or null

See Also:
Constant Field Values

REQUEST_REMOTE_ADDRESS

public static final java.lang.String REQUEST_REMOTE_ADDRESS
Remote Address that connected to this webapp to create the request string IP address: "127.0.0.1"

See Also:
Constant Field Values

REQUEST_REMOTE_USER

public static final java.lang.String REQUEST_REMOTE_USER
Remote User or null if the request did not contain auth info. see HttpServletRequest.getRemoteUser()

See Also:
Constant Field Values

REQUEST_LOCALE_LANG

public static final java.lang.String REQUEST_LOCALE_LANG
User Locale name: Best Guess at users requested locale. see ServletRequest.getLocale().getDisplayLanguage()

See Also:
Constant Field Values

REQUEST_AUTH_TYPE

public static final java.lang.String REQUEST_AUTH_TYPE
Authorization Type: "BASIC", "SSL", or null if none. see HttpServletRequest.getAuthType()

See Also:
Constant Field Values

REQUEST_RESOLUTION

public static final java.lang.String REQUEST_RESOLUTION
resolution of results to be displayed: (TimeLine mode)

See Also:
Constant Field Values

REQUEST_RESOLUTION_AUTO

public static final java.lang.String REQUEST_RESOLUTION_AUTO
auto resolution (TimeLine mode)

See Also:
Constant Field Values

REQUEST_RESOLUTION_YEARS

public static final java.lang.String REQUEST_RESOLUTION_YEARS
year resolution (TimeLine mode)

See Also:
Constant Field Values

REQUEST_RESOLUTION_TWO_MONTHS

public static final java.lang.String REQUEST_RESOLUTION_TWO_MONTHS
two-month resolution (TimeLine mode)

See Also:
Constant Field Values

REQUEST_RESOLUTION_MONTHS

public static final java.lang.String REQUEST_RESOLUTION_MONTHS
month resolution (TimeLine mode)

See Also:
Constant Field Values

REQUEST_RESOLUTION_DAYS

public static final java.lang.String REQUEST_RESOLUTION_DAYS
day resolution (TimeLine mode)

See Also:
Constant Field Values

REQUEST_RESOLUTION_HOURS

public static final java.lang.String REQUEST_RESOLUTION_HOURS
hour resolution (TimeLine mode)

See Also:
Constant Field Values
Constructor Detail

WaybackRequest

public WaybackRequest()
Method Detail

getResultsPerPage

public int getResultsPerPage()
Returns:
Returns the resultsPerPage.

setResultsPerPage

public void setResultsPerPage(int resultsPerPage)
Parameters:
resultsPerPage - The resultsPerPage to set.

getPageNum

public int getPageNum()
Returns:
Returns the pageNum.

setPageNum

public void setPageNum(int pageNum)
Parameters:
pageNum - The pageNum to set.

setContextPrefix

public void setContextPrefix(java.lang.String prefix)
Parameters:
prefix -

getContextPrefix

public java.lang.String getContextPrefix()
Construct an absolute URL that points to the root of the context that received the request, including a trailing "/".

Returns:
String absolute URL pointing to the Context root where the request was received.

setServerPrefix

public void setServerPrefix(java.lang.String prefix)
Parameters:
prefix -

getServerPrefix

public java.lang.String getServerPrefix()
Parameters:
prefix -
Returns:
an absolute String URL that will point to the root of the server that is handling the request.

getAccessPoint

public AccessPoint getAccessPoint()
Returns:
the accessPoint

setAccessPoint

public void setAccessPoint(AccessPoint accessPoint)
Parameters:
accessPoint - the accessPoint to set

getExclusionFilter

public ObjectFilter<CaptureSearchResult> getExclusionFilter()

setExclusionFilter

public void setExclusionFilter(ObjectFilter<CaptureSearchResult> exclusionFilter)

getFormatter

public StringFormatter getFormatter()
Returns:
StringFormatter based on user request info

get

public java.lang.String get(java.lang.String key)
Parameters:
key -
Returns:
String value for key 'key', or null if no value exists

put

public void put(java.lang.String key,
                java.lang.String value)
Parameters:
key -
value -

remove

public void remove(java.lang.String key)

containsKey

public boolean containsKey(java.lang.String key)
Deprecated. 

Parameters:
key -
Returns:
boolean, true if the request contains key 'key'

isReplayRequest

public boolean isReplayRequest()
Returns:
true if this is a Replay request

setReplayRequest

public void setReplayRequest()
marks this request as a Replay request


isCaptureQueryRequest

public boolean isCaptureQueryRequest()
Returns:
true if this is a Capture Query request

setCaptureQueryRequest

public void setCaptureQueryRequest()
marks this request as a Replay request


isUrlQueryRequest

public boolean isUrlQueryRequest()
Returns:
true if this is an Url Query request

setUrlQueryRequest

public void setUrlQueryRequest()
marks this request as a Replay request


getRequestUrl

public java.lang.String getRequestUrl()

setRequestUrl

public void setRequestUrl(java.lang.String urlStr)
Set the request URL.

Parameters:
urlStr - Request URL.

getEndTimestamp

public java.lang.String getEndTimestamp()

getEndDate

public java.util.Date getEndDate()

setEndDate

public void setEndDate(java.util.Date date)

setEndTimestamp

public void setEndTimestamp(java.lang.String timestamp)

getStartTimestamp

public java.lang.String getStartTimestamp()

getStartDate

public java.util.Date getStartDate()

setStartDate

public void setStartDate(java.util.Date date)

setStartTimestamp

public void setStartTimestamp(java.lang.String timestamp)

getReplayTimestamp

public java.lang.String getReplayTimestamp()

getReplayDate

public java.util.Date getReplayDate()

setReplayDate

public void setReplayDate(java.util.Date date)

setReplayTimestamp

public void setReplayTimestamp(java.lang.String timestamp)

setExactHost

public void setExactHost(boolean isExactHost)

isExactHost

public boolean isExactHost()

setExactScheme

public void setExactScheme(boolean isExactScheme)

isExactScheme

public boolean isExactScheme()

getAnchorTimestamp

public java.lang.String getAnchorTimestamp()

getAnchorDate

public java.util.Date getAnchorDate()

setAnchorDate

public void setAnchorDate(java.util.Date date)

setAnchorTimestamp

public void setAnchorTimestamp(java.lang.String timestamp)

getAnchorWindow

public long getAnchorWindow()

setAnchorWindow

public void setAnchorWindow(long seconds)

setMetaMode

public void setMetaMode(boolean isMetaMode)

isMetaMode

public boolean isMetaMode()

setXMLMode

public void setXMLMode(boolean isXMLMode)

isXMLMode

public boolean isXMLMode()

getWaybackContext

public java.lang.String getWaybackContext()

getWaybackPort

public int getWaybackPort()

getWaybackHostname

public java.lang.String getWaybackHostname()

getRefererUrl

public java.lang.String getRefererUrl()

getRemoteIPAddress

public java.lang.String getRemoteIPAddress()

getRemoteUser

public java.lang.String getRemoteUser()

getLocaleLanguage

public java.lang.String getLocaleLanguage()

getAuthType

public java.lang.String getAuthType()

getTimelineResolution

public java.lang.String getTimelineResolution()

setTimelineAutoResolution

public void setTimelineAutoResolution()

setTimelineYearResolution

public void setTimelineYearResolution()

setTimelineTwoMonthResolution

public void setTimelineTwoMonthResolution()

setTimelineMonthResolution

public void setTimelineMonthResolution()

setTimelineDayResolution

public void setTimelineDayResolution()

setTimelineHourResolution

public void setTimelineHourResolution()

setLocale

public void setLocale(java.util.Locale l)
Set the Locale for the request, which impacts UI Strings

Parameters:
l -

fixup

public void fixup(javax.servlet.http.HttpServletRequest httpRequest)
attempt to fixup this WaybackRequest, mostly with respect to dates: if only "date" was specified, infer start and end dates from it. Also grab useful info from the HttpServletRequest, cookies, remote address, etc.

Parameters:
httpRequest -

getQueryArguments

public java.lang.String getQueryArguments()
Returns:
String hex-encoded GET CGI arguments which will duplicate this wayback request

getQueryArguments

public java.lang.String getQueryArguments(int pageNum)
Parameters:
pageNum -
Returns:
String hex-encoded GET CGI arguments which will duplicate the same request, but for page 'pageNum' of the results

clone

public WaybackRequest clone()
Overrides:
clone in class java.lang.Object

keySet

public java.util.Set<java.lang.String> keySet()
Deprecated. 

Returns:


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