diff --git a/httpclient/src/main/java/org/apache/http/client/AuthenticationHandler.java b/httpclient/src/main/java/org/apache/http/client/AuthenticationHandler.java index 5dc4f6a74..911e1a461 100644 --- a/httpclient/src/main/java/org/apache/http/client/AuthenticationHandler.java +++ b/httpclient/src/main/java/org/apache/http/client/AuthenticationHandler.java @@ -41,19 +41,59 @@ import org.apache.http.auth.MalformedChallengeException; import org.apache.http.protocol.HttpContext; /** +/** + * A handler for determining if an HTTP response represents an authentication + * challenge that was sent back to the client as a result of authentication + * failure. + *
+ * Implementations of this interface must be thread-safe. Access to shared
+ * data must be synchronized as methods of this interface may be executed
+ * from multiple threads.
*
* @since 4.0
*/
public interface AuthenticationHandler {
+ /**
+ * Determines if the given HTTP response response represents
+ * an authentication challenge that was sent back as a result
+ * of authentication failure
+ * @param response HTTP response.
+ * @param context HTTP context.
+ * @return
+ * Implementations of this interface must be thread-safe. Access to shared
+ * data must be synchronized as methods of this interface may be executed
+ * from multiple threads.
*
* @since 4.0
*/
diff --git a/httpclient/src/main/java/org/apache/http/client/HttpClient.java b/httpclient/src/main/java/org/apache/http/client/HttpClient.java
index e00c16f3d..00674e716 100644
--- a/httpclient/src/main/java/org/apache/http/client/HttpClient.java
+++ b/httpclient/src/main/java/org/apache/http/client/HttpClient.java
@@ -42,15 +42,14 @@ import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HttpContext;
/**
- * Interface for an HTTP client.
- * HTTP clients act as a facade to a number of objects required to
- * execute HTTP requests while handling cookies, authentication,
- * connection management, and other features.
- * Thread safety of HTTP clients depends on the implementation
- * and configuration of the specific client.
+ * This interface represents only the most basic contract for HTTP request
+ * execution. It imposes no restrictions or particular details on the request
+ * execution process and leaves the specifics of state management,
+ * authentication and redirect handling up to individual implementations.
+ * This should make it easier to decorate the interface with additional
+ * functionality such as response content caching.
*
- * Classes implementing this interface must synchronize access to shared
- * data as methods of this interfrace may be executed from multiple threads
- *
- * Classes implementing this interface must synchronize access to shared
- * data as methods of this interfrace may be executed from multiple threads
- *
- * This parameters expects a value of type {@link org.apache.http.conn.ClientConnectionManagerFactory}.
- *
* This parameter expects a value of type {@link org.apache.http.HttpHost}.
* true
if user authentication is required,
+ * false
otherwise.
+ */
boolean isAuthenticationRequested(
HttpResponse response,
HttpContext context);
-
+
+ /**
+ * Extracts from the given HTTP response a collection of authentication
+ * challenges, each of which represents an authentication scheme supported
+ * by the authentication host.
+ *
+ * @param response HTTP response.
+ * @param context HTTP context.
+ * @return a collection of challenges keyed by names of corresponding
+ * authentication schemes.
+ * @throws MalformedChallengeException if one of the authentication
+ * challenges is not valid or malformed.
+ */
Map
* HttpClient httpclient = new DefaultHttpClient();
*
@@ -100,11 +99,6 @@ import org.apache.http.protocol.HttpContext;
* }
*
*
- *
- *
- *
- * @version $Revision$
- *
* @since 4.0
*/
public interface HttpClient {
@@ -118,17 +112,14 @@ public interface HttpClient {
*
* @return the default parameters
*/
- HttpParams getParams()
- ;
-
+ HttpParams getParams();
/**
* Obtains the connection manager used by this client.
*
* @return the connection manager
*/
- ClientConnectionManager getConnectionManager()
- ;
+ ClientConnectionManager getConnectionManager();
/**
* Executes a request using the default context.
@@ -144,9 +135,7 @@ public interface HttpClient {
* @throws ClientProtocolException in case of an http protocol error
*/
HttpResponse execute(HttpUriRequest request)
- throws IOException, ClientProtocolException
- ;
-
+ throws IOException, ClientProtocolException;
/**
* Executes a request using the given context.
@@ -165,9 +154,7 @@ public interface HttpClient {
* @throws ClientProtocolException in case of an http protocol error
*/
HttpResponse execute(HttpUriRequest request, HttpContext context)
- throws IOException, ClientProtocolException
- ;
-
+ throws IOException, ClientProtocolException;
/**
* Executes a request to the target using the default context.
@@ -187,8 +174,7 @@ public interface HttpClient {
* @throws ClientProtocolException in case of an http protocol error
*/
HttpResponse execute(HttpHost target, HttpRequest request)
- throws IOException, ClientProtocolException
- ;
+ throws IOException, ClientProtocolException;
/**
* Executes a request to the target using the given context.
@@ -211,8 +197,7 @@ public interface HttpClient {
*/
HttpResponse execute(HttpHost target, HttpRequest request,
HttpContext context)
- throws IOException, ClientProtocolException
- ;
+ throws IOException, ClientProtocolException;
/**
* Executes a request using the default context and processes the
@@ -228,8 +213,7 @@ public interface HttpClient {
Note:
- * It is most likely that implementations of this interface will
- * allocate connections, and return responses that depend on those
- * connections for reading the response entity. Such connections
- * MUST be released, but that is out of the scope of a request director.
- *
- *
- *
- *
- * @version $Revision$
- *
* @since 4.0
*/
public interface RequestDirector {
@@ -83,9 +72,7 @@ public interface RequestDirector {
* @throws IOException in case of an IO problem
* or if the connection was aborted
*/
- HttpResponse execute(HttpHost target, HttpRequest request,
- HttpContext context)
- throws HttpException, IOException
- ;
+ HttpResponse execute(HttpHost target, HttpRequest request, HttpContext context)
+ throws HttpException, IOException;
-} // class ClientRequestDirector
+}
diff --git a/httpclient/src/main/java/org/apache/http/client/entity/package.html b/httpclient/src/main/java/org/apache/http/client/entity/package.html
new file mode 100644
index 000000000..e2e64dadf
--- /dev/null
+++ b/httpclient/src/main/java/org/apache/http/client/entity/package.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+Additional HTTP entity implementations that depend on HttpClient
+specific features.
+
+
diff --git a/httpclient/src/main/java/org/apache/http/client/methods/HttpEntityEnclosingRequestBase.java b/httpclient/src/main/java/org/apache/http/client/methods/HttpEntityEnclosingRequestBase.java
index 46826ebc9..dbd55f295 100644
--- a/httpclient/src/main/java/org/apache/http/client/methods/HttpEntityEnclosingRequestBase.java
+++ b/httpclient/src/main/java/org/apache/http/client/methods/HttpEntityEnclosingRequestBase.java
@@ -38,10 +38,8 @@ import org.apache.http.client.utils.CloneUtils;
import org.apache.http.protocol.HTTP;
/**
- * Basic implementation of an HTTP request that can be modified.
- *
- *
- * @version $Revision$
+ * Basic implementation of an entity enclosing HTTP request
+ * that can be modified
*
* @since 4.0
*/
diff --git a/httpclient/src/main/java/org/apache/http/client/package.html b/httpclient/src/main/java/org/apache/http/client/package.html
index 4573a1080..fa7e02e4f 100644
--- a/httpclient/src/main/java/org/apache/http/client/package.html
+++ b/httpclient/src/main/java/org/apache/http/client/package.html
@@ -34,8 +34,7 @@
-->
-The API for client-side HTTP communication and
-entry point to the HttpClient module.
+The API for client-side HTTP communication.
The usual execution flow can be demonstrated by the
code snippet below:
diff --git a/httpclient/src/main/java/org/apache/http/client/params/AuthPolicy.java b/httpclient/src/main/java/org/apache/http/client/params/AuthPolicy.java
index 7dbfff9cf..b562d0fd4 100644
--- a/httpclient/src/main/java/org/apache/http/client/params/AuthPolicy.java
+++ b/httpclient/src/main/java/org/apache/http/client/params/AuthPolicy.java
@@ -34,6 +34,7 @@ package org.apache.http.client.params;
import net.jcip.annotations.Immutable;
/**
+ * Standard authentication schemes supported by HttpClient.
*
* @since 4.0
*/
diff --git a/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java b/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java
index 33c307b82..36ecb35df 100644
--- a/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java
+++ b/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java
@@ -30,13 +30,8 @@
package org.apache.http.client.params;
-
/**
- * Parameter names for the HttpClient module.
- * This does not include parameters for informational units
- * HttpAuth, HttpCookie, or HttpConn.
- *
- * @version $Revision$
+ * Parameter names for HTTP client parameters.
*
* @since 4.0
*/
@@ -51,11 +46,9 @@ public interface ClientPNames {
public static final String CONNECTION_MANAGER_FACTORY_CLASS_NAME = "http.connection-manager.factory-class-name";
/**
- * Defines the factory to create a default {@link org.apache.http.conn.ClientConnectionManager}.
- * Host
+ * request header instead of the physical host name.
*