org.archive.wayback.replay
Class SelectorReplayDispatcher

java.lang.Object
  extended by org.archive.wayback.replay.SelectorReplayDispatcher
All Implemented Interfaces:
ReplayDispatcher

public class SelectorReplayDispatcher
extends Object
implements ReplayDispatcher

ReplayDispatcher instance which uses a configurable ClosestResultSelector to find the best result to show from a given set, and a list of ReplayRendererSelector to determine how best to replay that result to a user.

Version:
$Date: 2010-10-01 23:20:35 +0700 (Fri, 01 Oct 2010) $, $Revision: 3265 $
Author:
brad

Constructor Summary
SelectorReplayDispatcher()
           
 
Method Summary
 CaptureSearchResult getClosest(WaybackRequest wbRequest, CaptureSearchResults results)
           
 ClosestResultSelector getClosestSelector()
           
 ReplayRenderer getRenderer(WaybackRequest wbRequest, CaptureSearchResult result, Resource resource)
          Return a ReplayRenderer appropriate for the Resource.
 List<ReplayRendererSelector> getSelectors()
           
 void setClosestSelector(ClosestResultSelector closestSelector)
           
 void setSelectors(List<ReplayRendererSelector> selectors)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectorReplayDispatcher

public SelectorReplayDispatcher()
Method Detail

getRenderer

public ReplayRenderer getRenderer(WaybackRequest wbRequest,
                                  CaptureSearchResult result,
                                  Resource resource)
Description copied from interface: ReplayDispatcher
Return a ReplayRenderer appropriate for the Resource.

Specified by:
getRenderer in interface ReplayDispatcher
Parameters:
wbRequest - WaybackRequest being handled.
result - CapturSearchResult from the ResourceIndex which is being returned.
resource - Resource as returned by ResourceStore which should be returned to the user.
Returns:
an appropriate ReplayRenderer for the Resource, given the request context

getClosest

public CaptureSearchResult getClosest(WaybackRequest wbRequest,
                                      CaptureSearchResults results)
                               throws BetterRequestException
Specified by:
getClosest in interface ReplayDispatcher
Parameters:
wbRequest - the Request being handled
results - the CaptureSearchResults from the ResourceIndex
Returns:
the CaptureSearchResult to be rendered (best for the wbRequest)
Throws:
BetterRequestException - if the user should be directed to a different URL, with the exact timestamp, for example.

getSelectors

public List<ReplayRendererSelector> getSelectors()
Returns:
the List of ReplayRendererSelector objects configured

setSelectors

public void setSelectors(List<ReplayRendererSelector> selectors)
Parameters:
selectors - the List of ReplayRendererSelector to use

setClosestSelector

public void setClosestSelector(ClosestResultSelector closestSelector)
Parameters:
closestSelector - the closestSelector to set

getClosestSelector

public ClosestResultSelector getClosestSelector()
Returns:
the closestSelector


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