From: <bra...@us...> - 2008-02-21 01:55:33
|
Revision: 2203 http://archive-access.svn.sourceforge.net/archive-access/?rev=2203&view=rev Author: bradtofel Date: 2008-02-20 17:55:36 -0800 (Wed, 20 Feb 2008) Log Message: ----------- BUGFIX: (ACC-11) now associates last requested timestamp for the current user with query as well as replay requests, allowing the closest indicator to be set properly on XML query requests. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/proxy/ProxyReplayRequestParser.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/proxy/ProxyRequestParser.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/proxy/ProxyReplayRequestParser.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/proxy/ProxyReplayRequestParser.java 2008-02-20 23:50:37 UTC (rev 2202) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/proxy/ProxyReplayRequestParser.java 2008-02-21 01:55:36 UTC (rev 2203) @@ -31,7 +31,6 @@ import org.apache.commons.httpclient.URIException; import org.archive.util.InetAddressUtil; import org.archive.wayback.WaybackConstants; -import org.archive.wayback.core.Timestamp; import org.archive.wayback.core.WaybackRequest; import org.archive.wayback.exception.BadQueryException; import org.archive.wayback.requestparser.BaseRequestParser; @@ -96,15 +95,6 @@ wbRequest.put(WaybackConstants.REQUEST_TYPE, WaybackConstants.REQUEST_REPLAY_QUERY); - // Get the id from the request. If no id, use the ip-address instead. - // Then get the timestamp (or rather datestr) matching this id. - String id = httpRequest.getHeader("Proxy-Id"); - if (id == null) - id = httpRequest.getRemoteAddr(); - wbRequest.put(WaybackConstants.REQUEST_EXACT_DATE, Timestamp - .getTimestampForId(httpRequest.getContextPath(), id)); - wbRequest.fixup(httpRequest); - return wbRequest; } public List<String> getLocalhostNames() { Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/proxy/ProxyRequestParser.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/proxy/ProxyRequestParser.java 2008-02-20 23:50:37 UTC (rev 2202) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/proxy/ProxyRequestParser.java 2008-02-21 01:55:36 UTC (rev 2203) @@ -26,10 +26,17 @@ import java.util.List; +import javax.servlet.http.HttpServletRequest; + import org.archive.wayback.RequestParser; +import org.archive.wayback.WaybackConstants; +import org.archive.wayback.core.Timestamp; +import org.archive.wayback.core.WaybackRequest; +import org.archive.wayback.exception.BadQueryException; import org.archive.wayback.requestparser.CompositeRequestParser; import org.archive.wayback.requestparser.FormRequestParser; import org.archive.wayback.requestparser.OpenSearchRequestParser; +import org.archive.wayback.webapp.AccessPoint; /** * @@ -54,4 +61,20 @@ public void setLocalhostNames(List<String> localhostNames) { prrp.setLocalhostNames(localhostNames); } + public WaybackRequest parse(HttpServletRequest httpRequest, + AccessPoint wbContext) throws BadQueryException { + + WaybackRequest wbRequest = super.parse(httpRequest, wbContext); + if (wbRequest != null) { + // Get the id from the request. If no id, use the ip-address instead. + // Then get the timestamp (or rather datestr) matching this id. + String id = httpRequest.getHeader("Proxy-Id"); + if (id == null) + id = httpRequest.getRemoteAddr(); + wbRequest.put(WaybackConstants.REQUEST_EXACT_DATE, Timestamp + .getTimestampForId(httpRequest.getContextPath(), id)); + wbRequest.fixup(httpRequest); + } + return wbRequest; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |