hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1370947 - in /httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http: client/protocol/ conn/ impl/client/ impl/client/exec/
Date Wed, 08 Aug 2012 20:25:10 GMT
Author: olegk
Date: Wed Aug  8 20:25:10 2012
New Revision: 1370947

URL: http://svn.apache.org/viewvc?rev=1370947&view=rev
Log:
Deprecated HttpRoutedConnection interface

Modified:
    httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java
    httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/HttpRoutedConnection.java
    httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/ManagedClientConnection.java
    httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java
    httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/ProxyClient.java
    httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/exec/MainClientExec.java

Modified: httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java?rev=1370947&r1=1370946&r2=1370947&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java
(original)
+++ httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java
Wed Aug  8 20:25:10 2012
@@ -115,4 +115,12 @@ public interface ClientContext {
      */
     public static final String USER_TOKEN            = "http.user-token";
 
+    /**
+     * Attribute name of a {@link javax.net.SSLSession} object that represents
+     * the actual SSL session.
+     *
+     * @since 4.3
+     */
+    public static final String SSL_SESSION           = "http.ssl-session";
+
 }

Modified: httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/HttpRoutedConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/HttpRoutedConnection.java?rev=1370947&r1=1370946&r2=1370947&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/HttpRoutedConnection.java
(original)
+++ httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/HttpRoutedConnection.java
Wed Aug  8 20:25:10 2012
@@ -36,7 +36,10 @@ import org.apache.http.conn.routing.Http
  * Interface to access routing information of a client side connection.
  *
  * @since 4.1
+ *
+ * @deprecated (4.3) no longer used
  */
+@Deprecated
 public interface HttpRoutedConnection extends HttpInetConnection {
 
     /**

Modified: httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/ManagedClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/ManagedClientConnection.java?rev=1370947&r1=1370946&r2=1370947&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/ManagedClientConnection.java
(original)
+++ httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/conn/ManagedClientConnection.java
Wed Aug  8 20:25:10 2012
@@ -45,6 +45,7 @@ import org.apache.http.conn.routing.Http
  *
  * @since 4.0
  */
+@SuppressWarnings("deprecation")
 public interface ManagedClientConnection extends
     HttpClientConnection, HttpRoutedConnection, ConnectionReleaseTrigger {
 

Modified: httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java?rev=1370947&r1=1370946&r2=1370947&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java
(original)
+++ httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/DefaultUserTokenHandler.java
Wed Aug  8 20:25:10 2012
@@ -31,14 +31,11 @@ import java.security.Principal;
 import javax.net.ssl.SSLSession;
 
 import org.apache.http.annotation.Immutable;
-
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthState;
 import org.apache.http.auth.Credentials;
 import org.apache.http.client.UserTokenHandler;
 import org.apache.http.client.protocol.ClientContext;
-import org.apache.http.conn.HttpRoutedConnection;
-import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
 
 /**
@@ -74,13 +71,9 @@ public class DefaultUserTokenHandler imp
         }
 
         if (userPrincipal == null) {
-            HttpRoutedConnection conn = (HttpRoutedConnection) context.getAttribute(
-                    ExecutionContext.HTTP_CONNECTION);
-            if (conn.isOpen()) {
-                SSLSession sslsession = conn.getSSLSession();
-                if (sslsession != null) {
-                    userPrincipal = sslsession.getLocalPrincipal();
-                }
+            SSLSession sslsession = (SSLSession) context.getAttribute(ClientContext.SSL_SESSION);
+            if (sslsession != null) {
+                userPrincipal = sslsession.getLocalPrincipal();
             }
         }
 

Modified: httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/ProxyClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/ProxyClient.java?rev=1370947&r1=1370946&r2=1370947&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/ProxyClient.java
(original)
+++ httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/ProxyClient.java
Wed Aug  8 20:25:10 2012
@@ -49,7 +49,6 @@ import org.apache.http.client.params.Aut
 import org.apache.http.client.params.HttpClientParams;
 import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.client.protocol.RequestClientConnControl;
-import org.apache.http.conn.HttpRoutedConnection;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.entity.BufferedHttpEntity;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
@@ -214,7 +213,7 @@ public class ProxyClient {
         return conn.getSocket();
     }
 
-    static class ProxyConnection extends DefaultHttpClientConnection implements HttpRoutedConnection
{
+    static class ProxyConnection extends DefaultHttpClientConnection {
 
         private final HttpRoute route;
 

Modified: httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/exec/MainClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/exec/MainClientExec.java?rev=1370947&r1=1370946&r2=1370947&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/exec/MainClientExec.java
(original)
+++ httpcomponents/httpclient/branches/decorator-refactoring/httpclient/src/main/java/org/apache/http/impl/client/exec/MainClientExec.java
Wed Aug  8 20:25:10 2012
@@ -221,6 +221,7 @@ public class MainClientExec implements C
         }
 
         context.setAttribute(ExecutionContext.HTTP_CONNECTION, managedConn);
+        context.setAttribute(ClientContext.SSL_SESSION, managedConn.getSSLSession());
 
         if (HttpConnectionParams.isStaleCheckingEnabled(params)) {
             // validate connection



Mime
View raw message