diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java b/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java index 00fb6c23e..1ae1213fc 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java @@ -63,11 +63,35 @@ public interface ClientContext { */ public static final String COOKIE_STORE = "http.cookie-store"; + /** + * Attribute name of a {@link org.apache.http.auth.AuthSchemeRegistry} + * object that represents the actual authentication scheme registry. + */ public static final String AUTHSCHEME_REGISTRY = "http.authscheme-registry"; + + /** + * Attribute name of a {@link org.apache.http.client.CredentialsProvider} + * object that represents the actual crednetials provider. + */ public static final String CREDS_PROVIDER = "http.auth.credentials-provider"; + + /** + * Attribute name of a {@link org.apache.http.auth.AuthState} + * object that represents the actual target authentication state. + */ public static final String TARGET_AUTH_STATE = "http.auth.target-scope"; + + /** + * Attribute name of a {@link org.apache.http.auth.AuthState} + * object that represents the actual proxy authentication state. + */ public static final String PROXY_AUTH_STATE = "http.auth.proxy-scope"; + + /** + * RESERVED. DO NOT USE!!! + */ public static final String AUTH_SCHEME_PREF = "http.auth.scheme-pref"; + public static final String USER_TOKEN = "http.user-token"; } diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/ClientContextConfigurer.java b/httpclient/src/main/java/org/apache/http/client/protocol/ClientContextConfigurer.java index 67e0b7081..8e49b55f8 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/ClientContextConfigurer.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/ClientContextConfigurer.java @@ -42,6 +42,7 @@ import org.apache.http.cookie.CookieSpecRegistry; import org.apache.http.protocol.HttpContext; /** + * Configuration facade for {@link HttpContext} instances. * * @since 4.0 */ @@ -72,6 +73,10 @@ public class ClientContextConfigurer implements ClientContext { this.context.setAttribute(CREDS_PROVIDER, provider); } + /** + * @deprecated to be replaced with a special parameter in 4.1 + */ + @Deprecated public void setAuthSchemePref(final List list) { this.context.setAttribute(AUTH_SCHEME_PREF, list); } diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/RequestDefaultHeaders.java b/httpclient/src/main/java/org/apache/http/client/protocol/RequestDefaultHeaders.java index 83a501709..177148782 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/RequestDefaultHeaders.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/RequestDefaultHeaders.java @@ -45,9 +45,6 @@ import org.apache.http.protocol.HttpContext; /** * Request interceptor that adds default request headers. - * - * - * @version $Revision$ * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/RequestProxyAuthentication.java b/httpclient/src/main/java/org/apache/http/client/protocol/RequestProxyAuthentication.java index 756d856e3..1eab6b82d 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/RequestProxyAuthentication.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/RequestProxyAuthentication.java @@ -48,8 +48,8 @@ import org.apache.http.auth.Credentials; import org.apache.http.protocol.HttpContext; /** - * - * @version $Revision$ + * Generates authentication header for the proxy host, if required, + * based on the actual state of the HTTP authentication context. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/RequestTargetAuthentication.java b/httpclient/src/main/java/org/apache/http/client/protocol/RequestTargetAuthentication.java index d28e023bd..413819781 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/RequestTargetAuthentication.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/RequestTargetAuthentication.java @@ -48,8 +48,8 @@ import org.apache.http.auth.Credentials; import org.apache.http.protocol.HttpContext; /** - * - * @version $Revision$ + * Generates authentication header for the target host, if required, + * based on the actual state of the HTTP authentication context. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/package.html b/httpclient/src/main/java/org/apache/http/client/protocol/package.html index 99600ad20..3c788b2a8 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/package.html +++ b/httpclient/src/main/java/org/apache/http/client/protocol/package.html @@ -34,7 +34,7 @@ --> -Additional request and response interceptors. - +Additional request and response interceptors for HTTP state and +authentication management. diff --git a/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java b/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java index 22d2e2b25..72867fbcc 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java +++ b/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java @@ -52,10 +52,6 @@ public class URIUtils { * {@link URI#URI(String, String, String, int, String, String, String)} * or any of the other URI multi-argument URI constructors. * - * See HTTPCLIENT-730 - * for more information. - * * @param scheme * Scheme name * @param host diff --git a/httpclient/src/main/java/org/apache/http/impl/auth/AuthSchemeBase.java b/httpclient/src/main/java/org/apache/http/impl/auth/AuthSchemeBase.java index 9f3e7bdba..40255ebcb 100644 --- a/httpclient/src/main/java/org/apache/http/impl/auth/AuthSchemeBase.java +++ b/httpclient/src/main/java/org/apache/http/impl/auth/AuthSchemeBase.java @@ -125,5 +125,10 @@ public abstract class AuthSchemeBase implements AuthScheme { public boolean isProxy() { return this.proxy; } + + @Override + public String toString() { + return getSchemeName(); + } } diff --git a/httpclient/src/main/java/org/apache/http/impl/client/BasicCredentialsProvider.java b/httpclient/src/main/java/org/apache/http/impl/client/BasicCredentialsProvider.java index a562e713b..400d2c61c 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/BasicCredentialsProvider.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/BasicCredentialsProvider.java @@ -40,8 +40,7 @@ import org.apache.http.auth.Credentials; import org.apache.http.client.CredentialsProvider; /** - * Default implementation of {@link CredentialsProvider} - * + * Default implementation of {@link CredentialsProvider}. * * @since 4.0 */ @@ -59,16 +58,6 @@ public class BasicCredentialsProvider implements CredentialsProvider { this.credMap = new HashMap(); } - /** - * Sets the {@link Credentials credentials} for the given authentication - * scope. Any previous credentials for the given scope will be overwritten. - * - * @param authscope the {@link AuthScope authentication scope} - * @param credentials the authentication {@link Credentials credentials} - * for the given scope. - * - * @see #getCredentials(AuthScope) - */ public synchronized void setCredentials( final AuthScope authscope, final Credentials credentials) { @@ -110,14 +99,6 @@ public class BasicCredentialsProvider implements CredentialsProvider { return creds; } - /** - * Get the {@link Credentials credentials} for the given authentication scope. - * - * @param authscope the {@link AuthScope authentication scope} - * @return the credentials - * - * @see #setCredentials(AuthScope, Credentials) - */ public synchronized Credentials getCredentials(final AuthScope authscope) { if (authscope == null) { throw new IllegalArgumentException("Authentication scope may not be null"); @@ -130,9 +111,6 @@ public class BasicCredentialsProvider implements CredentialsProvider { return credMap.toString(); } - /** - * Clears all credentials. - */ public synchronized void clear() { this.credMap.clear(); } diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java index 298de6e86..cf484d405 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java @@ -208,4 +208,9 @@ public class BestMatchSpec implements CookieSpec { return getStrict().getVersionHeader(); } + @Override + public String toString() { + return "best-match"; + } + } \ No newline at end of file diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java index 5fcfa23b0..6ff92259e 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java @@ -193,4 +193,9 @@ public class BrowserCompatSpec extends CookieSpecBase { return DATE_PATTERNS.clone(); } + @Override + public String toString() { + return "compatibility"; + } + } diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java index ab7e292db..1c63eaf49 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java @@ -177,4 +177,9 @@ public class NetscapeDraftSpec extends CookieSpecBase { return null; } + @Override + public String toString() { + return "netscape"; + } + } diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java index f79e04f1c..9268ed24d 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java @@ -243,4 +243,9 @@ public class RFC2109Spec extends CookieSpecBase { return null; } + @Override + public String toString() { + return "rfc2109"; + } + } diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965Spec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965Spec.java index af763bba9..4f273c185 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965Spec.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC2965Spec.java @@ -248,5 +248,10 @@ public class RFC2965Spec extends RFC2109Spec { return new BufferedHeader(buffer); } + @Override + public String toString() { + return "rfc2965"; + } + }