Package org.apache.http.params

Examples of org.apache.http.params.HttpParams


                                                                                        DEFAULT_CONNECTION_MANAGER_TIMEOUT,
                                                                                        TimeUnit.MILLISECONDS);

        DefaultHttpClient httpClient = new DefaultHttpClient(connectionManager);

        HttpParams clientParams = httpClient.getParams();

        HttpConnectionParams.setSocketBufferSize(clientParams, 60000);
        HttpConnectionParams.setTcpNoDelay(clientParams, false);
        HttpProtocolParams.setUserAgent(clientParams, VOLDEMORT_USER_AGENT);
        HttpProtocolParams.setVersion(clientParams, HttpVersion.HTTP_1_1);
View Full Code Here


                                                                                        10000,
                                                                                        TimeUnit.MILLISECONDS);

        DefaultHttpClient httpClient = new DefaultHttpClient(connectionManager);

        HttpParams clientParams = httpClient.getParams();
        httpClient.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(0, false));
        HttpClientParams.setCookiePolicy(clientParams, CookiePolicy.IGNORE_COOKIES);
        HttpProtocolParams.setUserAgent(clientParams, "test-agent");
        HttpProtocolParams.setVersion(clientParams, HttpVersion.HTTP_1_1);
View Full Code Here

                // set custom HTTP params
                final Map<String, Object> configParams = configuration.getHttpParams();
                if (configParams != null && !configParams.isEmpty()) {
                    LOG.debug("Setting {} HTTP Params", configParams.size());

                    final HttpParams httpParams = httpClient.getParams();
                    for (Map.Entry<String, Object> param : configParams.entrySet()) {
                        httpParams.setParameter(param.getKey(), param.getValue());
                    }
                }

                return httpClient;
            }
View Full Code Here

      this.schemeRegistry = Preconditions.checkNotNull(schemeRegistry);
      return this;
  }

  public BasicClient build() {
    HttpParams params = new BasicHttpParams();
    HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
    HttpProtocolParams.setUserAgent(params, USER_AGENT);
    HttpConnectionParams.setSoTimeout(params, socketTimeoutMillis);
    HttpConnectionParams.setConnectionTimeout(params, connectionTimeoutMillis);
    return new BasicClient(name, hosts, endpoint, auth, enableGZip, processor, reconnectionManager,
View Full Code Here

      logger.error("Exception: init velocity:", e);
    }
    // init the server
   
    // HTTP parameters for the server
        HttpParams params = new SyncBasicHttpParams();
        params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
            .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
            .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
            .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpTest/1.1");
        // Create HTTP protocol processing chain
        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
View Full Code Here

 
  private static final Logger LOG = Logger.getLogger(AbstractMusicBrainzClient.class);
 
  public AbstractMusicBrainzClient() {
    httpClient = new DefaultHttpClient();
    HttpParams params = httpClient.getParams();
    setConnectionTimeout(params, TIMEOUT);
    setSoTimeout(params, TIMEOUT);
  }
View Full Code Here

  protected static final Logger LOG = Logger.getLogger(AbstractWSClient.class);
 
  public AbstractWSClient() {
    // default values for a production environment
    httpClient = new DefaultHttpClient();
    HttpParams params = httpClient.getParams();
    HttpConnectionParams.setConnectionTimeout(params, TIMEOUT);
    HttpConnectionParams.setSoTimeout(params, TIMEOUT);
  }
View Full Code Here

  public HttpRequest buildRequest(HttpMethod method, URI uri) {
    return new ApacheCommonsHttpRequest(httpClient, method, uri);
  }

  HttpClient buildHttpClient(SslConfiguration sslConfiguration) {
    HttpParams httpParams = null;

    if (sslConfiguration == null || sslConfiguration.isEmpty()) {
      sslConfiguration = null;
    }
View Full Code Here

    }

    private synchronized void init() {
        if (_httpClient == null) {
            // Create and initialize HTTP parameters
            HttpParams params = new BasicHttpParams();

            // TODO KKr - w/4.1, switch to new api (ThreadSafeClientConnManager)
            // cm.setMaxTotalConnections(_maxThreads);
            // cm.setDefaultMaxPerRoute(Math.max(10, _maxThreads/10));
            // And get rid of deprecation warnings here.
View Full Code Here

      {
         throw new RuntimeException("Trying to process targetUri init parameter: " + e, e);
      }
      targetUri = targetUriObj.toString();

      HttpParams hcParams = new BasicHttpParams();
      readConfigParam(hcParams, ClientPNames.HANDLE_REDIRECTS, Boolean.class);
      proxyClient = createHttpClient(hcParams);
   }
View Full Code Here

TOP

Related Classes of org.apache.http.params.HttpParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.