mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-17 07:26:47 +00:00
Javadoc updates
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@764588 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c74443f68b
commit
a23c18ac1e
@ -55,8 +55,7 @@ public interface ConnConnectionPNames {
|
||||
* <p>
|
||||
* This parameter expects a value of type {@link Integer}.
|
||||
* 0 disallows all garbage/empty lines before the status line.
|
||||
* Use {@link java.lang.Integer#MAX_VALUE} for unlimited
|
||||
* (default in lenient mode).
|
||||
* Use {@link java.lang.Integer#MAX_VALUE} for unlimited number.
|
||||
* </p>
|
||||
*/
|
||||
public static final String MAX_STATUS_LINE_GARBAGE = "http.connection.max-status-line-garbage";
|
||||
|
@ -33,24 +33,15 @@
|
||||
|
||||
import net.jcip.annotations.Immutable;
|
||||
|
||||
|
||||
/**
|
||||
* Basic implementation of an {@link HttpRouteDirector HttpRouteDirector}.
|
||||
* This implementation is stateless and therefore thread-safe.
|
||||
*
|
||||
*
|
||||
*
|
||||
* <!-- empty lines to avoid svn diff problems -->
|
||||
* @version $Revision$
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
@Immutable
|
||||
public class BasicRouteDirector implements HttpRouteDirector {
|
||||
|
||||
// public default constructor
|
||||
|
||||
|
||||
/**
|
||||
* Provides the next step.
|
||||
*
|
||||
@ -178,5 +169,4 @@ protected int proxiedStep(RouteInfo plan, RouteInfo fact) {
|
||||
return COMPLETE;
|
||||
}
|
||||
|
||||
|
||||
} // class BasicRouteDirector
|
||||
}
|
||||
|
@ -41,11 +41,6 @@
|
||||
* The route for a request.
|
||||
* Instances of this class are unmodifiable and therefore suitable
|
||||
* for use as lookup keys.
|
||||
*
|
||||
*
|
||||
*
|
||||
* <!-- empty lines to avoid svn diff problems -->
|
||||
* @version $Revision$
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
@ -274,13 +269,11 @@ public final InetAddress getLocalAddress() {
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final int getHopCount() {
|
||||
return proxyChain.length+1;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final HttpHost getHopTarget(int hop) {
|
||||
if (hop < 0)
|
||||
throw new IllegalArgumentException
|
||||
@ -301,37 +294,31 @@ public final HttpHost getHopTarget(int hop) {
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final HttpHost getProxyHost() {
|
||||
return (this.proxyChain.length == 0) ? null : this.proxyChain[0];
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final TunnelType getTunnelType() {
|
||||
return this.tunnelled;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final boolean isTunnelled() {
|
||||
return (this.tunnelled == TunnelType.TUNNELLED);
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final LayerType getLayerType() {
|
||||
return this.layered;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final boolean isLayered() {
|
||||
return (this.layered == LayerType.LAYERED);
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final boolean isSecure() {
|
||||
return this.secure;
|
||||
}
|
||||
@ -441,5 +428,4 @@ public Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
|
||||
} // class HttpRoute
|
||||
}
|
||||
|
@ -31,17 +31,10 @@
|
||||
|
||||
package org.apache.http.conn.routing;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Provides directions on establishing a route.
|
||||
* Implementations of this interface compare a planned route with
|
||||
* a tracked route and indicate the next step required.
|
||||
*
|
||||
*
|
||||
*
|
||||
* <!-- empty lines to avoid svn diff problems -->
|
||||
* @version $Revision$
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
@ -80,8 +73,6 @@ public interface HttpRouteDirector {
|
||||
* either the next step to perform, or success, or failure.
|
||||
* 0 is for success, a negative value for failure.
|
||||
*/
|
||||
public int nextStep(RouteInfo plan, RouteInfo fact)
|
||||
;
|
||||
public int nextStep(RouteInfo plan, RouteInfo fact);
|
||||
|
||||
|
||||
} // interface HttpRouteDirector
|
||||
}
|
||||
|
@ -36,8 +36,6 @@
|
||||
import org.apache.http.HttpRequest;
|
||||
import org.apache.http.protocol.HttpContext;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Encapsulates logic to compute a {@link HttpRoute} to a target host.
|
||||
* Implementations may for example be based on parameters, or on the
|
||||
@ -64,8 +62,6 @@ public interface HttpRoutePlanner {
|
||||
*/
|
||||
public HttpRoute determineRoute(HttpHost target,
|
||||
HttpRequest request,
|
||||
HttpContext context)
|
||||
throws HttpException
|
||||
;
|
||||
HttpContext context) throws HttpException;
|
||||
|
||||
}
|
||||
|
@ -35,22 +35,16 @@
|
||||
|
||||
import org.apache.http.HttpHost;
|
||||
|
||||
|
||||
/**
|
||||
* Read-only interface for route information.
|
||||
*
|
||||
*
|
||||
*
|
||||
* <!-- empty lines to avoid svn diff problems -->
|
||||
* @version $Revision$
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public interface RouteInfo {
|
||||
|
||||
/**
|
||||
* The tunnelling type of a route.
|
||||
* Plain routes are established by connecting to the target or
|
||||
* Plain routes are established by connecting to the target or
|
||||
* the first proxy.
|
||||
* Tunnelled routes are established by connecting to the first proxy
|
||||
* and tunnelling through all proxies to the target.
|
||||
@ -73,16 +67,12 @@ public enum TunnelType { PLAIN, TUNNELLED }
|
||||
*/
|
||||
public enum LayerType { PLAIN, LAYERED }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Obtains the target host.
|
||||
*
|
||||
* @return the target host
|
||||
*/
|
||||
HttpHost getTargetHost()
|
||||
;
|
||||
|
||||
HttpHost getTargetHost();
|
||||
|
||||
/**
|
||||
* Obtains the local address to connect from.
|
||||
@ -90,9 +80,7 @@ HttpHost getTargetHost()
|
||||
* @return the local address,
|
||||
* or <code>null</code>
|
||||
*/
|
||||
InetAddress getLocalAddress()
|
||||
;
|
||||
|
||||
InetAddress getLocalAddress();
|
||||
|
||||
/**
|
||||
* Obtains the number of hops in this route.
|
||||
@ -101,9 +89,7 @@ InetAddress getLocalAddress()
|
||||
*
|
||||
* @return the number of hops in this route
|
||||
*/
|
||||
int getHopCount()
|
||||
;
|
||||
|
||||
int getHopCount();
|
||||
|
||||
/**
|
||||
* Obtains the target of a hop in this route.
|
||||
@ -121,9 +107,7 @@ int getHopCount()
|
||||
* if the argument is negative or not less than
|
||||
* {@link #getHopCount getHopCount()}
|
||||
*/
|
||||
HttpHost getHopTarget(int hop)
|
||||
;
|
||||
|
||||
HttpHost getHopTarget(int hop);
|
||||
|
||||
/**
|
||||
* Obtains the first proxy host.
|
||||
@ -131,9 +115,7 @@ HttpHost getHopTarget(int hop)
|
||||
* @return the first proxy in the proxy chain, or
|
||||
* <code>null</code> if this route is direct
|
||||
*/
|
||||
HttpHost getProxyHost()
|
||||
;
|
||||
|
||||
HttpHost getProxyHost();
|
||||
|
||||
/**
|
||||
* Obtains the tunnel type of this route.
|
||||
@ -141,9 +123,7 @@ HttpHost getProxyHost()
|
||||
*
|
||||
* @return the tunnelling type
|
||||
*/
|
||||
TunnelType getTunnelType()
|
||||
;
|
||||
|
||||
TunnelType getTunnelType();
|
||||
|
||||
/**
|
||||
* Checks whether this route is tunnelled through a proxy.
|
||||
@ -153,9 +133,7 @@ TunnelType getTunnelType()
|
||||
* one proxy,
|
||||
* <code>false</code> otherwise
|
||||
*/
|
||||
boolean isTunnelled()
|
||||
;
|
||||
|
||||
boolean isTunnelled();
|
||||
|
||||
/**
|
||||
* Obtains the layering type of this route.
|
||||
@ -164,9 +142,7 @@ boolean isTunnelled()
|
||||
*
|
||||
* @return the layering type
|
||||
*/
|
||||
LayerType getLayerType()
|
||||
;
|
||||
|
||||
LayerType getLayerType();
|
||||
|
||||
/**
|
||||
* Checks whether this route includes a layered protocol.
|
||||
@ -176,9 +152,7 @@ LayerType getLayerType()
|
||||
* @return <code>true</code> if layered,
|
||||
* <code>false</code> otherwise
|
||||
*/
|
||||
boolean isLayered()
|
||||
;
|
||||
|
||||
boolean isLayered();
|
||||
|
||||
/**
|
||||
* Checks whether this route is secure.
|
||||
@ -186,8 +160,6 @@ boolean isLayered()
|
||||
* @return <code>true</code> if secure,
|
||||
* <code>false</code> otherwise
|
||||
*/
|
||||
boolean isSecure()
|
||||
;
|
||||
boolean isSecure();
|
||||
|
||||
|
||||
} // interface RouteInfo
|
||||
}
|
||||
|
@ -37,15 +37,9 @@
|
||||
|
||||
import org.apache.http.HttpHost;
|
||||
|
||||
|
||||
/**
|
||||
* Helps tracking the steps in establishing a route.
|
||||
*
|
||||
*
|
||||
*
|
||||
* <!-- empty lines to avoid svn diff problems -->
|
||||
* @version $Revision$
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
@NotThreadSafe
|
||||
@ -78,7 +72,6 @@ public final class RouteTracker implements RouteInfo, Cloneable {
|
||||
/** Whether the route is secure. */
|
||||
private boolean secure;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new route tracker.
|
||||
* The target and origin need to be specified at creation time.
|
||||
@ -109,7 +102,6 @@ public RouteTracker(HttpRoute route) {
|
||||
this(route.getTargetHost(), route.getLocalAddress());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tracks connecting to the target.
|
||||
*
|
||||
@ -124,7 +116,6 @@ public final void connectTarget(boolean secure) {
|
||||
this.secure = secure;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tracks connecting to the first proxy.
|
||||
*
|
||||
@ -144,7 +135,6 @@ public final void connectProxy(HttpHost proxy, boolean secure) {
|
||||
this.secure = secure;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tracks tunnelling to the target.
|
||||
*
|
||||
@ -162,7 +152,6 @@ public final void tunnelTarget(boolean secure) {
|
||||
this.secure = secure;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tracks tunnelling to a proxy in a proxy chain.
|
||||
* This will extend the tracked proxy chain, but it does not mark
|
||||
@ -193,7 +182,6 @@ public final void tunnelProxy(HttpHost proxy, boolean secure) {
|
||||
this.secure = secure;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tracks layering a protocol.
|
||||
*
|
||||
@ -211,21 +199,14 @@ public final void layerProtocol(boolean secure) {
|
||||
this.secure = secure;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final HttpHost getTargetHost() {
|
||||
return this.targetHost;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final InetAddress getLocalAddress() {
|
||||
return this.localAddress;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final int getHopCount() {
|
||||
int hops = 0;
|
||||
if (this.connected) {
|
||||
@ -237,8 +218,6 @@ public final int getHopCount() {
|
||||
return hops;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final HttpHost getHopTarget(int hop) {
|
||||
if (hop < 0)
|
||||
throw new IllegalArgumentException
|
||||
@ -259,49 +238,34 @@ public final HttpHost getHopTarget(int hop) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final HttpHost getProxyHost() {
|
||||
return (this.proxyChain == null) ? null : this.proxyChain[0];
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final boolean isConnected() {
|
||||
return this.connected;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final TunnelType getTunnelType() {
|
||||
return this.tunnelled;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final boolean isTunnelled() {
|
||||
return (this.tunnelled == TunnelType.TUNNELLED);
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final LayerType getLayerType() {
|
||||
return this.layered;
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final boolean isLayered() {
|
||||
return (this.layered == LayerType.LAYERED);
|
||||
}
|
||||
|
||||
|
||||
// non-JavaDoc, see interface RouteInfo
|
||||
public final boolean isSecure() {
|
||||
return this.secure;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Obtains the tracked route.
|
||||
* If a route has been tracked, it is {@link #isConnected connected}.
|
||||
@ -317,7 +281,6 @@ public final HttpRoute toRoute() {
|
||||
this.tunnelled, this.layered);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compares this tracked route to another.
|
||||
*
|
||||
@ -360,7 +323,6 @@ public final boolean equals(Object o) {
|
||||
return equal;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates a hash code for this tracked route.
|
||||
* Route trackers are modifiable and should therefore not be used
|
||||
@ -393,7 +355,6 @@ public final int hashCode() {
|
||||
return hc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Obtains a description of the tracked route.
|
||||
*
|
||||
@ -437,5 +398,4 @@ public Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
|
||||
} // class RouteTracker
|
||||
}
|
||||
|
@ -599,15 +599,6 @@ protected HttpRoute determineRoute(HttpHost target,
|
||||
protected void establishRoute(HttpRoute route, HttpContext context)
|
||||
throws HttpException, IOException {
|
||||
|
||||
//@@@ how to handle CONNECT requests for tunnelling?
|
||||
//@@@ refuse to send external CONNECT via director? special handling?
|
||||
|
||||
//@@@ should the request parameters already be used below?
|
||||
//@@@ probably yes, but they're not linked yet
|
||||
//@@@ will linking above cause problems with linking in reqExec?
|
||||
//@@@ probably not, because the parent is replaced
|
||||
//@@@ just make sure we don't link parameters to themselves
|
||||
|
||||
HttpRouteDirector rowdy = new BasicRouteDirector();
|
||||
int step;
|
||||
do {
|
||||
|
@ -139,7 +139,6 @@ public void open(HttpRoute route,
|
||||
throw new IllegalArgumentException
|
||||
("Route must not be null.");
|
||||
}
|
||||
//@@@ is context allowed to be null? depends on operator?
|
||||
if (params == null) {
|
||||
throw new IllegalArgumentException
|
||||
("Parameters must not be null.");
|
||||
@ -154,8 +153,6 @@ public void open(HttpRoute route,
|
||||
// In this order, we can be sure that only a successful
|
||||
// opening of the connection will be tracked.
|
||||
|
||||
//@@@ verify route against planned route?
|
||||
|
||||
this.tracker = new RouteTracker(route);
|
||||
final HttpHost proxy = route.getProxyHost();
|
||||
|
||||
@ -201,7 +198,6 @@ public void tunnelTarget(boolean secure, HttpParams params)
|
||||
("Parameters must not be null.");
|
||||
}
|
||||
|
||||
//@@@ check for proxy in planned route?
|
||||
if ((this.tracker == null) || !this.tracker.isConnected()) {
|
||||
throw new IllegalStateException("Connection not open.");
|
||||
}
|
||||
@ -210,8 +206,6 @@ public void tunnelTarget(boolean secure, HttpParams params)
|
||||
("Connection is already tunnelled.");
|
||||
}
|
||||
|
||||
// LOG.debug?
|
||||
|
||||
this.connection.update(null, tracker.getTargetHost(),
|
||||
secure, params);
|
||||
this.tracker.tunnelTarget(secure);
|
||||
|
Loading…
x
Reference in New Issue
Block a user