Examples of PoolingClientConnectionManager


Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

        this.http = client;
    }

    private DefaultHttpClient createClient() {
        try {
            DefaultHttpClient client = new DefaultHttpClient(new PoolingClientConnectionManager());
            SSLSocketFactory socketFactory = TrustedSSLSocketFactory.create();
            Scheme sch = new Scheme("https", 443, socketFactory);
            client.getConnectionManager().getSchemeRegistry().register(sch);
            return client;
        } catch (GeneralSecurityException e) {
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

    /**
     * Helper which returns HTTP client configured for https session
     */
    private HttpClient sslReadyHttpClient() throws GeneralSecurityException {
        DefaultHttpClient httpClient = new DefaultHttpClient(new PoolingClientConnectionManager());
        SSLSocketFactory sslSocketFactory = new SSLSocketFactory(new TrustSelfSignedStrategy(), null);
        Scheme scheme = new Scheme("https", server.getPort(), sslSocketFactory);
        httpClient.getConnectionManager().getSchemeRegistry().register(scheme);
        httpClient.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 10000);
        return httpClient;
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

      javax.net.ssl.SSLSocketFactory httpsSocketFactory = KeystoreManagerFactory.getTrustingSecureSocketFactory();;
      SSLSocketFactory myFactory = new SSLSocketFactory(new InterruptibleSocketFactory(httpsSocketFactory,connectionTimeoutMilliseconds),
        new AllowAllHostnameVerifier());
      Scheme myHttpsProtocol = new Scheme("https", 443, myFactory);

      PoolingClientConnectionManager localConnectionManager = new PoolingClientConnectionManager();
      localConnectionManager.setMaxTotal(1);
      connectionManager = localConnectionManager;

      // Set up protocol registry
      connectionManager.getSchemeRegistry().register(myHttpsProtocol);
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

      location += "/" + core;
    }

    // Initialize standard solr-j.
    // First, we need an HttpClient where basic auth is properly set up.
    PoolingClientConnectionManager localConnectionManager = new PoolingClientConnectionManager();
    localConnectionManager.setMaxTotal(1);
    SSLSocketFactory myFactory;
    if (keystoreManager != null)
    {
      myFactory = new SSLSocketFactory(keystoreManager.getSecureSocketFactory(),
        new AllowAllHostnameVerifier());
    }
    else
    {
      // Use the "trust everything" one
      myFactory = new SSLSocketFactory(KeystoreManagerFactory.getTrustingSecureSocketFactory(),
        new AllowAllHostnameVerifier());
    }
    Scheme myHttpsProtocol = new Scheme("https", 443, myFactory);
    localConnectionManager.getSchemeRegistry().register(myHttpsProtocol);
    connectionManager = localConnectionManager;
         
    BasicHttpParams params = new BasicHttpParams();
    // This one is essential to prevent us from reading from the content stream before necessary during auth, but
    // is incompatible with some proxies.
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

      }

      // Set up ssl if indicated
      keystoreData = params.getParameter( "keystore" );

      PoolingClientConnectionManager localConnectionManager = new PoolingClientConnectionManager();
      localConnectionManager.setMaxTotal(1);
      connectionManager = localConnectionManager;

      if (keystoreData != null)
      {
        keystoreManager = KeystoreManagerFactory.make("",keystoreData);
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

        hostHost = fetchHost;
      }
     
      if (connManager == null)
      {
        PoolingClientConnectionManager localConnManager = new PoolingClientConnectionManager();
        localConnManager.setMaxTotal(1);
        localConnManager.setDefaultMaxPerRoute(1);
        connManager = localConnManager;
      }
     
      // Set up protocol registry
      connManager.getSchemeRegistry().register(myHttpsProtocol);
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

    {
      int socketTimeout = 900000;
      int connectionTimeout = 300000;

      // Set up connection manager
      PoolingClientConnectionManager localConnectionManager = new PoolingClientConnectionManager();
      localConnectionManager.setMaxTotal(1);

      // Set up ingest ssl if indicated
      if (ingestKeystoreManager != null)
      {
        SSLSocketFactory myFactory = new SSLSocketFactory(new InterruptibleSocketFactory(ingestKeystoreManager.getSecureSocketFactory(), connectionTimeout),
          new BrowserCompatHostnameVerifier());
        Scheme myHttpsProtocol = new Scheme("https", 443, myFactory);
        localConnectionManager.getSchemeRegistry().register(myHttpsProtocol);
      }
      connectionManager = localConnectionManager;

      // Create the httpclient
      BasicHttpParams params = new BasicHttpParams();
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

    javax.net.ssl.SSLSocketFactory httpsSocketFactory = KeystoreManagerFactory.getTrustingSecureSocketFactory();
    SSLSocketFactory myFactory = new SSLSocketFactory(new InterruptibleSocketFactory(httpsSocketFactory,connectionTimeout),
      new AllowAllHostnameVerifier());
    Scheme myHttpsProtocol = new Scheme("https", 443, myFactory);

    PoolingClientConnectionManager localConnectionManager = new PoolingClientConnectionManager();
    localConnectionManager.setMaxTotal(1);
    connectionManager = localConnectionManager;
    // Set up protocol registry
    connectionManager.getSchemeRegistry().register(myHttpsProtocol);

    BasicHttpParams params = new BasicHttpParams();
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

    javax.net.ssl.SSLSocketFactory httpsSocketFactory = KeystoreManagerFactory.getTrustingSecureSocketFactory();
    SSLSocketFactory myFactory = new SSLSocketFactory(new InterruptibleSocketFactory(httpsSocketFactory,connectionTimeout),
      new AllowAllHostnameVerifier());
    Scheme myHttpsProtocol = new Scheme("https", 443, myFactory);

    PoolingClientConnectionManager localConnectionManager = new PoolingClientConnectionManager();
    localConnectionManager.setMaxTotal(1);
    connectionManager = localConnectionManager;
    // Set up protocol registry
    connectionManager.getSchemeRegistry().register(myHttpsProtocol);

    BasicHttpParams params = new BasicHttpParams();
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager

    }

    protected ClientConnectionManager createConnectionManager() {
        SchemeRegistry schemeRegistry = new SchemeRegistry();
        // setup the connection live time
        PoolingClientConnectionManager answer = new PoolingClientConnectionManager(schemeRegistry, getConnectionTimeToLive(), TimeUnit.MILLISECONDS);
        if (getMaxTotalConnections() > 0) {
            answer.setMaxTotal(getMaxTotalConnections());
        }
        if (getConnectionsPerRoute() > 0) {
            answer.setDefaultMaxPerRoute(getConnectionsPerRoute());
        }
       
        LOG.info("Created ClientConnectionManager " + answer);

        return answer;
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.