Made RoutedRequest a simple class
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@645846 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f2ef6c15a6
commit
21705fdb9c
|
@ -264,7 +264,7 @@ public class DefaultClientRequestDirector
|
|||
origWrapper.setParams(params);
|
||||
HttpRoute origRoute = determineRoute(target, origWrapper, context);
|
||||
|
||||
RoutedRequest roureq = new RoutedRequest.Impl(origWrapper, origRoute);
|
||||
RoutedRequest roureq = new RoutedRequest(origWrapper, origRoute);
|
||||
|
||||
long timeout = HttpClientParams.getConnectionManagerTimeout(params);
|
||||
|
||||
|
@ -822,7 +822,7 @@ public class DefaultClientRequestDirector
|
|||
wrapper.setParams(params);
|
||||
|
||||
HttpRoute newRoute = determineRoute(newTarget, wrapper, context);
|
||||
RoutedRequest newRequest = new RoutedRequest.Impl(wrapper, newRoute);
|
||||
RoutedRequest newRequest = new RoutedRequest(wrapper, newRoute);
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Redirecting to '" + uri + "' via " + newRoute);
|
||||
|
|
|
@ -45,55 +45,29 @@ import org.apache.http.conn.routing.HttpRoute;
|
|||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public interface RoutedRequest {
|
||||
public class RoutedRequest {
|
||||
|
||||
protected final RequestWrapper request;
|
||||
protected final HttpRoute route;
|
||||
|
||||
/**
|
||||
* Obtains the request.
|
||||
* Creates a new routed request.
|
||||
*
|
||||
* @return the request
|
||||
* @param req the request
|
||||
* @param route the route
|
||||
*/
|
||||
RequestWrapper getRequest()
|
||||
;
|
||||
public RoutedRequest(final RequestWrapper req, final HttpRoute route) {
|
||||
super();
|
||||
this.request = req;
|
||||
this.route = route;
|
||||
}
|
||||
|
||||
public final RequestWrapper getRequest() {
|
||||
return request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains the route.
|
||||
*
|
||||
* @return the route
|
||||
*/
|
||||
HttpRoute getRoute()
|
||||
;
|
||||
|
||||
|
||||
/**
|
||||
* Trivial default implementation of a routed request.
|
||||
*/
|
||||
public static class Impl implements RoutedRequest {
|
||||
|
||||
protected final RequestWrapper request;
|
||||
protected final HttpRoute route;
|
||||
|
||||
/**
|
||||
* Creates a new routed request.
|
||||
*
|
||||
* @param req the request
|
||||
* @param rou the route
|
||||
*/
|
||||
public Impl(RequestWrapper req, HttpRoute rou) {
|
||||
this.request = req;
|
||||
this.route = rou;
|
||||
}
|
||||
|
||||
// non-javadoc, see interface
|
||||
public final RequestWrapper getRequest() {
|
||||
return request;
|
||||
}
|
||||
|
||||
// non-javadoc, see interface
|
||||
public final HttpRoute getRoute() {
|
||||
return route;
|
||||
}
|
||||
} // class Impl
|
||||
|
||||
public final HttpRoute getRoute() {
|
||||
return route;
|
||||
}
|
||||
|
||||
} // interface RoutedRequest
|
||||
|
|
Loading…
Reference in New Issue