public interface ReplayCaptureSelector
WaybackRequest
and CaptureSearchResults
,
ReplayCaptureSelector
returns CaptureSearchResult
in the
order of preference to fulfill the replay request.
After setting request
and captures
, the first call to
next()
returns the best capture to fulfill the request (typically
the one closest to the requested date). As it may disregard some
captures not suitable for the request, this first call to next()
may
return null
even though there are one or more captures in
captures
.
Subsequent call to next()
returns the second best candidate, third
best candidate, and so on, until it returns null
, which indicates
there's no more captures suitable for the request.
setCaptures(CaptureSearchResults)
may be called to re-initialize it
with new set of captures. Next call to next()
will return the best
capture within the capture set.
Note that ReplayCaptureSelector
evaluates captures' suitability for
the request solely on the information available in WaybackRequest
and
CaptureSearchResults
. Returned captures may turn out to be unsuitable
for the request for other reasons. For example, a capture may be unusable
because its record is inaccessible or it is a self-redirect.
AccessPoint
Modifier and Type | Method and Description |
---|---|
CaptureSearchResult |
next()
return next best capture.
|
void |
setCaptures(CaptureSearchResults captures)
set a list of captures to select replay candidate from.
|
void |
setRequest(WaybackRequest wbRequest)
set request information.
|
void setRequest(WaybackRequest wbRequest)
AccessPoint
calls this method just once on each instance.
wbRequest
- WaybackRequest for the replay requestvoid setCaptures(CaptureSearchResults captures)
AccessPoint
may call this method more than once with different
instance of CaptureSearchResults
within a request. When this
method is called, next next()
call shall return the best capture
in new CaptureSearchResults
.
Implementation can make changes to CaptureSearchResults for bookkeeping purposes etc.
captures
- CaptureSearchResults, non-null
CaptureSearchResult next()
null
if there's no more captures
suitable for the request.Copyright © 2005–2015 IIPC. All rights reserved.