hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1391007 - in /httpcomponents/httpcore/trunk: httpcore-ab/src/main/java/org/apache/http/benchmark/ httpcore-nio/src/main/java/org/apache/http/impl/nio/ httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/ httpcore-nio/src/main/java/org...
Date Thu, 27 Sep 2012 13:42:31 GMT
Author: olegk
Date: Thu Sep 27 13:42:29 2012
New Revision: 1391007

URL: http://svn.apache.org/viewvc?rev=1391007&view=rev
Log:
Configuration API changes: deprecated typed getters and setters in HttpParams in favor of Config utility class

Added:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/Config.java   (with props)
Modified:
    httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpServerConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseServer.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/TestBasicRequest.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestStrictContentLengthStrategy.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/pool/TestBasicConnPool.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicMessages.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java

Modified: httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java Thu Sep 27 13:42:29 2012
@@ -46,6 +46,7 @@ import org.apache.http.HttpStatus;
 import org.apache.http.entity.ContentType;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -144,8 +145,8 @@ class BenchmarkWorker implements Runnabl
                     }
                     
                     HttpParams params = request.getParams();
-                    int connTimeout = params.getIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
-                    int soTimeout = params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
+                    int connTimeout = Config.getInt(params, CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
+                    int soTimeout = Config.getInt(params, CoreConnectionPNames.SO_TIMEOUT, 0);
 
                     socket.setSoTimeout(soTimeout);
                     socket.connect(new InetSocketAddress(hostname, port), connTimeout);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java Thu Sep 27 13:42:29 2012
@@ -35,6 +35,7 @@ import org.apache.http.nio.reactor.IOSes
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -89,7 +90,7 @@ public class DefaultNHttpClientConnectio
     public DefaultNHttpClientConnection createConnection(final IOSession session) {
         DefaultNHttpClientConnection conn = createConnection(session, this.responseFactory, 
                 this.allocator, this.params);
-        int timeout = this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
+        int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
         conn.setSocketTimeout(timeout);
         return conn;
     }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java Thu Sep 27 13:42:29 2012
@@ -35,6 +35,7 @@ import org.apache.http.nio.reactor.IOSes
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -89,7 +90,7 @@ public class DefaultNHttpServerConnectio
     public DefaultNHttpServerConnection createConnection(final IOSession session) {
         DefaultNHttpServerConnection conn = createConnection(
                 session, this.requestFactory, this.allocator, this.params);
-        int timeout = this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
+        int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
         conn.setSocketTimeout(timeout);
         return conn;
     }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java Thu Sep 27 13:42:29 2012
@@ -77,6 +77,7 @@ import org.apache.http.nio.reactor.Socke
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
@@ -138,7 +139,7 @@ public class NHttpConnectionBase
         Args.notNull(session, "I/O session");
         Args.notNull(params, "HTTP params");
 
-        int buffersize = params.getIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1);
+        int buffersize = Config.getInt(params, CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1);
         if (buffersize <= 0) {
             buffersize = 4096;
         }
@@ -149,16 +150,16 @@ public class NHttpConnectionBase
 
         CharsetDecoder decoder = null;
         CharsetEncoder encoder = null;
-        Charset charset = CharsetUtils.lookup(
-                (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET));
+        Charset charset = CharsetUtils.lookup(Config.getString(params, 
+                CoreProtocolPNames.HTTP_ELEMENT_CHARSET));
         if (charset != null) {
             charset = Consts.ASCII;
             decoder = charset.newDecoder();
             encoder = charset.newEncoder();
-            CodingErrorAction malformedCharAction = (CodingErrorAction) params.getParameter(
-                    CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION);
-            CodingErrorAction unmappableCharAction = (CodingErrorAction) params.getParameter(
-                    CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION);
+            CodingErrorAction malformedCharAction = Config.getValue(params,
+                    CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION, CodingErrorAction.class);
+            CodingErrorAction unmappableCharAction = Config.getValue(params,
+                    CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION, CodingErrorAction.class);
             decoder.onMalformedInput(malformedCharAction);
             decoder.onUnmappableCharacter(unmappableCharAction);
             encoder.onMalformedInput(malformedCharAction);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java Thu Sep 27 13:42:29 2012
@@ -40,6 +40,7 @@ import org.apache.http.nio.reactor.ssl.S
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -122,7 +123,7 @@ public class SSLNHttpClientConnectionFac
         session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
         DefaultNHttpClientConnection conn = createConnection(
                 ssliosession, this.responseFactory, this.allocator, this.params);
-        int timeout = this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
+        int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
         conn.setSocketTimeout(timeout);
         return conn;
     }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.java Thu Sep 27 13:42:29 2012
@@ -40,6 +40,7 @@ import org.apache.http.nio.reactor.ssl.S
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -122,7 +123,7 @@ public class SSLNHttpServerConnectionFac
         session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
         DefaultNHttpServerConnection conn =  createConnection(
                 ssliosession, this.requestFactory, this.allocator, this.params);
-        int timeout = this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
+        int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
         conn.setSocketTimeout(timeout);
         return conn;
     }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java Thu Sep 27 13:42:29 2012
@@ -40,6 +40,7 @@ import org.apache.http.nio.pool.Abstract
 import org.apache.http.nio.pool.NIOConnFactory;
 import org.apache.http.nio.reactor.ConnectingIOReactor;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.pool.ConnPool;
 import org.apache.http.util.Args;
@@ -106,7 +107,7 @@ public class BasicNIOConnPool extends Ab
             final HttpHost route,
             final Object state,
             final FutureCallback<BasicNIOPoolEntry> callback) {
-        int connectTimeout = this.params.getIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
+        int connectTimeout = Config.getInt(params, CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
         return super.lease(route, state, connectTimeout, TimeUnit.MILLISECONDS, callback);
     }
 
@@ -114,7 +115,7 @@ public class BasicNIOConnPool extends Ab
     public Future<BasicNIOPoolEntry> lease(
             final HttpHost route,
             final Object state) {
-        int connectTimeout = this.params.getIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
+        int connectTimeout = Config.getInt(params, CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
         return super.lease(route, state, connectTimeout, TimeUnit.MILLISECONDS, null);
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java Thu Sep 27 13:42:29 2012
@@ -48,6 +48,7 @@ import org.apache.http.nio.NHttpClientEv
 import org.apache.http.nio.NHttpConnection;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
@@ -147,7 +148,7 @@ public class HttpAsyncRequestExecutor im
         context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
 
         HttpParams params = request.getParams();
-        conn.setSocketTimeout(params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0));
+        conn.setSocketTimeout(Config.getInt(params, CoreConnectionPNames.SO_TIMEOUT, 0));
 
         HttpProcessor httppocessor = handler.getHttpProcessor();
         httppocessor.process(request, context);
@@ -160,7 +161,7 @@ public class HttpAsyncRequestExecutor im
             if (((HttpEntityEnclosingRequest) request).expectContinue()) {
                 int timeout = conn.getSocketTimeout();
                 state.setTimeout(timeout);
-                timeout = request.getParams().getIntParameter(
+                timeout = Config.getInt(request.getParams(), 
                         CoreProtocolPNames.WAIT_FOR_CONTINUE, 3000);
                 conn.setSocketTimeout(timeout);
                 state.setRequestState(MessageState.ACK_EXPECTED);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java Thu Sep 27 13:42:29 2012
@@ -56,6 +56,7 @@ import org.apache.http.nio.NHttpServerEv
 import org.apache.http.nio.entity.NStringEntity;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.DefaultedHttpParams;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -404,7 +405,7 @@ public class HttpAsyncService implements
             }
             closeHandlers(state);
             state.reset();
-            conn.setSocketTimeout(this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0));
+            conn.setSocketTimeout(Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0));
         }
     }
 
@@ -609,7 +610,7 @@ public class HttpAsyncService implements
             }
             closeHandlers(state);
             state.reset();
-            conn.setSocketTimeout(this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0));
+            conn.setSocketTimeout(Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0));
         } else {
             state.setResponseState(MessageState.BODY_STREAM);
         }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java Thu Sep 27 13:42:29 2012
@@ -466,7 +466,7 @@ public class TestHttpAsyncHandlers exten
         for (int i = 0; i < 30; i++) {
             BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest(
                     "POST", createRequestUri(pattern, count));
-            request.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+            request.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
             NStringEntity entity = new NStringEntity(expectedPattern, ContentType.DEFAULT_TEXT);
             request.setEntity(entity);
             Future<HttpResponse> future = this.executor.execute(
@@ -515,15 +515,15 @@ public class TestHttpAsyncHandlers exten
 
         BasicHttpEntityEnclosingRequest request1 = new BasicHttpEntityEnclosingRequest(
                 "POST", createRequestUri("AAAAA", 10));
-        request1.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request1.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         request1.setEntity(new NStringEntity(createExpectedString("AAAAA", 10)));
         BasicHttpEntityEnclosingRequest request2 = new BasicHttpEntityEnclosingRequest(
                 "POST", createRequestUri("AAAAA", 10));
-        request2.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request2.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         request2.setEntity(new NStringEntity(createExpectedString("AAAAA", 10)));
         BasicHttpEntityEnclosingRequest request3 = new BasicHttpEntityEnclosingRequest(
                 "POST", createRequestUri("BBBBB", 10));
-        request3.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request3.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         request3.setEntity(new NStringEntity(createExpectedString("BBBBB", 10)));
 
         HttpRequest[] requests = new HttpRequest[] { request1, request2, request3 };
@@ -666,15 +666,15 @@ public class TestHttpAsyncHandlers exten
 
         BasicHttpEntityEnclosingRequest request1 = new BasicHttpEntityEnclosingRequest(
                 "POST", createRequestUri("AAAAA", 10));
-        request1.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request1.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         request1.setEntity(new NStringEntity(createExpectedString("AAAAA", 10)));
         BasicHttpEntityEnclosingRequest request2 = new BasicHttpEntityEnclosingRequest(
                 "POST", createRequestUri("AAAAA", 10));
-        request2.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request2.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         request2.setEntity(new NStringEntity(createExpectedString("AAAAA", 10)));
         BasicHttpEntityEnclosingRequest request3 = new BasicHttpEntityEnclosingRequest(
                 "POST", createRequestUri("BBBBB", 10));
-        request3.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request3.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         request3.setEntity(new NStringEntity(createExpectedString("BBBBB", 10)));
 
         HttpRequest[] requests = new HttpRequest[] { request1, request2, request3 };

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java Thu Sep 27 13:42:29 2012
@@ -36,9 +36,7 @@ import org.apache.http.impl.nio.pool.Bas
 import org.apache.http.impl.nio.pool.BasicNIOConnPool;
 import org.apache.http.nio.NHttpConnectionFactory;
 import org.apache.http.nio.protocol.HttpAsyncRequester;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.CoreConnectionPNames;
-import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.HttpCoreConfigBuilder;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.ImmutableHttpProcessor;
@@ -75,12 +73,11 @@ public abstract class HttpCoreNIOTestBas
             HttpParams params) throws Exception;
 
     public void initServer() throws Exception {
-        this.serverParams = new BasicHttpParams();
-        this.serverParams
-            .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 60000)
-            .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
-            .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
-            .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "TEST-SERVER/1.1");
+        this.serverParams = new HttpCoreConfigBuilder()
+            .setSocketTimeout(60000)
+            .setSocketBufferSize(8 * 1024)
+            .setTcpNoDelay(true)
+            .setOriginServer("TEST-SERVER/1.1").build();
         this.server = new HttpServerNio(createServerConnectionFactory(this.serverParams));
         this.server.setExceptionHandler(new SimpleIOReactorExceptionHandler());
         this.serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
@@ -92,14 +89,12 @@ public abstract class HttpCoreNIOTestBas
     }
 
     public void initClient() throws Exception {
-        this.clientParams = new BasicHttpParams();
-        this.clientParams
-            .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 60000)
-            .setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 60000)
-            .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
-            .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
-            .setParameter(CoreProtocolPNames.USER_AGENT, "TEST-CLIENT/1.1");
-
+        this.clientParams = new HttpCoreConfigBuilder()
+            .setSocketTimeout(60000)
+            .setConnectTimeout(60000)
+            .setSocketBufferSize(8 * 1024)
+            .setTcpNoDelay(true)
+            .setUserAgent("TEST-CLIENT/1.1").build();
         this.client = new HttpClientNio(createClientConnectionFactory(this.clientParams));
         this.client.setExceptionHandler(new SimpleIOReactorExceptionHandler());
         this.clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java Thu Sep 27 13:42:29 2012
@@ -67,6 +67,7 @@ import org.apache.http.io.SessionInputBu
 import org.apache.http.io.SessionOutputBuffer;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.util.Args;
@@ -109,24 +110,24 @@ public class BHttpConnectionBase impleme
     public BHttpConnectionBase(final HttpParams params) {
         super();
         Args.notNull(params, "HTTP parameters");
-        int buffersize = params.getIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1);
+        int buffersize = Config.getInt(params, CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1);
         if (buffersize <= 0) {
             buffersize = 4096;
         }
-        int maxLineLen = params.getIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, -1);
-        int minChunkLimit = params.getIntParameter(CoreConnectionPNames.MIN_CHUNK_LIMIT, -1);
+        int maxLineLen = Config.getInt(params, CoreConnectionPNames.MAX_LINE_LENGTH, -1);
+        int minChunkLimit = Config.getInt(params, CoreConnectionPNames.MIN_CHUNK_LIMIT, -1);
         CharsetDecoder decoder = null;
         CharsetEncoder encoder = null;
-        Charset charset = CharsetUtils.lookup(
-                (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET));
+        Charset charset = CharsetUtils.lookup(Config.getString(params,
+                CoreProtocolPNames.HTTP_ELEMENT_CHARSET));
         if (charset != null) {
             charset = Consts.ASCII;
             decoder = charset.newDecoder();
             encoder = charset.newEncoder();
-            CodingErrorAction malformedCharAction = (CodingErrorAction) params.getParameter(
-                    CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION);
-            CodingErrorAction unmappableCharAction = (CodingErrorAction) params.getParameter(
-                    CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION);
+            CodingErrorAction malformedCharAction = Config.getValue(params,
+                    CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION, CodingErrorAction.class);
+            CodingErrorAction unmappableCharAction = Config.getValue(params,
+                    CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION, CodingErrorAction.class);
             decoder.onMalformedInput(malformedCharAction);
             decoder.onUnmappableCharacter(unmappableCharAction);
             encoder.onMalformedInput(malformedCharAction);

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpClientConnection.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpClientConnection.java Thu Sep 27 13:42:29 2012
@@ -51,6 +51,7 @@ import org.apache.http.message.BasicLine
 import org.apache.http.message.LineFormatter;
 import org.apache.http.message.LineParser;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -111,8 +112,8 @@ public class DefaultBHttpClientConnectio
             final LineParser lineParser,
             final HttpResponseFactory responseFactory,
             final HttpParams params) {
-        int maxHeaderCount = params.getIntParameter(CoreConnectionPNames.MAX_HEADER_COUNT, -1);
-        int maxLineLen = params.getIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, -1);
+        int maxHeaderCount = Config.getInt(params, CoreConnectionPNames.MAX_HEADER_COUNT, -1);
+        int maxLineLen = Config.getInt(params, CoreConnectionPNames.MAX_LINE_LENGTH, -1);
         return new DefaultHttpResponseParser(
                 buffer, maxHeaderCount, maxLineLen, lineParser, responseFactory);
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpServerConnection.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultBHttpServerConnection.java Thu Sep 27 13:42:29 2012
@@ -53,6 +53,7 @@ import org.apache.http.message.BasicLine
 import org.apache.http.message.LineFormatter;
 import org.apache.http.message.LineParser;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -118,8 +119,8 @@ public class DefaultBHttpServerConnectio
             final LineParser lineParser,
             final HttpRequestFactory requestFactory,
             final HttpParams params) {
-        int maxHeaderCount = params.getIntParameter(CoreConnectionPNames.MAX_HEADER_COUNT, -1);
-        int maxLineLen = params.getIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, -1);
+        int maxHeaderCount = Config.getInt(params, CoreConnectionPNames.MAX_HEADER_COUNT, -1);
+        int maxLineLen = Config.getInt(params, CoreConnectionPNames.MAX_LINE_LENGTH, -1);
         return new DefaultHttpRequestParser(
                 buffer, maxHeaderCount, maxLineLen, lineParser, requestFactory);
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java Thu Sep 27 13:42:29 2012
@@ -37,6 +37,7 @@ import org.apache.http.HttpHost;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.impl.DefaultBHttpClientConnection;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.pool.ConnFactory;
 import org.apache.http.util.Args;
@@ -94,8 +95,8 @@ public class BasicConnFactory implements
         if (socket == null) {
             throw new IOException(scheme + " scheme is not supported");
         }
-        int connectTimeout = params.getIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
-        int soTimeout = params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
+        int connectTimeout = Config.getInt(params, CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
+        int soTimeout = Config.getInt(params, CoreConnectionPNames.SO_TIMEOUT, 0);
 
         socket.setSoTimeout(soTimeout);
         socket.connect(new InetSocketAddress(host.getHostName(), host.getPort()), connectTimeout);

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java Thu Sep 27 13:42:29 2012
@@ -32,7 +32,6 @@ import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.RequestLine;
 import org.apache.http.annotation.NotThreadSafe;
-import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -108,18 +107,13 @@ public class BasicHttpRequest extends Ab
     }
 
     /**
-     * Returns the request line of this request. If an HTTP protocol version
-     * was not explicitly set at the construction time, this method will obtain
-     * it from the {@link HttpParams} instance associated with the object.
+     * Returns the request line of this request.
      *
      * @see #BasicHttpRequest(String, String)
      */
     public RequestLine getRequestLine() {
         if (this.requestline == null) {
-            ProtocolVersion ver = (ProtocolVersion) getParams().getParameter
-                    (CoreProtocolPNames.PROTOCOL_VERSION);
-            this.requestline = new BasicRequestLine(this.method, this.uri, 
-                    ver != null ? ver : HttpVersion.HTTP_1_1);
+            this.requestline = new BasicRequestLine(this.method, this.uri, HttpVersion.HTTP_1_1);
         }
         return this.requestline;
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java Thu Sep 27 13:42:29 2012
@@ -36,7 +36,10 @@ import java.util.Set;
  * generic getters and setters.
  *
  * @since 4.0
+ *
+ * @deprecated (4.3) use {@link Config} methods
  */
+@Deprecated
 public abstract class AbstractHttpParams implements HttpParams, HttpParamsNames {
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java Thu Sep 27 13:42:29 2012
@@ -44,6 +44,7 @@ import org.apache.http.annotation.Thread
  *
  * @since 4.0
  */
+@SuppressWarnings("deprecation")
 @ThreadSafe
 public class BasicHttpParams extends AbstractHttpParams implements Serializable, Cloneable {
 

Added: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/Config.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/Config.java?rev=1391007&view=auto
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/Config.java (added)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/Config.java Thu Sep 27 13:42:29 2012
@@ -0,0 +1,97 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.params;
+
+/**
+ * @since 4.3
+ */
+public final class Config {
+
+    private Config() {
+    }
+
+    public static Object getValue(final HttpParams params, final String name) {
+        if (params == null) {
+            return null;
+        }
+        return params.getParameter(name);
+    }
+
+    public static <T> T getValue(final HttpParams params, final String name, final Class<T> clazz) {
+        Object param = getValue(params, name);
+        if (param == null) {
+            return null;
+        }
+        return clazz.cast(param);
+    }
+
+    public static String getString(final HttpParams params, final String name) {
+        return getValue(params, name, String.class);
+    }
+
+    public static long getLong(final HttpParams params, final String name, long def) {
+        Long param = getValue(params, name, Long.class);
+        if (param == null) {
+            return def;
+        }
+        return param.longValue();
+    }
+
+    public static int getInt(final HttpParams params, final String name, int def) {
+        Integer param = getValue(params, name, Integer.class);
+        if (param == null) {
+            return def;
+        }
+        return param.intValue();
+    }
+
+    public static double getDouble(final HttpParams params, final String name, double def) {
+        Double param = getValue(params, name, Double.class);
+        if (param == null) {
+            return def;
+        }
+        return param.doubleValue();
+    }
+
+    public static boolean getBool(final HttpParams params, final String name, boolean def) {
+        Boolean param = getValue(params, name, Boolean.class);
+        if (param == null) {
+            return def;
+        }
+        return param.booleanValue();
+    }
+
+    public static boolean isTrue(final HttpParams params, final String name) {
+        return getBool(params, name, false);
+    }
+
+    public static boolean isFalse(final HttpParams params, final String name) {
+        return !getBool(params, name, false);
+    }
+
+}

Propchange: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/Config.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/Config.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/Config.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java Thu Sep 27 13:42:29 2012
@@ -40,6 +40,7 @@ import org.apache.http.util.Args;
  *
  * @since 4.0
  */
+@SuppressWarnings("deprecation")
 public final class DefaultedHttpParams extends AbstractHttpParams {
 
     private final HttpParams local;

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpParams.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpParams.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpParams.java Thu Sep 27 13:42:29 2012
@@ -98,7 +98,10 @@ public interface HttpParams {
      * @return a {@link Long} that represents the value of the parameter.
      *
      * @see #setLongParameter(String, long)
+     *
+     * @deprecated (4.3) use {@link Config#getLong(HttpParams, String, long)}
      */
+    @Deprecated
     long getLongParameter(String name, long defaultValue);
 
     /**
@@ -106,7 +109,10 @@ public interface HttpParams {
      *
      * @param name parameter name
      * @param value parameter value
+     *
+     * @deprecated (4.3) use {@link HttpCoreConfigBuilder}
      */
+    @Deprecated
     HttpParams setLongParameter(String name, long value);
 
     /**
@@ -119,7 +125,10 @@ public interface HttpParams {
      * @return a {@link Integer} that represents the value of the parameter.
      *
      * @see #setIntParameter(String, int)
+     *
+     * @deprecated (4.3) use {@link Config#getInt(HttpParams, String, int)}
      */
+    @Deprecated
     int getIntParameter(String name, int defaultValue);
 
     /**
@@ -127,7 +136,10 @@ public interface HttpParams {
      *
      * @param name parameter name
      * @param value parameter value
+     *
+     * @deprecated (4.3) use {@link HttpCoreConfigBuilder}
      */
+    @Deprecated
     HttpParams setIntParameter(String name, int value);
 
     /**
@@ -140,7 +152,10 @@ public interface HttpParams {
      * @return a {@link Double} that represents the value of the parameter.
      *
      * @see #setDoubleParameter(String, double)
+     *
+     * @deprecated (4.3) use {@link Config#getDouble(HttpParams, String, double)}
      */
+    @Deprecated
     double getDoubleParameter(String name, double defaultValue);
 
     /**
@@ -148,7 +163,10 @@ public interface HttpParams {
      *
      * @param name parameter name
      * @param value parameter value
+     *
+     * @deprecated (4.3) use {@link HttpCoreConfigBuilder}
      */
+    @Deprecated
     HttpParams setDoubleParameter(String name, double value);
 
     /**
@@ -161,7 +179,10 @@ public interface HttpParams {
      * @return a {@link Boolean} that represents the value of the parameter.
      *
      * @see #setBooleanParameter(String, boolean)
+     *
+     * @deprecated (4.3) use {@link Config#getBool(HttpParams, String, boolean)}
      */
+    @Deprecated
     boolean getBooleanParameter(String name, boolean defaultValue);
 
     /**
@@ -169,7 +190,10 @@ public interface HttpParams {
      *
      * @param name parameter name
      * @param value parameter value
+     *
+     * @deprecated (4.3) use {@link HttpCoreConfigBuilder}
      */
+    @Deprecated
     HttpParams setBooleanParameter(String name, boolean value);
 
     /**
@@ -179,7 +203,10 @@ public interface HttpParams {
      *
      * @return <tt>true</tt> if the parameter is set to value <tt>true</tt>,
      *         <tt>false</tt> if it is not set or set to <code>false</code>
+     *
+     * @deprecated (4.3) use {@link Config#isTrue(HttpParams, String)}
      */
+    @Deprecated
     boolean isParameterTrue(String name);
 
     /**
@@ -190,7 +217,10 @@ public interface HttpParams {
      * @return <tt>true</tt> if the parameter is either not set or
      *         set to value <tt>false</tt>,
      *         <tt>false</tt> if it is set to <code>true</code>
+     *
+     * @deprecated (4.3) use {@link Config#isFalse(HttpParams, String)}
      */
+    @Deprecated
     boolean isParameterFalse(String name);
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java Thu Sep 27 13:42:29 2012
@@ -41,6 +41,7 @@ import org.apache.http.ProtocolException
 import org.apache.http.ProtocolVersion;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.Config;
 import org.apache.http.util.Args;
 
 /**
@@ -211,7 +212,7 @@ public class HttpRequestExecutor {
                 conn.flush();
                 // As suggested by RFC 2616 section 8.2.3, we don't wait for a
                 // 100-continue response forever. On timeout, send the entity.
-                int tms = request.getParams().getIntParameter(
+                int tms = Config.getInt(request.getParams(), 
                         CoreProtocolPNames.WAIT_FOR_CONTINUE, 2000);
 
                 if (conn.isResponseAvailable(tms)) {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java Thu Sep 27 13:42:29 2012
@@ -38,6 +38,7 @@ import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -70,7 +71,7 @@ public class RequestExpectContinue imple
             if (entity != null && entity.getContentLength() != 0) {
                 ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
                 HttpParams params = request.getParams();
-                if (params.getBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false)
+                if (Config.isTrue(params, CoreProtocolPNames.USE_EXPECT_CONTINUE)
                         && !ver.lessEquals(HttpVersion.HTTP_1_0)) {
                     request.addHeader(HTTP.EXPECT_DIRECTIVE, HTTP.EXPECT_CONTINUE);
                 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java Thu Sep 27 13:42:29 2012
@@ -34,6 +34,7 @@ import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.Config;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -61,7 +62,7 @@ public class RequestUserAgent implements
         Args.notNull(request, "HTTP request");
         if (!request.containsHeader(HTTP.USER_AGENT)) {
             HttpParams params = request.getParams();
-            String useragent = (String) params.getParameter(CoreProtocolPNames.USER_AGENT);
+            String useragent = Config.getString(params, CoreProtocolPNames.USER_AGENT);
             if (useragent != null) {
                 request.addHeader(HTTP.USER_AGENT, useragent);
             }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseServer.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseServer.java Thu Sep 27 13:42:29 2012
@@ -34,6 +34,7 @@ import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.Config;
 import org.apache.http.util.Args;
 
 /**
@@ -59,8 +60,7 @@ public class ResponseServer implements H
             throws HttpException, IOException {
         Args.notNull(response, "HTTP response");
         if (!response.containsHeader(HTTP.SERVER_HEADER)) {
-            String s = (String) response.getParams().getParameter(
-                    CoreProtocolPNames.ORIGIN_SERVER);
+            String s = Config.getString(response.getParams(), CoreProtocolPNames.ORIGIN_SERVER);
             if (s != null) {
                 response.addHeader(HTTP.SERVER_HEADER, s);
             }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/TestBasicRequest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/TestBasicRequest.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/TestBasicRequest.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/TestBasicRequest.java Thu Sep 27 13:42:29 2012
@@ -30,7 +30,6 @@ package org.apache.http.impl;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpVersion;
 import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.params.CoreProtocolPNames;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -56,16 +55,6 @@ public class TestBasicRequest {
 
     @Test
     public void testRequestLine() throws Exception {
-        HttpRequest request = new BasicHttpRequest("GET", "/stuff");
-        request.getParams().setParameter(
-                CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_0);
-        Assert.assertEquals("GET", request.getRequestLine().getMethod());
-        Assert.assertEquals("/stuff", request.getRequestLine().getUri());
-        Assert.assertEquals(HttpVersion.HTTP_1_0, request.getRequestLine().getProtocolVersion());
-    }
-
-    @Test
-    public void testRequestLine2() throws Exception {
         HttpRequest request = new BasicHttpRequest("GET", "/stuff", HttpVersion.HTTP_1_0);
         Assert.assertEquals("GET", request.getRequestLine().getMethod());
         Assert.assertEquals("/stuff", request.getRequestLine().getUri());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java Thu Sep 27 13:42:29 2012
@@ -30,18 +30,22 @@ package org.apache.http.impl.entity;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.message.AbstractHttpMessage;
-import org.apache.http.params.CoreProtocolPNames;
 
 class DummyHttpMessage extends AbstractHttpMessage {
 
-    public DummyHttpMessage() {
+    private final ProtocolVersion ver;
+
+    public DummyHttpMessage(final ProtocolVersion ver) {
         super();
+        this.ver = ver != null ? ver : HttpVersion.HTTP_1_1;
+    }
+
+    public DummyHttpMessage() {
+        this(HttpVersion.HTTP_1_1);
     }
 
     public ProtocolVersion getProtocolVersion() {
-        ProtocolVersion ver = (ProtocolVersion) getParams().getParameter(
-                CoreProtocolPNames.PROTOCOL_VERSION);
-        return ver != null ? ver : HttpVersion.HTTP_1_1;
+        return ver;
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java Thu Sep 27 13:42:29 2012
@@ -32,19 +32,39 @@ import java.io.OutputStream;
 import org.apache.http.HttpMessage;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolException;
+import org.apache.http.ProtocolVersion;
 import org.apache.http.entity.ByteArrayEntity;
 import org.apache.http.impl.SessionOutputBufferMock;
 import org.apache.http.impl.io.ChunkedOutputStream;
 import org.apache.http.impl.io.ContentLengthOutputStream;
 import org.apache.http.impl.io.IdentityOutputStream;
 import org.apache.http.io.SessionOutputBuffer;
-import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.message.AbstractHttpMessage;
 import org.junit.Assert;
 import org.junit.Test;
 
 @Deprecated
 public class TestEntitySerializer {
 
+    static class TestHttpMessage extends AbstractHttpMessage {
+
+        private final ProtocolVersion ver;
+
+        public TestHttpMessage(final ProtocolVersion ver) {
+            super();
+            this.ver = ver != null ? ver : HttpVersion.HTTP_1_1;
+        }
+
+        public TestHttpMessage() {
+            this(HttpVersion.HTTP_1_1);
+        }
+
+        public ProtocolVersion getProtocolVersion() {
+            return ver;
+        }
+
+    }
+
     @Test
     public void testIllegalGenerateArg() throws Exception {
         EntitySerializer entitywriter = new EntitySerializer(
@@ -114,9 +134,7 @@ public class TestEntitySerializer {
     @Test
     public void testEntityWithInvalidChunkEncodingAndHTTP10() throws Exception {
         SessionOutputBuffer outbuffer = new SessionOutputBufferMock();
-        HttpMessage message = new DummyHttpMessage();
-        message.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,
-                HttpVersion.HTTP_1_0);
+        HttpMessage message = new DummyHttpMessage(HttpVersion.HTTP_1_0);
         message.addHeader("Transfer-Encoding", "chunked");
 
         EntitySerializer entitywriter = new EntitySerializer(

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestStrictContentLengthStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestStrictContentLengthStrategy.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestStrictContentLengthStrategy.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestStrictContentLengthStrategy.java Thu Sep 27 13:42:29 2012
@@ -31,7 +31,6 @@ import org.apache.http.HttpMessage;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolException;
 import org.apache.http.entity.ContentLengthStrategy;
-import org.apache.http.params.CoreProtocolPNames;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -66,9 +65,7 @@ public class TestStrictContentLengthStra
     @Test(expected=ProtocolException.class)
     public void testEntityWithInvalidChunkEncodingAndHTTP10() throws Exception {
         ContentLengthStrategy lenStrategy = new StrictContentLengthStrategy();
-        HttpMessage message = new DummyHttpMessage();
-        message.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,
-                HttpVersion.HTTP_1_0);
+        HttpMessage message = new DummyHttpMessage(HttpVersion.HTTP_1_0);
         message.addHeader("Transfer-Encoding", "chunked");
         lenStrategy.determineLength(message);
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/pool/TestBasicConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/pool/TestBasicConnPool.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/pool/TestBasicConnPool.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/pool/TestBasicConnPool.java Thu Sep 27 13:42:29 2012
@@ -68,8 +68,8 @@ public class TestBasicConnPool {
         sslServerPort = sslServer.getLocalPort();
 
         params = new BasicHttpParams();
-        params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 100);
-        params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 100);
+        params.setParameter(CoreConnectionPNames.SO_TIMEOUT, 100);
+        params.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 100);
         connFactory = new BasicConnFactory(params);
         pool = new BasicConnPool(connFactory);
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java Thu Sep 27 13:42:29 2012
@@ -473,7 +473,7 @@ public class TestSyncHttp {
         this.server.start();
 
         // Activate 'expect: continue' handshake
-        this.client.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        this.client.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
 
         DefaultBHttpClientConnection conn = client.createConnection();
         HttpHost host = new HttpHost("localhost", this.server.getPort());
@@ -567,7 +567,7 @@ public class TestSyncHttp {
         this.server.start();
 
         // Activate 'expect: continue' handshake
-        this.client.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        this.client.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
 
         DefaultBHttpClientConnection conn = client.createConnection();
         HttpHost host = new HttpHost("localhost", this.server.getPort());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java Thu Sep 27 13:42:29 2012
@@ -32,7 +32,6 @@ import org.apache.http.HttpMessage;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
 import org.junit.Assert;
 import org.junit.Test;
@@ -45,14 +44,19 @@ public class TestAbstractMessage {
 
     static class TestHttpMessage extends AbstractHttpMessage {
 
-        public TestHttpMessage() {
+        private final ProtocolVersion ver;
+
+        public TestHttpMessage(final ProtocolVersion ver) {
             super();
+            this.ver = ver != null ? ver : HttpVersion.HTTP_1_1; 
+        }
+
+        public TestHttpMessage() {
+            this(HttpVersion.HTTP_1_1);
         }
 
         public ProtocolVersion getProtocolVersion() {
-            ProtocolVersion ver = (ProtocolVersion) getParams().getParameter(
-                    CoreProtocolPNames.PROTOCOL_VERSION);
-            return ver != null ? ver : HttpVersion.HTTP_1_1;
+            return ver;
         }
 
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicMessages.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicMessages.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicMessages.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicMessages.java Thu Sep 27 13:42:29 2012
@@ -170,7 +170,7 @@ public class TestBasicMessages {
     public void testExpectContinue() {
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("GET", "/");
         Assert.assertFalse(request.expectContinue());
-        request.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         Assert.assertFalse(request.expectContinue());
         request.addHeader("Expect", "100-Continue");
         Assert.assertTrue(request.expectContinue());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java Thu Sep 27 13:42:29 2012
@@ -59,7 +59,7 @@ public class TestBasicHttpParams {
         BasicHttpParams params = new BasicHttpParams();
         Set<String> nameSet = params.getNames();
         Assert.assertTrue(nameSet.isEmpty());
-        params.setBooleanParameter("true", true);
+        params.setParameter("true", true);
         Assert.assertTrue(nameSet.isEmpty()); // Still empty, as it is a snapshot
         nameSet = params.getNames();
         Assert.assertFalse(nameSet.isEmpty());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java Thu Sep 27 13:42:29 2012
@@ -299,7 +299,7 @@ public class TestStandardInterceptors {
         String s = "whatever";
         StringEntity entity = new StringEntity(s, "US-ASCII");
         request.setEntity(entity);
-        request.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
         Header header = request.getFirstHeader(HTTP.EXPECT_DIRECTIVE);
@@ -314,7 +314,7 @@ public class TestStandardInterceptors {
         String s = "whatever";
         StringEntity entity = new StringEntity(s, "US-ASCII");
         request.setEntity(entity);
-        request.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
+        request.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
         RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
         Header header = request.getFirstHeader(HTTP.EXPECT_DIRECTIVE);
@@ -329,7 +329,7 @@ public class TestStandardInterceptors {
         String s = "whatever";
         StringEntity entity = new StringEntity(s, "US-ASCII");
         request.setEntity(entity);
-        request.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
         Header header = request.getFirstHeader(HTTP.EXPECT_DIRECTIVE);
@@ -343,7 +343,7 @@ public class TestStandardInterceptors {
         String s = "";
         StringEntity entity = new StringEntity(s, "US-ASCII");
         request.setEntity(entity);
-        request.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
+        request.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
         Header header = request.getFirstHeader(HTTP.EXPECT_DIRECTIVE);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java Thu Sep 27 13:42:29 2012
@@ -39,10 +39,8 @@ import org.apache.http.HttpResponse;
 import org.apache.http.HttpVersion;
 import org.apache.http.impl.DefaultBHttpClientConnection;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.CoreConnectionPNames;
-import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.DefaultedHttpParams;
+import org.apache.http.params.HttpCoreConfigBuilder;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -68,11 +66,10 @@ public class HttpClient {
         super();
         this.httpproc = httpproc;
         this.connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
-        this.params = new BasicHttpParams();
-        this.params
-            .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
-            .setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1)
-            .setParameter(CoreProtocolPNames.USER_AGENT, "TEST-CLIENT/1.1");
+        this.params = new HttpCoreConfigBuilder()
+            .setSocketTimeout(5000)
+            .setProtocolVersion(HttpVersion.HTTP_1_1)
+            .setUserAgent("TEST-CLIENT/1.1").build();
         this.httpexecutor = new HttpRequestExecutor();
         this.context = new BasicHttpContext();
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java?rev=1391007&r1=1391006&r2=1391007&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java Thu Sep 27 13:42:29 2012
@@ -41,9 +41,7 @@ import org.apache.http.HttpResponseInter
 import org.apache.http.HttpServerConnection;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.CoreConnectionPNames;
-import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.HttpCoreConfigBuilder;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpContext;
@@ -74,12 +72,11 @@ public class HttpServer {
 
     public HttpServer() throws IOException {
         super();
-        this.params = new BasicHttpParams();
-        this.params
-            .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
-            .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
-            .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
-            .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "TEST-SERVER/1.1");
+        this.params = new HttpCoreConfigBuilder()
+            .setSocketTimeout(5000)
+            .setSocketBufferSize(8 * 1024)
+            .setTcpNoDelay(true)
+            .setOriginServer("TEST-SERVER/1.1").build();
         this.httpproc = new ImmutableHttpProcessor(
                 new HttpResponseInterceptor[] {
                         new ResponseDate(),



Mime
View raw message