hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1176369 - in /httpcomponents/httpclient/trunk/httpclient/src: main/java/org/apache/http/auth/ main/java/org/apache/http/client/protocol/ main/java/org/apache/http/impl/client/ test/java/org/apache/http/client/protocol/
Date Tue, 27 Sep 2011 13:05:47 GMT
Author: olegk
Date: Tue Sep 27 13:05:46 2011
New Revision: 1176369

URL: http://svn.apache.org/viewvc?rev=1176369&view=rev
Log:
Renamed AuthChallengeState to AuthProtocolState

Added:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthProtocolState.java
      - copied, changed from r1176267, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthChallengeState.java
Removed:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthChallengeState.java
Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthState.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestProxyAuthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestTargetAuthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseAuthCache.java

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthProtocolState.java
(from r1176267, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthChallengeState.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthProtocolState.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthProtocolState.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthChallengeState.java&r1=1176267&r2=1176369&rev=1176369&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthChallengeState.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthProtocolState.java
Tue Sep 27 13:05:46 2011
@@ -26,7 +26,7 @@
 
 package org.apache.http.auth;
 
-public enum AuthChallengeState {
+public enum AuthProtocolState {
 
     UNCHALLENGED, CHALLENGED, FAILURE, SUCCESS
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthState.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthState.java?rev=1176369&r1=1176368&r2=1176369&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthState.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthState.java
Tue Sep 27 13:05:46 2011
@@ -37,8 +37,8 @@ import org.apache.http.annotation.NotThr
 @NotThreadSafe
 public class AuthState {
 
-    /** Actual state of authentication process */
-    private AuthChallengeState challengeState;
+    /** Actual state of authentication protocol */
+    private AuthProtocolState state;
 
     /** Actual authentication scheme */
     private AuthScheme authScheme;
@@ -55,14 +55,14 @@ public class AuthState {
      */
     public AuthState() {
         super();
-        this.challengeState = AuthChallengeState.UNCHALLENGED;
+        this.state = AuthProtocolState.UNCHALLENGED;
     }
 
     /**
      * Invalidates the authentication state by resetting its parameters.
      */
     public void invalidate() {
-        this.challengeState = AuthChallengeState.UNCHALLENGED;
+        this.state = AuthProtocolState.UNCHALLENGED;
         this.authScheme = null;
         this.authScope = null;
         this.credentials = null;
@@ -98,15 +98,15 @@ public class AuthState {
     /**
      * @since 4.2
      */
-    public AuthChallengeState getChallengeState() {
-        return this.challengeState;
+    public AuthProtocolState getState() {
+        return this.state;
     }
 
     /**
      * @since 4.2
      */
-    public void setChallengeState(final AuthChallengeState state) {
-        this.challengeState = state != null ? state : AuthChallengeState.UNCHALLENGED;
+    public void setState(final AuthProtocolState state) {
+        this.state = state != null ? state : AuthProtocolState.UNCHALLENGED;
     }
 
     /**
@@ -154,7 +154,7 @@ public class AuthState {
     @Override
     public String toString() {
         StringBuilder buffer = new StringBuilder();
-        buffer.append("state:").append(this.challengeState).append(";");
+        buffer.append("state:").append(this.state).append(";");
         if (this.authScheme != null) {
             buffer.append("auth scheme:").append(this.authScheme.getSchemeName()).append(";");
         }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java?rev=1176369&r1=1176368&r2=1176369&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java
Tue Sep 27 13:05:46 2011
@@ -88,7 +88,7 @@ public class ResponseAuthCache implement
                     authCache = new BasicAuthCache();
                     context.setAttribute(ClientContext.AUTH_CACHE, authCache);
                 }
-                switch (targetState.getChallengeState()) {
+                switch (targetState.getState()) {
                 case CHALLENGED:
                     cache(authCache, target, targetState.getAuthScheme());
                     break;
@@ -106,7 +106,7 @@ public class ResponseAuthCache implement
                     authCache = new BasicAuthCache();
                     context.setAttribute(ClientContext.AUTH_CACHE, authCache);
                 }
-                switch (proxyState.getChallengeState()) {
+                switch (proxyState.getState()) {
                 case CHALLENGED:
                     cache(authCache, proxy, proxyState.getAuthScheme());
                     break;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java?rev=1176369&r1=1176368&r2=1176369&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Tue Sep 27 13:05:46 2011
@@ -45,7 +45,7 @@ import org.apache.http.HttpResponse;
 import org.apache.http.ProtocolException;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.annotation.NotThreadSafe;
-import org.apache.http.auth.AuthChallengeState;
+import org.apache.http.auth.AuthProtocolState;
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthState;
 import org.apache.http.client.AuthenticationHandler;
@@ -1069,8 +1069,8 @@ public class DefaultRequestDirector impl
                     uri.getScheme());
 
             // Unset auth scope
-            targetAuthState.setChallengeState(AuthChallengeState.UNCHALLENGED);
-            proxyAuthState.setChallengeState(AuthChallengeState.UNCHALLENGED);
+            targetAuthState.setState(AuthProtocolState.UNCHALLENGED);
+            proxyAuthState.setState(AuthProtocolState.UNCHALLENGED);
 
             // Invalidate auth states if redirecting to another host
             if (!route.getTargetHost().equals(newTarget)) {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java?rev=1176369&r1=1176368&r2=1176369&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java
Tue Sep 27 13:05:46 2011
@@ -35,7 +35,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.http.Header;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpResponse;
-import org.apache.http.auth.AuthChallengeState;
+import org.apache.http.auth.AuthProtocolState;
 import org.apache.http.auth.AuthOption;
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthState;
@@ -64,10 +64,10 @@ public class HttpAuthenticator {
         if (authStrategy.isAuthenticationRequested(response, context)) {
             return true;
         } else {
-            if (authState.getChallengeState() == AuthChallengeState.CHALLENGED) {
-                authState.setChallengeState(AuthChallengeState.SUCCESS);
+            if (authState.getState() == AuthProtocolState.CHALLENGED) {
+                authState.setState(AuthProtocolState.SUCCESS);
             } else {
-                authState.setChallengeState(AuthChallengeState.UNCHALLENGED);
+                authState.setState(AuthProtocolState.UNCHALLENGED);
             }
             return false;
         }
@@ -97,11 +97,11 @@ public class HttpAuthenticator {
                     authScheme.processChallenge(challenge);
                     if (authScheme.isComplete()) {
                         this.log.debug("Authentication failed");
-                        authState.setChallengeState(AuthChallengeState.FAILURE);
+                        authState.setState(AuthProtocolState.FAILURE);
                         authState.setCredentials(null);
                         return false;
                     } else {
-                        authState.setChallengeState(AuthChallengeState.CHALLENGED);
+                        authState.setState(AuthProtocolState.CHALLENGED);
                         return true;
                     }
                 } else {
@@ -115,7 +115,7 @@ public class HttpAuthenticator {
             }
             authState.setAuthScheme(authOption.getAuthScheme());
             authState.setCredentials(authOption.getCredentials());
-            authState.setChallengeState(AuthChallengeState.CHALLENGED);
+            authState.setState(AuthProtocolState.CHALLENGED);
             return true;
         } catch (MalformedChallengeException ex) {
             if (this.log.isWarnEnabled()) {

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestProxyAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestProxyAuthentication.java?rev=1176369&r1=1176368&r2=1176369&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestProxyAuthentication.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestProxyAuthentication.java
Tue Sep 27 13:05:46 2011
@@ -33,7 +33,7 @@ import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.auth.AUTH;
-import org.apache.http.auth.AuthChallengeState;
+import org.apache.http.auth.AuthProtocolState;
 import org.apache.http.auth.AuthState;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.UsernamePasswordCredentials;
@@ -271,7 +271,7 @@ public class TestRequestProxyAuthenticat
 
         authstate.setAuthScheme(authscheme);
         authstate.setCredentials(creds);
-        authstate.setChallengeState(AuthChallengeState.UNCHALLENGED);
+        authstate.setState(AuthProtocolState.UNCHALLENGED);
 
         context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
         context.setAttribute(ClientContext.PROXY_AUTH_STATE, authstate);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestTargetAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestTargetAuthentication.java?rev=1176369&r1=1176368&r2=1176369&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestTargetAuthentication.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestTargetAuthentication.java
Tue Sep 27 13:05:46 2011
@@ -32,7 +32,7 @@ import org.apache.http.Header;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.auth.AUTH;
-import org.apache.http.auth.AuthChallengeState;
+import org.apache.http.auth.AuthProtocolState;
 import org.apache.http.auth.AuthState;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.UsernamePasswordCredentials;
@@ -201,7 +201,7 @@ public class TestRequestTargetAuthentica
 
         authstate.setAuthScheme(authscheme);
         authstate.setCredentials(creds);
-        authstate.setChallengeState(AuthChallengeState.UNCHALLENGED);
+        authstate.setState(AuthProtocolState.UNCHALLENGED);
 
         context.setAttribute(ClientContext.TARGET_AUTH_STATE, authstate);
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseAuthCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseAuthCache.java?rev=1176369&r1=1176368&r2=1176369&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseAuthCache.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseAuthCache.java
Tue Sep 27 13:05:46 2011
@@ -33,7 +33,7 @@ import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpVersion;
 import org.apache.http.auth.AUTH;
-import org.apache.http.auth.AuthChallengeState;
+import org.apache.http.auth.AuthProtocolState;
 import org.apache.http.auth.AuthState;
 import org.apache.http.client.AuthCache;
 import org.apache.http.impl.auth.BasicScheme;
@@ -90,10 +90,10 @@ public class TestResponseAuthCache {
         this.authscheme2.processChallenge(
                 new BasicHeader(AUTH.PROXY_AUTH, "BASIC realm=auth-realm"));
 
-        this.targetState.setChallengeState(AuthChallengeState.CHALLENGED);
+        this.targetState.setState(AuthProtocolState.CHALLENGED);
         this.targetState.setAuthScheme(this.authscheme1);
 
-        this.proxyState.setChallengeState(AuthChallengeState.CHALLENGED);
+        this.proxyState.setState(AuthProtocolState.CHALLENGED);
         this.proxyState.setAuthScheme(this.authscheme2);
 
         HttpContext context = new BasicHttpContext();
@@ -147,10 +147,10 @@ public class TestResponseAuthCache {
     public void testAuthSchemeNotCompleted() throws Exception {
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
 
-        this.targetState.setChallengeState(AuthChallengeState.CHALLENGED);
+        this.targetState.setState(AuthProtocolState.CHALLENGED);
         this.targetState.setAuthScheme(this.authscheme1);
 
-        this.proxyState.setChallengeState(AuthChallengeState.CHALLENGED);
+        this.proxyState.setState(AuthProtocolState.CHALLENGED);
         this.proxyState.setAuthScheme(this.authscheme2);
 
         HttpContext context = new BasicHttpContext();
@@ -175,10 +175,10 @@ public class TestResponseAuthCache {
         this.authscheme2.processChallenge(
                 new BasicHeader(AUTH.PROXY_AUTH, "BASIC realm=auth-realm"));
 
-        this.targetState.setChallengeState(AuthChallengeState.UNCHALLENGED);
+        this.targetState.setState(AuthProtocolState.UNCHALLENGED);
         this.targetState.setAuthScheme(this.authscheme1);
 
-        this.proxyState.setChallengeState(AuthChallengeState.UNCHALLENGED);
+        this.proxyState.setState(AuthProtocolState.UNCHALLENGED);
         this.proxyState.setAuthScheme(this.authscheme2);
 
         HttpContext context = new BasicHttpContext();
@@ -205,10 +205,10 @@ public class TestResponseAuthCache {
         this.authscheme2.processChallenge(
                 new BasicHeader(AUTH.PROXY_AUTH, "BASIC realm=auth-realm"));
 
-        this.targetState.setChallengeState(AuthChallengeState.FAILURE);
+        this.targetState.setState(AuthProtocolState.FAILURE);
         this.targetState.setAuthScheme(this.authscheme1);
 
-        this.proxyState.setChallengeState(AuthChallengeState.FAILURE);
+        this.proxyState.setState(AuthProtocolState.FAILURE);
         this.proxyState.setAuthScheme(this.authscheme2);
 
         HttpContext context = new BasicHttpContext();



Mime
View raw message