Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public class DefaultReplayCaptureSelector implements ReplayCaptureSelector {

private CaptureSearchResult currentClosest;

public DefaultReplayCaptureSelector() {
}

/**
* Initialize object with {@link ReplayDispatcher}, to which
* closest-selection is delegated.
Expand Down Expand Up @@ -174,4 +177,12 @@ protected CaptureSearchResult findNextClosest() {
return next;
}
}

public CaptureSearchResult getCurrentClosest() {
return currentClosest;
}

public long getRequestMS() {
return requestMS;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import org.archive.wayback.util.url.UrlOperations;
import org.archive.wayback.util.webapp.AbstractRequestHandler;
import org.archive.wayback.util.webapp.ShutdownListener;
import org.archive.wayback.util.webapp.SpringReader;
import org.archive.wayback.webapp.LiveWebRedirector.LiveWebState;

/**
Expand Down Expand Up @@ -196,6 +197,8 @@ public static enum PerfStat {
private int maxRedirectAttempts = 0;

private boolean fixedEmbeds = false;

private ReplayCaptureSelector captureSelector = null;

public void init() {
checkAccessPointAware(collection,exception,query,parser,replay,
Expand Down Expand Up @@ -775,7 +778,7 @@ protected void handleReplay(WaybackRequest wbRequest,
p.queried();
}

ReplayCaptureSelector captureSelector = new DefaultReplayCaptureSelector(getReplay());
ReplayCaptureSelector captureSelector = (ReplayCaptureSelector)SpringReader.getCurrentContext().getBean("captureSelector", new Object [] { getReplay() });
captureSelector.setRequest(wbRequest);
captureSelector.setCaptures(captureResults);

Expand Down Expand Up @@ -1944,4 +1947,12 @@ public void setPerfStatsHeaderFormat(
PerfStats.OutputFormat perfStatsHeaderFormat) {
this.perfStatsHeaderFormat = perfStatsHeaderFormat;
}

public ReplayCaptureSelector getCaptureSelector() {
return captureSelector;
}

public void setCaptureSelector(ReplayCaptureSelector captureSelector) {
this.captureSelector = captureSelector;
}
}