Javadoc 8 fixes.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1619400 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2014-08-21 14:11:32 +00:00
parent 7e4cfbb688
commit 4007c05f9b
33 changed files with 182 additions and 97 deletions

View File

@ -50,15 +50,17 @@
* A connection manager for a single connection. This connection manager maintains only one active * A connection manager for a single connection. This connection manager maintains only one active
* connection. Even though this class is fully thread-safe it ought to be used by one execution * connection. Even though this class is fully thread-safe it ought to be used by one execution
* thread only, as only one thread a time can lease the connection at a time. * thread only, as only one thread a time can lease the connection at a time.
* <p/> * <p>
* This connection manager will make an effort to reuse the connection for subsequent requests * This connection manager will make an effort to reuse the connection for subsequent requests
* with the same {@link HttpRoute route}. It will, however, close the existing connection and * with the same {@link HttpRoute route}. It will, however, close the existing connection and
* open it for the given route, if the route of the persistent connection does not match that * open it for the given route, if the route of the persistent connection does not match that
* of the connection request. If the connection has been already been allocated * of the connection request. If the connection has been already been allocated
* {@link IllegalStateException} is thrown. * {@link IllegalStateException} is thrown.
* <p/> * </p>
* <p>
* This connection manager implementation should be used inside an EJB container instead of * This connection manager implementation should be used inside an EJB container instead of
* {@link PoolingClientConnectionManager}. * {@link PoolingClientConnectionManager}.
* </p>
* *
* @since 4.2 * @since 4.2
* *

View File

@ -36,10 +36,10 @@
/** /**
* {@code AuthScope} represents an authentication scope consisting of a host name, * {@code AuthScope} represents an authentication scope consisting of a host name,
* a port number, a realm name and an authentication scheme name. * a port number, a realm name and an authentication scheme name.
* <p/> * <p>
* This class can also optionally contain a host of origin, if created in response * This class can also optionally contain a host of origin, if created in response
* to authentication challenge from a specific host. * to authentication challenge from a specific host.
* * </p>
* @since 4.0 * @since 4.0
*/ */
@Immutable @Immutable

View File

@ -198,7 +198,7 @@ public void setCredentials(final Credentials credentials) {
/** /**
* Returns actual {@link AuthScope} if available * Returns actual {@link AuthScope} if available
* *
* @return actual authentication scope if available, <code>null</code otherwise * @return actual authentication scope if available, {@code null} otherwise
* *
* @deprecated (4.2) do not use. * @deprecated (4.2) do not use.
*/ */

View File

@ -154,12 +154,13 @@ HttpResponse execute(HttpHost target, HttpRequest request,
/** /**
* Executes HTTP request using the default context and processes the * Executes HTTP request using the default context and processes the
* response using the given response handler. * response using the given response handler.
* <p/> * <p>
* Implementing classes are required to ensure that the content entity * Implementing classes are required to ensure that the content entity
* associated with the response is fully consumed and the underlying * associated with the response is fully consumed and the underlying
* connection is released back to the connection manager automatically * connection is released back to the connection manager automatically
* in all cases relieving individual {@link ResponseHandler}s from * in all cases relieving individual {@link ResponseHandler}s from
* having to manage resource deallocation internally. * having to manage resource deallocation internally.
* </p>
* *
* @param request the request to execute * @param request the request to execute
* @param responseHandler the response handler * @param responseHandler the response handler
@ -176,12 +177,13 @@ <T> T execute(
/** /**
* Executes HTTP request using the given context and processes the * Executes HTTP request using the given context and processes the
* response using the given response handler. * response using the given response handler.
* <p/> * <p>
* Implementing classes are required to ensure that the content entity * Implementing classes are required to ensure that the content entity
* associated with the response is fully consumed and the underlying * associated with the response is fully consumed and the underlying
* connection is released back to the connection manager automatically * connection is released back to the connection manager automatically
* in all cases relieving individual {@link ResponseHandler}s from * in all cases relieving individual {@link ResponseHandler}s from
* having to manage resource deallocation internally. * having to manage resource deallocation internally.
* </p>
* *
* @param request the request to execute * @param request the request to execute
* @param responseHandler the response handler * @param responseHandler the response handler
@ -201,12 +203,13 @@ <T> T execute(
/** /**
* Executes HTTP request to the target using the default context and * Executes HTTP request to the target using the default context and
* processes the response using the given response handler. * processes the response using the given response handler.
* <p/> * <p>
* Implementing classes are required to ensure that the content entity * Implementing classes are required to ensure that the content entity
* associated with the response is fully consumed and the underlying * associated with the response is fully consumed and the underlying
* connection is released back to the connection manager automatically * connection is released back to the connection manager automatically
* in all cases relieving individual {@link ResponseHandler}s from * in all cases relieving individual {@link ResponseHandler}s from
* having to manage resource deallocation internally. * having to manage resource deallocation internally.
* </p>
* *
* @param target the target host for the request. * @param target the target host for the request.
* Implementations may accept <code>null</code> * Implementations may accept <code>null</code>
@ -228,12 +231,13 @@ <T> T execute(
/** /**
* Executes HTTP request to the target using the given context and * Executes HTTP request to the target using the given context and
* processes the response using the given response handler. * processes the response using the given response handler.
* <p/> * <p>
* Implementing classes are required to ensure that the content entity * Implementing classes are required to ensure that the content entity
* associated with the response is fully consumed and the underlying * associated with the response is fully consumed and the underlying
* connection is released back to the connection manager automatically * connection is released back to the connection manager automatically
* in all cases relieving individual {@link ResponseHandler}s from * in all cases relieving individual {@link ResponseHandler}s from
* having to manage resource deallocation internally. * having to manage resource deallocation internally.
* </p>
* *
* @param target the target host for the request. * @param target the target host for the request.
* Implementations may accept <code>null</code> * Implementations may accept <code>null</code>

View File

@ -35,9 +35,10 @@
* identify the current user if the context is user specific or to be * identify the current user if the context is user specific or to be
* <code>null</code> if the context does not contain any resources or details * <code>null</code> if the context does not contain any resources or details
* specific to the current user. * specific to the current user.
* <p/> * <p>
* The user token will be used to ensure that user specific resources will not * The user token will be used to ensure that user specific resources will not
* be shared with or reused by other users. * be shared with or reused by other users.
* </p>
* *
* @since 4.0 * @since 4.0
*/ */

View File

@ -103,17 +103,20 @@ public class RequestConfig implements Cloneable {
* a request body to determine if the origin server is willing to * a request body to determine if the origin server is willing to
* accept the request (based on the request headers) before the client * accept the request (based on the request headers) before the client
* sends the request body. * sends the request body.
* <p/> * <p>
* The use of the 'Expect: 100-continue' handshake can result in * The use of the 'Expect: 100-continue' handshake can result in
* a noticeable performance improvement for entity enclosing requests * a noticeable performance improvement for entity enclosing requests
* (such as POST and PUT) that require the target server's * (such as POST and PUT) that require the target server's
* authentication. * authentication.
* <p/> * </p>
* <p>
* 'Expect: 100-continue' handshake should be used with caution, as it * 'Expect: 100-continue' handshake should be used with caution, as it
* may cause problems with HTTP servers and proxies that do not support * may cause problems with HTTP servers and proxies that do not support
* HTTP/1.1 protocol. * HTTP/1.1 protocol.
* <p/> * </p>
* <p>
* Default: <code>false</code> * Default: <code>false</code>
* </p>
*/ */
public boolean isExpectContinueEnabled() { public boolean isExpectContinueEnabled() {
return expectContinueEnabled; return expectContinueEnabled;
@ -121,8 +124,9 @@ public boolean isExpectContinueEnabled() {
/** /**
* Returns HTTP proxy to be used for request execution. * Returns HTTP proxy to be used for request execution.
* <p/> * <p>
* Default: <code>null</code> * Default: <code>null</code>
* </p>
*/ */
public HttpHost getProxy() { public HttpHost getProxy() {
return proxy; return proxy;
@ -130,12 +134,14 @@ public HttpHost getProxy() {
/** /**
* Returns local address to be used for request execution. * Returns local address to be used for request execution.
* <p/> * <p>
* On machines with multiple network interfaces, this parameter * On machines with multiple network interfaces, this parameter
* can be used to select the network interface from which the * can be used to select the network interface from which the
* connection originates. * connection originates.
* <p/> * </p>
* <p>
* Default: <code>null</code> * Default: <code>null</code>
* </p>
*/ */
public InetAddress getLocalAddress() { public InetAddress getLocalAddress() {
return localAddress; return localAddress;
@ -146,8 +152,9 @@ public InetAddress getLocalAddress() {
* connection check can cause up to 30 millisecond overhead per request and * connection check can cause up to 30 millisecond overhead per request and
* should be used only when appropriate. For performance critical * should be used only when appropriate. For performance critical
* operations this check should be disabled. * operations this check should be disabled.
* <p/> * <p>
* Default: <code>false</code> since 4.4 * Default: <code>false</code> since 4.4
* </p>
* *
* @deprecated (4.4) Use {@link * @deprecated (4.4) Use {@link
* org.apache.http.impl.conn.PoolingHttpClientConnectionManager#getValidateAfterInactivity()} * org.apache.http.impl.conn.PoolingHttpClientConnectionManager#getValidateAfterInactivity()}
@ -160,8 +167,9 @@ public boolean isStaleConnectionCheckEnabled() {
/** /**
* Determines the name of the cookie specification to be used for HTTP state * Determines the name of the cookie specification to be used for HTTP state
* management. * management.
* <p/> * <p>
* Default: <code>null</code> * Default: <code>null</code>
* </p>
*/ */
public String getCookieSpec() { public String getCookieSpec() {
return cookieSpec; return cookieSpec;
@ -169,8 +177,9 @@ public String getCookieSpec() {
/** /**
* Determines whether redirects should be handled automatically. * Determines whether redirects should be handled automatically.
* <p/> * <p>
* Default: <code>true</code> * Default: <code>true</code>
* </p>
*/ */
public boolean isRedirectsEnabled() { public boolean isRedirectsEnabled() {
return redirectsEnabled; return redirectsEnabled;
@ -179,8 +188,9 @@ public boolean isRedirectsEnabled() {
/** /**
* Determines whether relative redirects should be rejected. HTTP specification * Determines whether relative redirects should be rejected. HTTP specification
* requires the location value be an absolute URI. * requires the location value be an absolute URI.
* <p/> * <p>
* Default: <code>true</code> * Default: <code>true</code>
* </p>
*/ */
public boolean isRelativeRedirectsAllowed() { public boolean isRelativeRedirectsAllowed() {
return relativeRedirectsAllowed; return relativeRedirectsAllowed;
@ -190,8 +200,9 @@ public boolean isRelativeRedirectsAllowed() {
* Determines whether circular redirects (redirects to the same location) should * Determines whether circular redirects (redirects to the same location) should
* be allowed. The HTTP spec is not sufficiently clear whether circular redirects * be allowed. The HTTP spec is not sufficiently clear whether circular redirects
* are permitted, therefore optionally they can be enabled * are permitted, therefore optionally they can be enabled
* <p/> * <p>
* Default: <code>false</code> * Default: <code>false</code>
* </p>
*/ */
public boolean isCircularRedirectsAllowed() { public boolean isCircularRedirectsAllowed() {
return circularRedirectsAllowed; return circularRedirectsAllowed;
@ -200,8 +211,9 @@ public boolean isCircularRedirectsAllowed() {
/** /**
* Returns the maximum number of redirects to be followed. The limit on number * Returns the maximum number of redirects to be followed. The limit on number
* of redirects is intended to prevent infinite loops. * of redirects is intended to prevent infinite loops.
* <p/> * <p>
* Default: <code>50</code> * Default: <code>50</code>
* </p>
*/ */
public int getMaxRedirects() { public int getMaxRedirects() {
return maxRedirects; return maxRedirects;
@ -209,8 +221,9 @@ public int getMaxRedirects() {
/** /**
* Determines whether authentication should be handled automatically. * Determines whether authentication should be handled automatically.
* <p/> * <p>
* Default: <code>true</code> * Default: <code>true</code>
* </p>
*/ */
public boolean isAuthenticationEnabled() { public boolean isAuthenticationEnabled() {
return authenticationEnabled; return authenticationEnabled;
@ -219,8 +232,9 @@ public boolean isAuthenticationEnabled() {
/** /**
* Determines the order of preference for supported authentication schemes * Determines the order of preference for supported authentication schemes
* when authenticating with the target host. * when authenticating with the target host.
* <p/> * <p>
* Default: <code>null</code> * Default: <code>null</code>
* </p>
*/ */
public Collection<String> getTargetPreferredAuthSchemes() { public Collection<String> getTargetPreferredAuthSchemes() {
return targetPreferredAuthSchemes; return targetPreferredAuthSchemes;
@ -229,8 +243,9 @@ public Collection<String> getTargetPreferredAuthSchemes() {
/** /**
* Determines the order of preference for supported authentication schemes * Determines the order of preference for supported authentication schemes
* when authenticating with the proxy host. * when authenticating with the proxy host.
* <p/> * <p>
* Default: <code>null</code> * Default: <code>null</code>
* </p>
*/ */
public Collection<String> getProxyPreferredAuthSchemes() { public Collection<String> getProxyPreferredAuthSchemes() {
return proxyPreferredAuthSchemes; return proxyPreferredAuthSchemes;
@ -240,11 +255,13 @@ public Collection<String> getProxyPreferredAuthSchemes() {
* Returns the timeout in milliseconds used when requesting a connection * Returns the timeout in milliseconds used when requesting a connection
* from the connection manager. A timeout value of zero is interpreted * from the connection manager. A timeout value of zero is interpreted
* as an infinite timeout. * as an infinite timeout.
* <p/> * <p>
* A timeout value of zero is interpreted as an infinite timeout. * A timeout value of zero is interpreted as an infinite timeout.
* A negative value is interpreted as undefined (system default). * A negative value is interpreted as undefined (system default).
* <p/> * </p>
* <p>
* Default: <code>-1</code> * Default: <code>-1</code>
* </p>
*/ */
public int getConnectionRequestTimeout() { public int getConnectionRequestTimeout() {
return connectionRequestTimeout; return connectionRequestTimeout;
@ -253,11 +270,13 @@ public int getConnectionRequestTimeout() {
/** /**
* Determines the timeout in milliseconds until a connection is established. * Determines the timeout in milliseconds until a connection is established.
* A timeout value of zero is interpreted as an infinite timeout. * A timeout value of zero is interpreted as an infinite timeout.
* <p/> * <p>
* A timeout value of zero is interpreted as an infinite timeout. * A timeout value of zero is interpreted as an infinite timeout.
* A negative value is interpreted as undefined (system default). * A negative value is interpreted as undefined (system default).
* <p/> * </p>
* <p>
* Default: <code>-1</code> * Default: <code>-1</code>
* </p>
*/ */
public int getConnectTimeout() { public int getConnectTimeout() {
return connectTimeout; return connectTimeout;
@ -267,11 +286,13 @@ public int getConnectTimeout() {
* Defines the socket timeout (<code>SO_TIMEOUT</code>) in milliseconds, * Defines the socket timeout (<code>SO_TIMEOUT</code>) in milliseconds,
* which is the timeout for waiting for data or, put differently, * which is the timeout for waiting for data or, put differently,
* a maximum period inactivity between two consecutive data packets). * a maximum period inactivity between two consecutive data packets).
* <p/> * <p>
* A timeout value of zero is interpreted as an infinite timeout. * A timeout value of zero is interpreted as an infinite timeout.
* A negative value is interpreted as undefined (system default). * A negative value is interpreted as undefined (system default).
* <p/> * </p>
* <p>
* Default: <code>-1</code> * Default: <code>-1</code>
* </p>
*/ */
public int getSocketTimeout() { public int getSocketTimeout() {
return socketTimeout; return socketTimeout;
@ -279,8 +300,9 @@ public int getSocketTimeout() {
/** /**
* Determines whether compressed entities should be decompressed automatically. * Determines whether compressed entities should be decompressed automatically.
* <p/> * <p>
* Default: <code>true</code> * Default: <code>true</code>
* </p>
* *
* @since 4.4 * @since 4.4
*/ */

View File

@ -47,9 +47,10 @@
/** /**
* Builder for {@link HttpEntity} instances. * Builder for {@link HttpEntity} instances.
* <p/> * <p>
* Several setter methods of this builder are mutually exclusive. In case of multiple invocations * Several setter methods of this builder are mutually exclusive. In case of multiple invocations
* of the following methods only the last one will have effect: * of the following methods only the last one will have effect:
* </p>
* <ul> * <ul>
* <li>{@link #setText(String)}</li> * <li>{@link #setText(String)}</li>
* <li>{@link #setBinary(byte[])}</li> * <li>{@link #setBinary(byte[])}</li>

View File

@ -57,12 +57,13 @@
/** /**
* Builder for {@link HttpUriRequest} instances. * Builder for {@link HttpUriRequest} instances.
* <p/> * <p>
* Please note that this class treats parameters differently depending on composition * Please note that this class treats parameters differently depending on composition
* of the request: if the request has a content entity explicitly set with * of the request: if the request has a content entity explicitly set with
* {@link #setEntity(org.apache.http.HttpEntity)} or it is not an entity enclosing method * {@link #setEntity(org.apache.http.HttpEntity)} or it is not an entity enclosing method
* (such as POST or PUT), parameters will be added to the query component of the request URI. * (such as POST or PUT), parameters will be added to the query component of the request URI.
* Otherwise, parameters will be added as a URL encoded {@link UrlEncodedFormEntity entity}. * Otherwise, parameters will be added as a URL encoded {@link UrlEncodedFormEntity entity}.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */

View File

@ -45,9 +45,10 @@
/** /**
* RequestExpectContinue is responsible for enabling the 'expect-continue' * RequestExpectContinue is responsible for enabling the 'expect-continue'
* handshake by adding <code>Expect</code> header. * handshake by adding <code>Expect</code> header.
* <p/> * <p>
* This interceptor takes into account {@link RequestConfig#isExpectContinueEnabled()} * This interceptor takes into account {@link RequestConfig#isExpectContinueEnabled()}
* setting. * setting.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */

View File

@ -289,9 +289,10 @@ public URIBuilder setQuery(final String query) {
/** /**
* Sets URI query parameters. The parameter name / values are expected to be unescaped * Sets URI query parameters. The parameter name / values are expected to be unescaped
* and may contain non ASCII characters. * and may contain non ASCII characters.
* <p/> * <p>
* Please note query parameters and custom query component are mutually exclusive. This method * Please note query parameters and custom query component are mutually exclusive. This method
* will remove custom query if present. * will remove custom query if present.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */
@ -311,9 +312,10 @@ public URIBuilder setParameters(final List <NameValuePair> nvps) {
/** /**
* Adds URI query parameters. The parameter name / values are expected to be unescaped * Adds URI query parameters. The parameter name / values are expected to be unescaped
* and may contain non ASCII characters. * and may contain non ASCII characters.
* <p/> * <p>
* Please note query parameters and custom query component are mutually exclusive. This method * Please note query parameters and custom query component are mutually exclusive. This method
* will remove custom query if present. * will remove custom query if present.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */
@ -331,9 +333,10 @@ public URIBuilder addParameters(final List <NameValuePair> nvps) {
/** /**
* Sets URI query parameters. The parameter name / values are expected to be unescaped * Sets URI query parameters. The parameter name / values are expected to be unescaped
* and may contain non ASCII characters. * and may contain non ASCII characters.
* <p/> * <p>
* Please note query parameters and custom query component are mutually exclusive. This method * Please note query parameters and custom query component are mutually exclusive. This method
* will remove custom query if present. * will remove custom query if present.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */
@ -355,9 +358,10 @@ public URIBuilder setParameters(final NameValuePair... nvps) {
/** /**
* Adds parameter to URI query. The parameter name and value are expected to be unescaped * Adds parameter to URI query. The parameter name and value are expected to be unescaped
* and may contain non ASCII characters. * and may contain non ASCII characters.
* <p/> * <p>
* Please note query parameters and custom query component are mutually exclusive. This method * Please note query parameters and custom query component are mutually exclusive. This method
* will remove custom query if present. * will remove custom query if present.
* </p>
*/ */
public URIBuilder addParameter(final String param, final String value) { public URIBuilder addParameter(final String param, final String value) {
if (this.queryParams == null) { if (this.queryParams == null) {
@ -373,9 +377,10 @@ public URIBuilder addParameter(final String param, final String value) {
/** /**
* Sets parameter of URI query overriding existing value if set. The parameter name and value * Sets parameter of URI query overriding existing value if set. The parameter name and value
* are expected to be unescaped and may contain non ASCII characters. * are expected to be unescaped and may contain non ASCII characters.
* <p/> * <p>
* Please note query parameters and custom query component are mutually exclusive. This method * Please note query parameters and custom query component are mutually exclusive. This method
* will remove custom query if present. * will remove custom query if present.
* </p>
*/ */
public URIBuilder setParameter(final String param, final String value) { public URIBuilder setParameter(final String param, final String value) {
if (this.queryParams == null) { if (this.queryParams == null) {
@ -411,9 +416,10 @@ public URIBuilder clearParameters() {
/** /**
* Sets custom URI query. The value is expected to be unescaped and may contain non ASCII * Sets custom URI query. The value is expected to be unescaped and may contain non ASCII
* characters. * characters.
* <p/> * <p>
* Please note query parameters and custom query component are mutually exclusive. This method * Please note query parameters and custom query component are mutually exclusive. This method
* will remove query parameters if present. * will remove query parameters if present.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */

View File

@ -75,9 +75,10 @@ boolean streamClosed(InputStream wrapped)
* Indicates that the {@link EofSensorInputStream stream} is aborted. * Indicates that the {@link EofSensorInputStream stream} is aborted.
* This method will be called only if EOF was <i>not</i> detected * This method will be called only if EOF was <i>not</i> detected
* before aborting. Otherwise, {@link #eofDetected eofDetected} is called. * before aborting. Otherwise, {@link #eofDetected eofDetected} is called.
* <p/> * <p>
* This method will also be invoked when an input operation causes an * This method will also be invoked when an input operation causes an
* IOException to be thrown to make sure the input stream gets shut down. * IOException to be thrown to make sure the input stream gets shut down.
* </p>
* *
* @param wrapped the underlying stream which has not reached EOF * @param wrapped the underlying stream which has not reached EOF
* *

View File

@ -35,15 +35,17 @@
/** /**
* Represents a manager of persistent client connections. * Represents a manager of persistent client connections.
* <p/> * <p>
* The purpose of an HTTP connection manager is to serve as a factory for new * The purpose of an HTTP connection manager is to serve as a factory for new
* HTTP connections, manage persistent connections and synchronize access to * HTTP connections, manage persistent connections and synchronize access to
* persistent connections making sure that only one thread of execution can * persistent connections making sure that only one thread of execution can
* have access to a connection at a time. * have access to a connection at a time.
* <p/> * </p>
* <p>
* Implementations of this interface must be thread-safe. Access to shared * Implementations of this interface must be thread-safe. Access to shared
* data must be synchronized as methods of this interface may be executed * data must be synchronized as methods of this interface may be executed
* from multiple threads. * from multiple threads.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */
@ -53,7 +55,7 @@ public interface HttpClientConnectionManager {
* Returns a new {@link ConnectionRequest}, from which a * Returns a new {@link ConnectionRequest}, from which a
* {@link HttpClientConnection} can be obtained or the request can be * {@link HttpClientConnection} can be obtained or the request can be
* aborted. * aborted.
* <p/> * <p>
* Please note that newly allocated connections can be returned * Please note that newly allocated connections can be returned
* in the closed state. The consumer of that connection is responsible * in the closed state. The consumer of that connection is responsible
* for fully establishing the route the to the connection target * for fully establishing the route the to the connection target
@ -70,6 +72,7 @@ public interface HttpClientConnectionManager {
* org.apache.http.conn.routing.HttpRoute, * org.apache.http.conn.routing.HttpRoute,
* org.apache.http.protocol.HttpContext) routeComplete} to mark the route * org.apache.http.protocol.HttpContext) routeComplete} to mark the route
* as fully completed. * as fully completed.
* </p>
* *
* @param route HTTP route of the requested connection. * @param route HTTP route of the requested connection.
* @param state expected state of the connection or <code>null</code> * @param state expected state of the connection or <code>null</code>

View File

@ -36,10 +36,11 @@
* Encapsulates logic to compute a {@link HttpRoute} to a target host. * Encapsulates logic to compute a {@link HttpRoute} to a target host.
* Implementations may for example be based on parameters, or on the * Implementations may for example be based on parameters, or on the
* standard Java system properties. * standard Java system properties.
* <p/> * <p>
* Implementations of this interface must be thread-safe. Access to shared * Implementations of this interface must be thread-safe. Access to shared
* data must be synchronized as methods of this interface may be executed * data must be synchronized as methods of this interface may be executed
* from multiple threads. * from multiple threads.
* </p>
* *
* @since 4.0 * @since 4.0
*/ */

View File

@ -36,8 +36,9 @@
* Encapsulates specifics of a protocol scheme such as "http" or "https". Schemes are identified * Encapsulates specifics of a protocol scheme such as "http" or "https". Schemes are identified
* by lowercase names. Supported schemes are typically collected in a {@link SchemeRegistry * by lowercase names. Supported schemes are typically collected in a {@link SchemeRegistry
* SchemeRegistry}. * SchemeRegistry}.
* <p/> * <p>
* For example, to configure support for "https://" URLs, you could write code like the following: * For example, to configure support for "https://" URLs, you could write code like the following:
* </p>
* <pre> * <pre>
* Scheme https = new Scheme("https", 443, new MySecureSocketFactory()); * Scheme https = new Scheme("https", 443, new MySecureSocketFactory());
* SchemeRegistry registry = new SchemeRegistry(); * SchemeRegistry registry = new SchemeRegistry();

View File

@ -66,13 +66,14 @@ public interface SchemeSocketFactory {
/** /**
* Connects a socket to the target host with the given remote address. * Connects a socket to the target host with the given remote address.
* <p/> * <p>
* Please note that {@link org.apache.http.conn.HttpInetSocketAddress} class should * Please note that {@link org.apache.http.conn.HttpInetSocketAddress} class should
* be used in order to pass the target remote address along with the original * be used in order to pass the target remote address along with the original
* {@link org.apache.http.HttpHost} value used to resolve the address. The use of * {@link org.apache.http.HttpHost} value used to resolve the address. The use of
* {@link org.apache.http.conn.HttpInetSocketAddress} can also ensure that no reverse * {@link org.apache.http.conn.HttpInetSocketAddress} can also ensure that no reverse
* DNS lookup will be performed if the target remote address was specified * DNS lookup will be performed if the target remote address was specified
* as an IP address. * as an IP address.
* </p>
* *
* @param sock the socket to connect, as obtained from * @param sock the socket to connect, as obtained from
* {@link #createSocket(HttpParams) createSocket}. * {@link #createSocket(HttpParams) createSocket}.

View File

@ -204,13 +204,15 @@ public static String[] getCNs(final X509Certificate cert) {
/** /**
* Extracts the array of SubjectAlt DNS names from an X509Certificate. * Extracts the array of SubjectAlt DNS names from an X509Certificate.
* Returns null if there aren't any. * Returns null if there aren't any.
* <p/> * <p>
* Note: Java doesn't appear able to extract international characters * Note: Java doesn't appear able to extract international characters
* from the SubjectAlts. It can only extract international characters * from the SubjectAlts. It can only extract international characters
* from the CN field. * from the CN field.
* <p/> * </p>
* <p>
* (Or maybe the version of OpenSSL I'm using to test isn't storing the * (Or maybe the version of OpenSSL I'm using to test isn't storing the
* international characters correctly in the SubjectAlts?). * international characters correctly in the SubjectAlts?).
* </p>
* *
* @param cert X509Certificate * @param cert X509Certificate
* @return Array of SubjectALT DNS names stored in the certificate. * @return Array of SubjectALT DNS names stored in the certificate.

View File

@ -33,13 +33,15 @@
/** /**
* The HostnameVerifier that works the same way as Curl and Firefox. * The HostnameVerifier that works the same way as Curl and Firefox.
* <p/> * <p>
* The hostname must match either the first CN, or any of the subject-alts. * The hostname must match either the first CN, or any of the subject-alts.
* A wildcard can occur in the CN, and in any of the subject-alts. * A wildcard can occur in the CN, and in any of the subject-alts.
* <p/> * </p>
* <p>
* The only difference between BROWSER_COMPATIBLE and STRICT is that a wildcard * The only difference between BROWSER_COMPATIBLE and STRICT is that a wildcard
* (such as "*.foo.com") with BROWSER_COMPATIBLE matches all subdomains, * (such as "*.foo.com") with BROWSER_COMPATIBLE matches all subdomains,
* including "a.b.foo.com". * including "a.b.foo.com".
* </p>
* *
* @since 4.0 * @since 4.0
* *

View File

@ -72,11 +72,12 @@ public final class DefaultHostnameVerifier implements HostnameVerifier {
* This contains a list of 2nd-level domains that aren't allowed to * This contains a list of 2nd-level domains that aren't allowed to
* have wildcards when combined with country-codes. * have wildcards when combined with country-codes.
* For example: [*.co.uk]. * For example: [*.co.uk].
* <p/> * <p>
* The [*.co.uk] problem is an interesting one. Should we just hope * The [*.co.uk] problem is an interesting one. Should we just hope
* that CA's would never foolishly allow such a certificate to happen? * that CA's would never foolishly allow such a certificate to happen?
* Looks like we're the only implementation guarding against this. * Looks like we're the only implementation guarding against this.
* Firefox, Curl, Sun Java 1.4, 5, 6 don't bother with this check. * Firefox, Curl, Sun Java 1.4, 5, 6 don't bother with this check.
* </p>
*/ */
private final static Pattern BAD_COUNTRY_WILDCARD_PATTERN = Pattern.compile( private final static Pattern BAD_COUNTRY_WILDCARD_PATTERN = Pattern.compile(
"^[a-z0-9\\-\\*]+\\.(ac|co|com|ed|edu|go|gouv|gov|info|lg|ne|net|or|org)\\.[a-z0-9\\-]{2}$", "^[a-z0-9\\-\\*]+\\.(ac|co|com|ed|edu|go|gouv|gov|info|lg|ne|net|or|org)\\.[a-z0-9\\-]{2}$",

View File

@ -36,18 +36,19 @@
* Java 5, Sun Java 6-rc. It's also pretty close to IE6. This * Java 5, Sun Java 6-rc. It's also pretty close to IE6. This
* implementation appears to be compliant with RFC 2818 for dealing with * implementation appears to be compliant with RFC 2818 for dealing with
* wildcards. * wildcards.
* <p/> * <p>
* The hostname must match either the first CN, or any of the subject-alts. * The hostname must match either the first CN, or any of the subject-alts.
* A wildcard can occur in the CN, and in any of the subject-alts. The * A wildcard can occur in the CN, and in any of the subject-alts. The
* one divergence from IE6 is how we only check the first CN. IE6 allows * one divergence from IE6 is how we only check the first CN. IE6 allows
* a match against any of the CNs present. We decided to follow in * a match against any of the CNs present. We decided to follow in
* Sun Java 1.4's footsteps and only check the first CN. (If you need * Sun Java 1.4's footsteps and only check the first CN. (If you need
* to check all the CN's, feel free to write your own implementation!). * to check all the CN's, feel free to write your own implementation!).
* <p/> * </p>
* <p>
* A wildcard such as "*.foo.com" matches only subdomains in the same * A wildcard such as "*.foo.com" matches only subdomains in the same
* level, for example "a.foo.com". It does not match deeper subdomains * level, for example "a.foo.com". It does not match deeper subdomains
* such as "a.b.foo.com". * such as "a.b.foo.com".
* * </p>
* *
* @since 4.0 * @since 4.0
* *

View File

@ -64,10 +64,11 @@
* Currently only qop=auth or no qop is supported. qop=auth-int * Currently only qop=auth or no qop is supported. qop=auth-int
* is unsupported. If auth and auth-int are provided, auth is * is unsupported. If auth and auth-int are provided, auth is
* used. * used.
* <p/> * <p>
* Since the digest username is included as clear text in the generated * Since the digest username is included as clear text in the generated
* Authentication header, the charset of the username must be compatible * Authentication header, the charset of the username must be compatible
* with the HTTP element charset used by the connection. * with the HTTP element charset used by the connection.
* </p>
* *
* @since 4.0 * @since 4.0
*/ */

View File

@ -41,11 +41,12 @@
* A generic {@link ResponseHandler} that works with the response entity * A generic {@link ResponseHandler} that works with the response entity
* for successful (2xx) responses. If the response code was >= 300, the response * for successful (2xx) responses. If the response code was >= 300, the response
* body is consumed and an {@link HttpResponseException} is thrown. * body is consumed and an {@link HttpResponseException} is thrown.
* <p/> * <p>
* If this is used with * If this is used with
* {@link org.apache.http.client.HttpClient#execute( * {@link org.apache.http.client.HttpClient#execute(
* org.apache.http.client.methods.HttpUriRequest, ResponseHandler)}, * org.apache.http.client.methods.HttpUriRequest, ResponseHandler)},
* HttpClient may handle redirects (3xx responses) internally. * HttpClient may handle redirects (3xx responses) internally.
* </p>
* *
* @since 4.4 * @since 4.4
*/ */

View File

@ -50,8 +50,9 @@
* Default implementation of {@link org.apache.http.client.AuthCache}. This implements * Default implementation of {@link org.apache.http.client.AuthCache}. This implements
* expects {@link org.apache.http.auth.AuthScheme} to be {@link java.io.Serializable} * expects {@link org.apache.http.auth.AuthScheme} to be {@link java.io.Serializable}
* in order to be cacheable. * in order to be cacheable.
* <p/> * <p>
* Instances of this class are thread safe as of version 4.4. * Instances of this class are thread safe as of version 4.4.
* </p>
* *
* @since 4.1 * @since 4.1
*/ */

View File

@ -39,11 +39,12 @@
* A {@link org.apache.http.client.ResponseHandler} that returns the response body as a String * A {@link org.apache.http.client.ResponseHandler} that returns the response body as a String
* for successful (2xx) responses. If the response code was >= 300, the response * for successful (2xx) responses. If the response code was >= 300, the response
* body is consumed and an {@link org.apache.http.client.HttpResponseException} is thrown. * body is consumed and an {@link org.apache.http.client.HttpResponseException} is thrown.
* <p/> * <p>
* If this is used with * If this is used with
* {@link org.apache.http.client.HttpClient#execute( * {@link org.apache.http.client.HttpClient#execute(
* org.apache.http.client.methods.HttpUriRequest, org.apache.http.client.ResponseHandler)}, * org.apache.http.client.methods.HttpUriRequest, org.apache.http.client.ResponseHandler)},
* HttpClient may handle redirects (3xx responses) internally. * HttpClient may handle redirects (3xx responses) internally.
* </p>
* *
* @since 4.0 * @since 4.0
*/ */

View File

@ -62,9 +62,10 @@
* {@code 307 Temporary Redirect} status codes will result in an automatic redirect of * {@code 307 Temporary Redirect} status codes will result in an automatic redirect of
* HEAD and GET methods only. POST and PUT methods will not be automatically redirected * HEAD and GET methods only. POST and PUT methods will not be automatically redirected
* as requiring user confirmation. * as requiring user confirmation.
* <p/> * <p>
* The restriction on automatic redirection of POST methods can be relaxed by using * The restriction on automatic redirection of POST methods can be relaxed by using
* {@link LaxRedirectStrategy} instead of {@link DefaultRedirectStrategy}. * {@link LaxRedirectStrategy} instead of {@link DefaultRedirectStrategy}.
* </p>
* *
* @see LaxRedirectStrategy * @see LaxRedirectStrategy
* @since 4.1 * @since 4.1

View File

@ -122,12 +122,13 @@
/** /**
* Builder for {@link CloseableHttpClient} instances. * Builder for {@link CloseableHttpClient} instances.
* <p/> * <p>
* When a particular component is not explicitly this class will * When a particular component is not explicitly this class will
* use its default implementation. System properties will be taken * use its default implementation. System properties will be taken
* into account when configuring the default implementations when * into account when configuring the default implementations when
* {@link #useSystemProperties()} method is called prior to calling * {@link #useSystemProperties()} method is called prior to calling
* {@link #build()}. * {@link #build()}.
* </p>
* <ul> * <ul>
* <li>ssl.TrustManagerFactory.algorithm</li> * <li>ssl.TrustManagerFactory.algorithm</li>
* <li>javax.net.ssl.trustStoreType</li> * <li>javax.net.ssl.trustStoreType</li>
@ -148,10 +149,11 @@
* <li>http.maxConnections</li> * <li>http.maxConnections</li>
* <li>http.agent</li> * <li>http.agent</li>
* </ul> * </ul>
* <p/> * <p>
* Please note that some settings used by this class can be mutually * Please note that some settings used by this class can be mutually
* exclusive and may not apply when building {@link CloseableHttpClient} * exclusive and may not apply when building {@link CloseableHttpClient}
* instances. * instances.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */
@ -229,10 +231,11 @@ public final HttpClientBuilder setRequestExecutor(final HttpRequestExecutor requ
/** /**
* Assigns {@link X509HostnameVerifier} instance. * Assigns {@link X509HostnameVerifier} instance.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setConnectionManager( * Please note this value can be overridden by the {@link #setConnectionManager(
* org.apache.http.conn.HttpClientConnectionManager)} and the {@link #setSSLSocketFactory( * org.apache.http.conn.HttpClientConnectionManager)} and the {@link #setSSLSocketFactory(
* org.apache.http.conn.socket.LayeredConnectionSocketFactory)} methods. * org.apache.http.conn.socket.LayeredConnectionSocketFactory)} methods.
* </p>
* *
* @deprecated (4.4) * @deprecated (4.4)
*/ */
@ -244,10 +247,11 @@ public final HttpClientBuilder setHostnameVerifier(final X509HostnameVerifier ho
/** /**
* Assigns {@link javax.net.ssl.HostnameVerifier} instance. * Assigns {@link javax.net.ssl.HostnameVerifier} instance.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setConnectionManager( * Please note this value can be overridden by the {@link #setConnectionManager(
* org.apache.http.conn.HttpClientConnectionManager)} and the {@link #setSSLSocketFactory( * org.apache.http.conn.HttpClientConnectionManager)} and the {@link #setSSLSocketFactory(
* org.apache.http.conn.socket.LayeredConnectionSocketFactory)} methods. * org.apache.http.conn.socket.LayeredConnectionSocketFactory)} methods.
* </p>
* *
* @since 4.4 * @since 4.4
*/ */
@ -258,11 +262,11 @@ public final HttpClientBuilder setSSLHostnameVerifier(final HostnameVerifier hos
/** /**
* Assigns {@link SSLContext} instance. * Assigns {@link SSLContext} instance.
* <p/> * <p>
* <p/>
* Please note this value can be overridden by the {@link #setConnectionManager( * Please note this value can be overridden by the {@link #setConnectionManager(
* org.apache.http.conn.HttpClientConnectionManager)} and the {@link #setSSLSocketFactory( * org.apache.http.conn.HttpClientConnectionManager)} and the {@link #setSSLSocketFactory(
* org.apache.http.conn.socket.LayeredConnectionSocketFactory)} methods. * org.apache.http.conn.socket.LayeredConnectionSocketFactory)} methods.
* </p>
*/ */
public final HttpClientBuilder setSslcontext(final SSLContext sslcontext) { public final HttpClientBuilder setSslcontext(final SSLContext sslcontext) {
this.sslcontext = sslcontext; this.sslcontext = sslcontext;
@ -271,9 +275,10 @@ public final HttpClientBuilder setSslcontext(final SSLContext sslcontext) {
/** /**
* Assigns {@link LayeredConnectionSocketFactory} instance. * Assigns {@link LayeredConnectionSocketFactory} instance.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setConnectionManager( * Please note this value can be overridden by the {@link #setConnectionManager(
* org.apache.http.conn.HttpClientConnectionManager)} method. * org.apache.http.conn.HttpClientConnectionManager)} method.
* </p>
*/ */
public final HttpClientBuilder setSSLSocketFactory( public final HttpClientBuilder setSSLSocketFactory(
final LayeredConnectionSocketFactory sslSocketFactory) { final LayeredConnectionSocketFactory sslSocketFactory) {
@ -283,9 +288,10 @@ public final HttpClientBuilder setSSLSocketFactory(
/** /**
* Assigns maximum total connection value. * Assigns maximum total connection value.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setConnectionManager( * Please note this value can be overridden by the {@link #setConnectionManager(
* org.apache.http.conn.HttpClientConnectionManager)} method. * org.apache.http.conn.HttpClientConnectionManager)} method.
* </p>
*/ */
public final HttpClientBuilder setMaxConnTotal(final int maxConnTotal) { public final HttpClientBuilder setMaxConnTotal(final int maxConnTotal) {
this.maxConnTotal = maxConnTotal; this.maxConnTotal = maxConnTotal;
@ -294,9 +300,10 @@ public final HttpClientBuilder setMaxConnTotal(final int maxConnTotal) {
/** /**
* Assigns maximum connection per route value. * Assigns maximum connection per route value.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setConnectionManager( * Please note this value can be overridden by the {@link #setConnectionManager(
* org.apache.http.conn.HttpClientConnectionManager)} method. * org.apache.http.conn.HttpClientConnectionManager)} method.
* </p>
*/ */
public final HttpClientBuilder setMaxConnPerRoute(final int maxConnPerRoute) { public final HttpClientBuilder setMaxConnPerRoute(final int maxConnPerRoute) {
this.maxConnPerRoute = maxConnPerRoute; this.maxConnPerRoute = maxConnPerRoute;
@ -305,9 +312,10 @@ public final HttpClientBuilder setMaxConnPerRoute(final int maxConnPerRoute) {
/** /**
* Assigns default {@link SocketConfig}. * Assigns default {@link SocketConfig}.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setConnectionManager( * Please note this value can be overridden by the {@link #setConnectionManager(
* org.apache.http.conn.HttpClientConnectionManager)} method. * org.apache.http.conn.HttpClientConnectionManager)} method.
* </p>
*/ */
public final HttpClientBuilder setDefaultSocketConfig(final SocketConfig config) { public final HttpClientBuilder setDefaultSocketConfig(final SocketConfig config) {
this.defaultSocketConfig = config; this.defaultSocketConfig = config;
@ -316,9 +324,10 @@ public final HttpClientBuilder setDefaultSocketConfig(final SocketConfig config)
/** /**
* Assigns default {@link ConnectionConfig}. * Assigns default {@link ConnectionConfig}.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setConnectionManager( * Please note this value can be overridden by the {@link #setConnectionManager(
* org.apache.http.conn.HttpClientConnectionManager)} method. * org.apache.http.conn.HttpClientConnectionManager)} method.
* </p>
*/ */
public final HttpClientBuilder setDefaultConnectionConfig(final ConnectionConfig config) { public final HttpClientBuilder setDefaultConnectionConfig(final ConnectionConfig config) {
this.defaultConnectionConfig = config; this.defaultConnectionConfig = config;
@ -327,9 +336,10 @@ public final HttpClientBuilder setDefaultConnectionConfig(final ConnectionConfig
/** /**
* Sets maximum time to live for persistent connections * Sets maximum time to live for persistent connections
* <p/> * <p>
* Please note this value can be overridden by the {@link #setConnectionManager( * Please note this value can be overridden by the {@link #setConnectionManager(
* org.apache.http.conn.HttpClientConnectionManager)} method. * org.apache.http.conn.HttpClientConnectionManager)} method.
* </p>
* *
* @since 4.4 * @since 4.4
*/ */
@ -351,10 +361,11 @@ public final HttpClientBuilder setConnectionManager(
/** /**
* Defines the connection manager is to be shared by multiple * Defines the connection manager is to be shared by multiple
* client instances. * client instances.
* <p/> * <p>
* If the connection manager is shared its life-cycle is expected * If the connection manager is shared its life-cycle is expected
* to be managed by the caller and it will not be shut down * to be managed by the caller and it will not be shut down
* if the client is closed. * if the client is closed.
* </p>
* *
* @param shared defines whether or not the connection manager can be shared * @param shared defines whether or not the connection manager can be shared
* by multiple clients. * by multiple clients.
@ -407,9 +418,10 @@ public final HttpClientBuilder setProxyAuthenticationStrategy(
/** /**
* Assigns {@link UserTokenHandler} instance. * Assigns {@link UserTokenHandler} instance.
* <p/> * <p>
* Please note this value can be overridden by the {@link #disableConnectionState()} * Please note this value can be overridden by the {@link #disableConnectionState()}
* method. * method.
* </p>
*/ */
public final HttpClientBuilder setUserTokenHandler(final UserTokenHandler userTokenHandler) { public final HttpClientBuilder setUserTokenHandler(final UserTokenHandler userTokenHandler) {
this.userTokenHandler = userTokenHandler; this.userTokenHandler = userTokenHandler;
@ -435,9 +447,10 @@ public final HttpClientBuilder setSchemePortResolver(
/** /**
* Assigns {@code User-Agent} value. * Assigns {@code User-Agent} value.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setHttpProcessor( * Please note this value can be overridden by the {@link #setHttpProcessor(
* org.apache.http.protocol.HttpProcessor)} method. * org.apache.http.protocol.HttpProcessor)} method.
* </p>
*/ */
public final HttpClientBuilder setUserAgent(final String userAgent) { public final HttpClientBuilder setUserAgent(final String userAgent) {
this.userAgent = userAgent; this.userAgent = userAgent;
@ -446,9 +459,10 @@ public final HttpClientBuilder setUserAgent(final String userAgent) {
/** /**
* Assigns default request header values. * Assigns default request header values.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setHttpProcessor( * Please note this value can be overridden by the {@link #setHttpProcessor(
* org.apache.http.protocol.HttpProcessor)} method. * org.apache.http.protocol.HttpProcessor)} method.
* </p>
*/ */
public final HttpClientBuilder setDefaultHeaders(final Collection<? extends Header> defaultHeaders) { public final HttpClientBuilder setDefaultHeaders(final Collection<? extends Header> defaultHeaders) {
this.defaultHeaders = defaultHeaders; this.defaultHeaders = defaultHeaders;
@ -457,9 +471,10 @@ public final HttpClientBuilder setDefaultHeaders(final Collection<? extends Head
/** /**
* Adds this protocol interceptor to the head of the protocol processing list. * Adds this protocol interceptor to the head of the protocol processing list.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setHttpProcessor( * Please note this value can be overridden by the {@link #setHttpProcessor(
* org.apache.http.protocol.HttpProcessor)} method. * org.apache.http.protocol.HttpProcessor)} method.
* </p>
*/ */
public final HttpClientBuilder addInterceptorFirst(final HttpResponseInterceptor itcp) { public final HttpClientBuilder addInterceptorFirst(final HttpResponseInterceptor itcp) {
if (itcp == null) { if (itcp == null) {
@ -474,9 +489,10 @@ public final HttpClientBuilder addInterceptorFirst(final HttpResponseInterceptor
/** /**
* Adds this protocol interceptor to the tail of the protocol processing list. * Adds this protocol interceptor to the tail of the protocol processing list.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setHttpProcessor( * Please note this value can be overridden by the {@link #setHttpProcessor(
* org.apache.http.protocol.HttpProcessor)} method. * org.apache.http.protocol.HttpProcessor)} method.
* </p>
*/ */
public final HttpClientBuilder addInterceptorLast(final HttpResponseInterceptor itcp) { public final HttpClientBuilder addInterceptorLast(final HttpResponseInterceptor itcp) {
if (itcp == null) { if (itcp == null) {
@ -491,7 +507,7 @@ public final HttpClientBuilder addInterceptorLast(final HttpResponseInterceptor
/** /**
* Adds this protocol interceptor to the head of the protocol processing list. * Adds this protocol interceptor to the head of the protocol processing list.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setHttpProcessor( * Please note this value can be overridden by the {@link #setHttpProcessor(
* org.apache.http.protocol.HttpProcessor)} method. * org.apache.http.protocol.HttpProcessor)} method.
*/ */
@ -508,7 +524,7 @@ public final HttpClientBuilder addInterceptorFirst(final HttpRequestInterceptor
/** /**
* Adds this protocol interceptor to the tail of the protocol processing list. * Adds this protocol interceptor to the tail of the protocol processing list.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setHttpProcessor( * Please note this value can be overridden by the {@link #setHttpProcessor(
* org.apache.http.protocol.HttpProcessor)} method. * org.apache.http.protocol.HttpProcessor)} method.
*/ */
@ -525,7 +541,7 @@ public final HttpClientBuilder addInterceptorLast(final HttpRequestInterceptor i
/** /**
* Disables state (cookie) management. * Disables state (cookie) management.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setHttpProcessor( * Please note this value can be overridden by the {@link #setHttpProcessor(
* org.apache.http.protocol.HttpProcessor)} method. * org.apache.http.protocol.HttpProcessor)} method.
*/ */
@ -536,7 +552,7 @@ public final HttpClientBuilder disableCookieManagement() {
/** /**
* Disables automatic content decompression. * Disables automatic content decompression.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setHttpProcessor( * Please note this value can be overridden by the {@link #setHttpProcessor(
* org.apache.http.protocol.HttpProcessor)} method. * org.apache.http.protocol.HttpProcessor)} method.
*/ */
@ -547,7 +563,7 @@ public final HttpClientBuilder disableContentCompression() {
/** /**
* Disables authentication scheme caching. * Disables authentication scheme caching.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setHttpProcessor( * Please note this value can be overridden by the {@link #setHttpProcessor(
* org.apache.http.protocol.HttpProcessor)} method. * org.apache.http.protocol.HttpProcessor)} method.
*/ */
@ -566,7 +582,7 @@ public final HttpClientBuilder setHttpProcessor(final HttpProcessor httpprocesso
/** /**
* Assigns {@link HttpRequestRetryHandler} instance. * Assigns {@link HttpRequestRetryHandler} instance.
* <p/> * <p>
* Please note this value can be overridden by the {@link #disableAutomaticRetries()} * Please note this value can be overridden by the {@link #disableAutomaticRetries()}
* method. * method.
*/ */
@ -585,7 +601,7 @@ public final HttpClientBuilder disableAutomaticRetries() {
/** /**
* Assigns default proxy value. * Assigns default proxy value.
* <p/> * <p>
* Please note this value can be overridden by the {@link #setRoutePlanner( * Please note this value can be overridden by the {@link #setRoutePlanner(
* org.apache.http.conn.routing.HttpRoutePlanner)} method. * org.apache.http.conn.routing.HttpRoutePlanner)} method.
*/ */
@ -604,9 +620,10 @@ public final HttpClientBuilder setRoutePlanner(final HttpRoutePlanner routePlann
/** /**
* Assigns {@link RedirectStrategy} instance. * Assigns {@link RedirectStrategy} instance.
* <p/> * <p>
* Please note this value can be overridden by the {@link #disableRedirectHandling()} * Please note this value can be overridden by the {@link #disableRedirectHandling()}
* method. * method.
* </p>
` */ ` */
public final HttpClientBuilder setRedirectStrategy(final RedirectStrategy redirectStrategy) { public final HttpClientBuilder setRedirectStrategy(final RedirectStrategy redirectStrategy) {
this.redirectStrategy = redirectStrategy; this.redirectStrategy = redirectStrategy;
@ -723,8 +740,10 @@ public final HttpClientBuilder useSystemProperties() {
* Produces an instance of {@link ClientExecChain} to be used as a main exec. * Produces an instance of {@link ClientExecChain} to be used as a main exec.
* <p> * <p>
* Default implementation produces an instance of {@link MainClientExec} * Default implementation produces an instance of {@link MainClientExec}
* </p>
* <p> * <p>
* For internal use. * For internal use.
* </p>
* *
* @since 4.4 * @since 4.4
*/ */

View File

@ -38,9 +38,10 @@
* {@link org.apache.http.client.HttpRequestRetryHandler} which assumes * {@link org.apache.http.client.HttpRequestRetryHandler} which assumes
* that all requested HTTP methods which should be idempotent according * that all requested HTTP methods which should be idempotent according
* to RFC-2616 are in fact idempotent and can be retried. * to RFC-2616 are in fact idempotent and can be retried.
* <p/> * <p>
* According to RFC-2616 section 9.1.2 the idempotent HTTP methods are: * According to RFC-2616 section 9.1.2 the idempotent HTTP methods are:
* GET, HEAD, PUT, DELETE, OPTIONS, and TRACE * GET, HEAD, PUT, DELETE, OPTIONS, and TRACE
* </p>
* *
* @since 4.2 * @since 4.2
*/ */

View File

@ -27,8 +27,9 @@
/** /**
* Default HTTP client implementation. * Default HTTP client implementation.
* <p/> * <p>
* The usual execution flow can be demonstrated by the code snippet below: * The usual execution flow can be demonstrated by the code snippet below:
* </p>
* <pre> * <pre>
* CloseableHttpClient httpclient = HttpClients.createDefault(); * CloseableHttpClient httpclient = HttpClients.createDefault();
* try { * try {

View File

@ -65,15 +65,17 @@
* A connection manager for a single connection. This connection manager maintains only one active * A connection manager for a single connection. This connection manager maintains only one active
* connection. Even though this class is fully thread-safe it ought to be used by one execution * connection. Even though this class is fully thread-safe it ought to be used by one execution
* thread only, as only one thread a time can lease the connection at a time. * thread only, as only one thread a time can lease the connection at a time.
* <p/> * <p>
* This connection manager will make an effort to reuse the connection for subsequent requests * This connection manager will make an effort to reuse the connection for subsequent requests
* with the same {@link HttpRoute route}. It will, however, close the existing connection and * with the same {@link HttpRoute route}. It will, however, close the existing connection and
* open it for the given route, if the route of the persistent connection does not match that * open it for the given route, if the route of the persistent connection does not match that
* of the connection request. If the connection has been already been allocated * of the connection request. If the connection has been already been allocated
* {@link IllegalStateException} is thrown. * {@link IllegalStateException} is thrown.
* <p/> * </p>
* <p>
* This connection manager implementation should be used inside an EJB container instead of * This connection manager implementation should be used inside an EJB container instead of
* {@link PoolingHttpClientConnectionManager}. * {@link PoolingHttpClientConnectionManager}.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */

View File

@ -74,7 +74,7 @@
* basis. A request for a route which already the manager has persistent * basis. A request for a route which already the manager has persistent
* connections for available in the pool will be services by leasing * connections for available in the pool will be services by leasing
* a connection from the pool rather than creating a brand new connection. * a connection from the pool rather than creating a brand new connection.
* <p/> * <p>
* {@code ClientConnectionPoolManager} maintains a maximum limit of connection * {@code ClientConnectionPoolManager} maintains a maximum limit of connection
* on a per route basis and in total. Per default this implementation will * on a per route basis and in total. Per default this implementation will
* create no more than than 2 concurrent connections per given route * create no more than than 2 concurrent connections per given route
@ -82,13 +82,15 @@
* these limits may prove too constraining, especially if they use HTTP * these limits may prove too constraining, especially if they use HTTP
* as a transport protocol for their services. Connection limits, however, * as a transport protocol for their services. Connection limits, however,
* can be adjusted using {@link ConnPoolControl} methods. * can be adjusted using {@link ConnPoolControl} methods.
* * </p>
* <p>
* The handling of stale connections was changed in version 4.4. * The handling of stale connections was changed in version 4.4.
* Previously, the code would check every connection by default before re-using it. * Previously, the code would check every connection by default before re-using it.
* The code now only checks the connection if the elapsed time since * The code now only checks the connection if the elapsed time since
* the last use of the connection exceeds the timeout that has been set. * the last use of the connection exceeds the timeout that has been set.
* The default timeout is set to 5000ms - see * The default timeout is set to 5000ms - see
* {@link #PoolingHttpClientConnectionManager(HttpClientConnectionOperator, HttpConnectionFactory, long, TimeUnit))} * {@link #PoolingHttpClientConnectionManager(HttpClientConnectionOperator, HttpConnectionFactory, long, TimeUnit))}
* </p>
* *
* @since 4.3 * @since 4.3
*/ */

View File

@ -40,11 +40,12 @@
* This interface represents an element in the HTTP request execution chain. Each element can * This interface represents an element in the HTTP request execution chain. Each element can
* either be a decorator around another element that implements a cross cutting aspect or * either be a decorator around another element that implements a cross cutting aspect or
* a self-contained executor capable of producing a response for the given request. * a self-contained executor capable of producing a response for the given request.
* <p/> * <p>
* Important: please note it is required for decorators that implement post execution aspects * Important: please note it is required for decorators that implement post execution aspects
* or response post-processing of any sort to release resources associated with the response * or response post-processing of any sort to release resources associated with the response
* by calling {@link CloseableHttpResponse#close()} methods in case of an I/O, protocol or * by calling {@link CloseableHttpResponse#close()} methods in case of an I/O, protocol or
* runtime exception, or in case the response is not propagated to the caller. * runtime exception, or in case the response is not propagated to the caller.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */

View File

@ -61,10 +61,11 @@
* Internally this executor relies on a {@link HttpProcessor} to populate * Internally this executor relies on a {@link HttpProcessor} to populate
* requisite HTTP request headers, process HTTP response headers and update * requisite HTTP request headers, process HTTP response headers and update
* session state in {@link HttpClientContext}. * session state in {@link HttpClientContext}.
* <p/> * <p>
* Further responsibilities such as communication with the opposite * Further responsibilities such as communication with the opposite
* endpoint is delegated to the next executor in the request execution * endpoint is delegated to the next executor in the request execution
* chain. * chain.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */

View File

@ -47,10 +47,11 @@
* Request executor in the request execution chain that is responsible * Request executor in the request execution chain that is responsible
* for making a decision whether a request that received a non-2xx response * for making a decision whether a request that received a non-2xx response
* from the target server should be re-executed. * from the target server should be re-executed.
* <p/> * <p>
* Further responsibilities such as communication with the opposite * Further responsibilities such as communication with the opposite
* endpoint is delegated to the next executor in the request execution * endpoint is delegated to the next executor in the request execution
* chain. * chain.
* </p>
* *
* @since 4.3 * @since 4.3
*/ */

View File

@ -29,13 +29,14 @@
/** /**
* Some X509 certificates to test against. * Some X509 certificates to test against.
* <p/> * <p>
* Note: some of these certificates have Japanese Kanji in the "subjectAlt" * Note: some of these certificates have Japanese Kanji in the "subjectAlt"
* field (UTF8). Not sure how realistic that is since international characters * field (UTF8). Not sure how realistic that is since international characters
* in DNS names usually get translated into ASCII using "xn--" style DNS * in DNS names usually get translated into ASCII using "xn--" style DNS
* entries. "xn--i8s592g.co.jp" is what FireFox actually uses when trying to * entries. "xn--i8s592g.co.jp" is what FireFox actually uses when trying to
* find &#x82b1;&#x5b50;.co.jp. So would the CN in the certificate contain * find &#x82b1;&#x5b50;.co.jp. So would the CN in the certificate contain
* "xn--i8s592g.co.jp" in ASCII, or "&#x82b1;&#x5b50;.co.jp" in UTF8? (Both?) * "xn--i8s592g.co.jp" in ASCII, or "&#x82b1;&#x5b50;.co.jp" in UTF8? (Both?)
* </p>
* *
* @since 11-Dec-2006 * @since 11-Dec-2006
*/ */