Package org.apache.http.impl.client

Examples of org.apache.http.impl.client.HttpClientBuilder.build()


          .setRequestExecutor(new HttpRequestExecutor(executorTimeout))
          .setDefaultSocketConfig(
              SocketConfig.custom().setTcpNoDelay(true)
                  .setSoTimeout(socketTimeout).build());

      client = clientBuilder.build();

    }
    expirationTime = System.currentTimeMillis() + EXPIRATION_INTERVAL;
    return client;
  }
View Full Code Here


        .setDefaultCredentialsProvider(credentialsProvider);
      if (myFactory != null)
        builder.setSSLSocketFactory(myFactory);
      builder.setRequestExecutor(new HttpRequestExecutor(socketTimeout))
        .setRedirectStrategy(new DefaultRedirectStrategy());
      httpClient = builder.build();
     
      proxy = new SPSProxyHelper( serverUrl, encodedServerLocation, serverLocation, serverUserName, password,
        org.apache.manifoldcf.core.common.CommonsHTTPSender.class, "client-config.wsdd",
        httpClient, isClaimSpace );
     
View Full Code Here

        .setRedirectStrategy(new DefaultRedirectStrategy());

      if (myFactory != null)
        builder.setSSLSocketFactory(myFactory);
     
      httpClient = builder.build();

      // System.out.println("Connection server object = "+llServer.toString());

      // Establish the actual connection
      int sanityRetryCount = FAILURE_RETRY_COUNT;
View Full Code Here

        .setDefaultCredentialsProvider(credentialsProvider);
      if (myFactory != null)
        builder.setSSLSocketFactory(myFactory);
      builder.setRequestExecutor(new HttpRequestExecutor(socketTimeout))
        .setRedirectStrategy(new DefaultRedirectStrategy());
      httpClient = builder.build();

      proxy = new SPSProxyHelper( serverUrl, encodedServerLocation, serverLocation, userName, password,
        org.apache.manifoldcf.core.common.CommonsHTTPSender.class, "client-config.wsdd",
        httpClient );
     
View Full Code Here

            long startTime = System.currentTimeMillis();
           
            RequestConfig rc = rcBuilder.build();
            reqBuilder.setConfig(rc);
            HttpUriRequest req = reqBuilder.build();
            httpClient = hcBuilder.build();
           
            HttpResponse http_res = httpClient.execute(req, httpContext);
           
            long endTime = System.currentTimeMillis();
           
View Full Code Here

      
            HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
            if(Main.getConfig().getProxyHost() != null && Main.getConfig().getProxyPort() != null) {
                httpClientBuilder.setProxy(new HttpHost(Main.getConfig().getProxyHost(), Main.getConfig().getProxyPort()));
            }
            HttpClient httpClient = httpClientBuilder.build();
            HttpResponse httpResponse = httpClient.execute(httpPost);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            httpEntity = httpResponse.getEntity();
           
            StatusLine statusLine = httpResponse.getStatusLine();
View Full Code Here

            httpPost.setEntity(new StringEntity("streamKey=" + streamKey));
            HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
            if(Main.getConfig().getProxyHost() != null && Main.getConfig().getProxyPort() != null) {
                httpClientBuilder.setProxy(new HttpHost(Main.getConfig().getProxyHost(), Main.getConfig().getProxyPort()));
            }
            HttpClient httpClient = httpClientBuilder.build();
            HttpResponse httpResponse = httpClient.execute(httpPost);
            HttpEntity httpEntity = httpResponse.getEntity();
            OutputStream outputStream = null;
            try {
                StatusLine statusLine = httpResponse.getStatusLine();
View Full Code Here

            new UsernamePasswordCredentials(config.getProxyUserName(), config.getProxyPassword()));
        builder.setDefaultCredentialsProvider(credentialsProvider);
      }
    }

    return builder.build();
  }

  protected int getDefaultMaxPerRoute(GoogleAnalyticsConfig config) {
    return Math.max(config.getMaxThreads(), 1);
  }
View Full Code Here

      } else {
        logger.warn("Password not found so authentication is not used!");
        username = null;
      }
    }
    httpclient = clientBuilder.build();
  }

  /**
   * Constructor for unit tests, nothing is configured here.
   */
 
View Full Code Here

        .setRedirectStrategy(new DefaultRedirectStrategy());

      if (myFactory != null)
        builder.setSSLSocketFactory(myFactory);
     
      httpClient = builder.build();

      // System.out.println("Connection server object = "+llServer.toString());

      // Establish the actual connection
      int sanityRetryCount = FAILURE_RETRY_COUNT;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.