Java 类org.apache.http.conn.routing.HttpRoutePlanner 实例源码

项目:lams    文件:DefaultRequestDirector.java   
@Deprecated
public DefaultRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec, conman, reustrat, kastrat, rouplan, httpProcessor, retryHandler,
            new DefaultRedirectStrategyAdaptor(redirectHandler),
            new AuthenticationStrategyAdaptor(targetAuthHandler),
            new AuthenticationStrategyAdaptor(proxyAuthHandler),
            userTokenHandler,
            params);
}
项目:lams    文件:DefaultRequestDirector.java   
@Deprecated
public DefaultRequestDirector(
        final Log log,
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec, conman, reustrat, kastrat, rouplan, httpProcessor, retryHandler,
            redirectStrategy,
            new AuthenticationStrategyAdaptor(targetAuthHandler),
            new AuthenticationStrategyAdaptor(proxyAuthHandler),
            userTokenHandler,
            params);
}
项目:remote-files-sync    文件:InternalHttpClient.java   
public InternalHttpClient(
        final ClientExecChain execChain,
        final HttpClientConnectionManager connManager,
        final HttpRoutePlanner routePlanner,
        final Lookup<CookieSpecProvider> cookieSpecRegistry,
        final Lookup<AuthSchemeProvider> authSchemeRegistry,
        final CookieStore cookieStore,
        final CredentialsProvider credentialsProvider,
        final RequestConfig defaultConfig,
        final List<Closeable> closeables) {
    super();
    Args.notNull(execChain, "HTTP client exec chain");
    Args.notNull(connManager, "HTTP connection manager");
    Args.notNull(routePlanner, "HTTP route planner");
    this.execChain = execChain;
    this.connManager = connManager;
    this.routePlanner = routePlanner;
    this.cookieSpecRegistry = cookieSpecRegistry;
    this.authSchemeRegistry = authSchemeRegistry;
    this.cookieStore = cookieStore;
    this.credentialsProvider = credentialsProvider;
    this.defaultConfig = defaultConfig;
    this.closeables = closeables;
}
项目:purecloud-iot    文件:DefaultRequestDirector.java   
@Deprecated
public DefaultRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec, conman, reustrat, kastrat, rouplan, httpProcessor, retryHandler,
            new DefaultRedirectStrategyAdaptor(redirectHandler),
            new AuthenticationStrategyAdaptor(targetAuthHandler),
            new AuthenticationStrategyAdaptor(proxyAuthHandler),
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:DefaultRequestDirector.java   
@Deprecated
public DefaultRequestDirector(
        final Log log,
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec, conman, reustrat, kastrat, rouplan, httpProcessor, retryHandler,
            redirectStrategy,
            new AuthenticationStrategyAdaptor(targetAuthHandler),
            new AuthenticationStrategyAdaptor(proxyAuthHandler),
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:InternalHttpClient.java   
public InternalHttpClient(
        final ClientExecChain execChain,
        final HttpClientConnectionManager connManager,
        final HttpRoutePlanner routePlanner,
        final Lookup<CookieSpecProvider> cookieSpecRegistry,
        final Lookup<AuthSchemeProvider> authSchemeRegistry,
        final CookieStore cookieStore,
        final CredentialsProvider credentialsProvider,
        final RequestConfig defaultConfig,
        final List<Closeable> closeables) {
    super();
    Args.notNull(execChain, "HTTP client exec chain");
    Args.notNull(connManager, "HTTP connection manager");
    Args.notNull(routePlanner, "HTTP route planner");
    this.execChain = execChain;
    this.connManager = connManager;
    this.routePlanner = routePlanner;
    this.cookieSpecRegistry = cookieSpecRegistry;
    this.authSchemeRegistry = authSchemeRegistry;
    this.cookieStore = cookieStore;
    this.credentialsProvider = credentialsProvider;
    this.defaultConfig = defaultConfig;
    this.closeables = closeables;
}
项目:purecloud-iot    文件:TestInternalHttpClient.java   
@SuppressWarnings("unchecked")
@Before
public void setup() throws Exception {
    execChain = Mockito.mock(ClientExecChain.class);
    connManager = Mockito.mock(HttpClientConnectionManager.class);
    routePlanner = Mockito.mock(HttpRoutePlanner.class);
    cookieSpecRegistry = Mockito.mock(Lookup.class);
    authSchemeRegistry = Mockito.mock(Lookup.class);
    cookieStore = Mockito.mock(CookieStore.class);
    credentialsProvider = Mockito.mock(CredentialsProvider.class);
    defaultConfig = RequestConfig.custom().build();
    closeable1 = Mockito.mock(Closeable.class);
    closeable2 = Mockito.mock(Closeable.class);

    client = new InternalHttpClient(execChain, connManager, routePlanner,
            cookieSpecRegistry, authSchemeRegistry, cookieStore, credentialsProvider,
            defaultConfig, Arrays.asList(closeable1, closeable2));

}
项目:Visit    文件:InternalHttpClient.java   
public InternalHttpClient(
        final ClientExecChain execChain,
        final HttpClientConnectionManager connManager,
        final HttpRoutePlanner routePlanner,
        final Lookup<CookieSpecProvider> cookieSpecRegistry,
        final Lookup<AuthSchemeProvider> authSchemeRegistry,
        final CookieStore cookieStore,
        final CredentialsProvider credentialsProvider,
        final RequestConfig defaultConfig,
        final List<Closeable> closeables) {
    super();
    Args.notNull(execChain, "HTTP client exec chain");
    Args.notNull(connManager, "HTTP connection manager");
    Args.notNull(routePlanner, "HTTP route planner");
    this.execChain = execChain;
    this.connManager = connManager;
    this.routePlanner = routePlanner;
    this.cookieSpecRegistry = cookieSpecRegistry;
    this.authSchemeRegistry = authSchemeRegistry;
    this.cookieStore = cookieStore;
    this.credentialsProvider = credentialsProvider;
    this.defaultConfig = defaultConfig;
    this.closeables = closeables;
}
项目:SoundcloudAPI    文件:ApiWrapper.java   
/** This method mainly exists to make the wrapper more testable. oh, apache's insanity. */
protected RequestDirector getRequestDirector(HttpRequestExecutor requestExec,
                                             ClientConnectionManager conman,
                                             ConnectionReuseStrategy reustrat,
                                             ConnectionKeepAliveStrategy kastrat,
                                             HttpRoutePlanner rouplan,
                                             HttpProcessor httpProcessor,
                                             HttpRequestRetryHandler retryHandler,
                                             RedirectHandler redirectHandler,
                                             AuthenticationHandler targetAuthHandler,
                                             AuthenticationHandler proxyAuthHandler,
                                             UserTokenHandler stateHandler,
                                             HttpParams params
) {
    return new DefaultRequestDirector(requestExec, conman, reustrat, kastrat, rouplan,
            httpProcessor, retryHandler, redirectHandler, targetAuthHandler, proxyAuthHandler,
            stateHandler, params);
}
项目:paperchains    文件:ApiWrapper.java   
/** This method mainly exists to make the wrapper more testable. oh, apache's insanity. */
protected RequestDirector getRequestDirector(HttpRequestExecutor requestExec,
                                             ClientConnectionManager conman,
                                             ConnectionReuseStrategy reustrat,
                                             ConnectionKeepAliveStrategy kastrat,
                                             HttpRoutePlanner rouplan,
                                             HttpProcessor httpProcessor,
                                             HttpRequestRetryHandler retryHandler,
                                             RedirectHandler redirectHandler,
                                             AuthenticationHandler targetAuthHandler,
                                             AuthenticationHandler proxyAuthHandler,
                                             UserTokenHandler stateHandler,
                                             HttpParams params
) {
    return new DefaultRequestDirector(requestExec, conman, reustrat, kastrat, rouplan,
            httpProcessor, retryHandler, redirectHandler, targetAuthHandler, proxyAuthHandler,
            stateHandler, params);
}
项目:ZTLib    文件:InternalHttpClient.java   
public InternalHttpClient(
        final ClientExecChain execChain,
        final HttpClientConnectionManager connManager,
        final HttpRoutePlanner routePlanner,
        final Lookup<CookieSpecProvider> cookieSpecRegistry,
        final Lookup<AuthSchemeProvider> authSchemeRegistry,
        final CookieStore cookieStore,
        final CredentialsProvider credentialsProvider,
        final RequestConfig defaultConfig,
        final List<Closeable> closeables) {
    super();
    Args.notNull(execChain, "HTTP client exec chain");
    Args.notNull(connManager, "HTTP connection manager");
    Args.notNull(routePlanner, "HTTP route planner");
    this.execChain = execChain;
    this.connManager = connManager;
    this.routePlanner = routePlanner;
    this.cookieSpecRegistry = cookieSpecRegistry;
    this.authSchemeRegistry = authSchemeRegistry;
    this.cookieStore = cookieStore;
    this.credentialsProvider = credentialsProvider;
    this.defaultConfig = defaultConfig;
    this.closeables = closeables;
}
项目:cf-java-client-sap    文件:RestUtil.java   
public ClientHttpRequestFactory createRequestFactory(HttpProxyConfiguration httpProxyConfiguration, boolean
        trustSelfSignedCerts) {
    HttpClientBuilder httpClientBuilder = HttpClients.custom().useSystemProperties();

    if (trustSelfSignedCerts) {
        httpClientBuilder.setSslcontext(buildSslContext());
        httpClientBuilder.setHostnameVerifier(BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
    }

    if (httpProxyConfiguration != null) {
        HttpHost proxy = new HttpHost(httpProxyConfiguration.getProxyHost(), httpProxyConfiguration.getProxyPort());
        httpClientBuilder.setProxy(proxy);

        if (httpProxyConfiguration.isAuthRequired()) {
            BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
            credentialsProvider.setCredentials(
                    new AuthScope(httpProxyConfiguration.getProxyHost(), httpProxyConfiguration.getProxyPort()),
                    new UsernamePasswordCredentials(httpProxyConfiguration.getUsername(), httpProxyConfiguration
                            .getPassword()));
            httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
        }

        HttpRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
        httpClientBuilder.setRoutePlanner(routePlanner);
    }

    HttpClient httpClient = httpClientBuilder.build();
    HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);

    return requestFactory;
}
项目:lams    文件:AbstractHttpClient.java   
/**
 * @deprecated (4.1) do not use
 */
@Deprecated
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);
}
项目:lams    文件:AbstractHttpClient.java   
/**
 * @deprecated (4.2) do not use
 */
@Deprecated 
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectStrategy,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);
}
项目:lams    文件:AbstractHttpClient.java   
/**
 * @since 4.2
 */
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationStrategy targetAuthStrategy,
        final AuthenticationStrategy proxyAuthStrategy,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectStrategy,
            targetAuthStrategy,
            proxyAuthStrategy,
            userTokenHandler,
            params);
}
项目:vscrawler    文件:CrawlerSession.java   
private void decorateRoutePlanner(CrawlerHttpClient crawlerHttpClient) {
    HttpRoutePlanner routePlanner = crawlerHttpClient.getRoutePlanner();
    if (!(routePlanner instanceof ProxyBindRoutPlanner)) {
        log.warn("自定义了代理发生器,vscrawler的代理功能将不会生效");
        return;
    }

    VSCrawlerRoutePlanner vsCrawlerRoutePlanner = new VSCrawlerRoutePlanner((ProxyBindRoutPlanner) routePlanner,
            ipPool, proxyPlanner, this);
    crawlerHttpClient.setRoutePlanner(vsCrawlerRoutePlanner);

}
项目:remote-files-sync    文件:RedirectExec.java   
public RedirectExec(
        final ClientExecChain requestExecutor,
        final HttpRoutePlanner routePlanner,
        final RedirectStrategy redirectStrategy) {
    super();
    Args.notNull(requestExecutor, "HTTP client request executor");
    Args.notNull(routePlanner, "HTTP route planner");
    Args.notNull(redirectStrategy, "HTTP redirect strategy");
    this.requestExecutor = requestExecutor;
    this.routePlanner = routePlanner;
    this.redirectStrategy = redirectStrategy;
}
项目:printos-device-api-example-java    文件:HttpClientFactoryBean.java   
@Override
public HttpClient getObject() throws Exception {
  HttpClientBuilder clientBuilder = HttpClients.custom();

  HttpRoutePlanner routePlanner = getRoutePlanner();
  if( routePlanner != null ) {
    clientBuilder.setRoutePlanner(routePlanner);
  }

  clientBuilder.disableCookieManagement();
  clientBuilder.setMaxConnPerRoute(connectionPoolSize);

  if (insecureSsl) {
    SSLContext context = SSLContexts.custom()
            .loadTrustMaterial(null, new TrustSelfSignedStrategy())
            .build();
    SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
            context,
            new String[]{"TLSv1.2"},
            null,
            SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
    clientBuilder.setSSLSocketFactory(sslsf);
  }

  return clientBuilder.build();
}
项目:printos-device-api-example-java    文件:HttpClientFactoryBean.java   
private HttpRoutePlanner getRoutePlanner() {
  proxyHostname = Strings.nullToEmpty(proxyHostname);
  if (proxyHostname.isEmpty()) {
    proxyEnabled = false;
  }
  if (proxyEnabled) {
    HttpHost proxy = new HttpHost(proxyHostname, proxyPort, proxyScheme);

    HttpRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy) {

      @Override
      public HttpRoute determineRoute(
              final HttpHost host,
              final HttpRequest request,
              final HttpContext context) throws HttpException {
        String hostname = host.getHostName();
        if (hostname.equals("127.0.0.1") || hostname.equalsIgnoreCase("localhost")) {
          // Return direct route
          return new HttpRoute(host);
        }
        return super.determineRoute(host, request, context);
      }
    };
    return routePlanner;
  }
  return null;
}
项目:purecloud-iot    文件:AbstractHttpClient.java   
/**
 * @deprecated (4.1) do not use
 */
@Deprecated
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:AbstractHttpClient.java   
/**
 * @deprecated (4.2) do not use
 */
@Deprecated
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectStrategy,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:AbstractHttpClient.java   
/**
 * @since 4.2
 */
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectStrategy redirectStrategy,
        final AuthenticationStrategy targetAuthStrategy,
        final AuthenticationStrategy proxyAuthStrategy,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectStrategy,
            targetAuthStrategy,
            proxyAuthStrategy,
            userTokenHandler,
            params);
}
项目:purecloud-iot    文件:RedirectExec.java   
public RedirectExec(
        final ClientExecChain requestExecutor,
        final HttpRoutePlanner routePlanner,
        final RedirectStrategy redirectStrategy) {
    super();
    Args.notNull(requestExecutor, "HTTP client request executor");
    Args.notNull(routePlanner, "HTTP route planner");
    Args.notNull(redirectStrategy, "HTTP redirect strategy");
    this.requestExecutor = requestExecutor;
    this.routePlanner = routePlanner;
    this.redirectStrategy = redirectStrategy;
}
项目:FMTech    文件:AndroidHttpClient.java   
private AndroidHttpClient(ClientConnectionManager paramClientConnectionManager, HttpParams paramHttpParams)
{
  this.delegate = new DefaultHttpClient(paramClientConnectionManager, paramHttpParams)
  {
    protected final RequestDirector createClientRequestDirector(HttpRequestExecutor paramAnonymousHttpRequestExecutor, ClientConnectionManager paramAnonymousClientConnectionManager, ConnectionReuseStrategy paramAnonymousConnectionReuseStrategy, ConnectionKeepAliveStrategy paramAnonymousConnectionKeepAliveStrategy, HttpRoutePlanner paramAnonymousHttpRoutePlanner, HttpProcessor paramAnonymousHttpProcessor, HttpRequestRetryHandler paramAnonymousHttpRequestRetryHandler, RedirectHandler paramAnonymousRedirectHandler, AuthenticationHandler paramAnonymousAuthenticationHandler1, AuthenticationHandler paramAnonymousAuthenticationHandler2, UserTokenHandler paramAnonymousUserTokenHandler, HttpParams paramAnonymousHttpParams)
    {
      return new ElegantRequestDirector(paramAnonymousHttpRequestExecutor, paramAnonymousClientConnectionManager, paramAnonymousConnectionReuseStrategy, paramAnonymousConnectionKeepAliveStrategy, paramAnonymousHttpRoutePlanner, paramAnonymousHttpProcessor, paramAnonymousHttpRequestRetryHandler, paramAnonymousRedirectHandler, paramAnonymousAuthenticationHandler1, paramAnonymousAuthenticationHandler2, paramAnonymousUserTokenHandler, paramAnonymousHttpParams);
    }

    protected final HttpContext createHttpContext()
    {
      BasicHttpContext localBasicHttpContext = new BasicHttpContext();
      localBasicHttpContext.setAttribute("http.authscheme-registry", getAuthSchemes());
      localBasicHttpContext.setAttribute("http.cookiespec-registry", getCookieSpecs());
      localBasicHttpContext.setAttribute("http.auth.credentials-provider", getCredentialsProvider());
      return localBasicHttpContext;
    }

    protected final BasicHttpProcessor createHttpProcessor()
    {
      BasicHttpProcessor localBasicHttpProcessor = super.createHttpProcessor();
      localBasicHttpProcessor.addRequestInterceptor(AndroidHttpClient.sThreadCheckInterceptor);
      localBasicHttpProcessor.addRequestInterceptor(new AndroidHttpClient.CurlLogger(AndroidHttpClient.this, (byte)0));
      return localBasicHttpProcessor;
    }
  };
}
项目:cft    文件:RestUtils.java   
public static ClientHttpRequestFactory createRequestFactory(HttpProxyConfiguration httpProxyConfiguration, boolean trustSelfSignedCerts, boolean disableRedirectHandling) {
    HttpClientBuilder httpClientBuilder = HttpClients.custom().useSystemProperties();

    if (trustSelfSignedCerts) {
        httpClientBuilder.setSslcontext(buildSslContext());
        httpClientBuilder.setHostnameVerifier(BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
    }

    if (disableRedirectHandling) {
        httpClientBuilder.disableRedirectHandling();
    }

    if (httpProxyConfiguration != null) {
        HttpHost proxy = new HttpHost(httpProxyConfiguration.getProxyHost(), httpProxyConfiguration.getProxyPort());
        httpClientBuilder.setProxy(proxy);

        if (httpProxyConfiguration.isAuthRequired()) {
            BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
            credentialsProvider.setCredentials(
                    new AuthScope(httpProxyConfiguration.getProxyHost(), httpProxyConfiguration.getProxyPort()),
                    new UsernamePasswordCredentials(httpProxyConfiguration.getUsername(), httpProxyConfiguration.getPassword()));
            httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
        }

        HttpRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
        httpClientBuilder.setRoutePlanner(routePlanner);
    }

    HttpClient httpClient = httpClientBuilder.build();
    HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);

    return requestFactory;
}
项目:Visit    文件:RedirectExec.java   
public RedirectExec(
        final ClientExecChain requestExecutor,
        final HttpRoutePlanner routePlanner,
        final RedirectStrategy redirectStrategy) {
    super();
    Args.notNull(requestExecutor, "HTTP client request executor");
    Args.notNull(routePlanner, "HTTP route planner");
    Args.notNull(redirectStrategy, "HTTP redirect strategy");
    this.requestExecutor = requestExecutor;
    this.routePlanner = routePlanner;
    this.redirectStrategy = redirectStrategy;
}
项目:contestparser    文件:SendGridAutoConfigurationTests.java   
@Test
public void expectedSendGridBeanWithProxyCreated() {
    loadContext("spring.sendgrid.username:user", "spring.sendgrid.password:secret",
            "spring.sendgrid.proxy.host:localhost",
            "spring.sendgrid.proxy.port:5678");
    SendGrid sendGrid = this.context.getBean(SendGrid.class);
    CloseableHttpClient client = (CloseableHttpClient) ReflectionTestUtils
            .getField(sendGrid, "client");
    HttpRoutePlanner routePlanner = (HttpRoutePlanner) ReflectionTestUtils
            .getField(client, "routePlanner");
    assertThat(routePlanner, instanceOf(DefaultProxyRoutePlanner.class));
}
项目:FullRobolectricTestSample    文件:ShadowDefaultRequestDirector.java   
public void __constructor__(
    HttpRequestExecutor requestExec,
    ClientConnectionManager conman,
    ConnectionReuseStrategy reustrat,
    ConnectionKeepAliveStrategy kastrat,
    HttpRoutePlanner rouplan,
    HttpProcessor httpProcessor,
    HttpRequestRetryHandler retryHandler,
    RedirectHandler redirectHandler,
    AuthenticationHandler targetAuthHandler,
    AuthenticationHandler proxyAuthHandler,
    UserTokenHandler userTokenHandler,
    HttpParams params) {
  __constructor__(
      LogFactory.getLog(DefaultRequestDirector.class),
      requestExec,
      conman,
      reustrat,
      kastrat,
      rouplan,
      httpProcessor,
      retryHandler,
      redirectHandler,
      targetAuthHandler,
      proxyAuthHandler,
      userTokenHandler,
      params);
}
项目:FullRobolectricTestSample    文件:DefaultRequestDirector.java   
public DefaultRequestDirector(
    final HttpRequestExecutor requestExec,
    final ClientConnectionManager conman,
    final ConnectionReuseStrategy reustrat,
    final ConnectionKeepAliveStrategy kastrat,
    final HttpRoutePlanner rouplan,
    final HttpProcessor httpProcessor,
    final HttpRequestRetryHandler retryHandler,
    final RedirectHandler redirectHandler,
    final AuthenticationHandler targetAuthHandler,
    final AuthenticationHandler proxyAuthHandler,
    final UserTokenHandler userTokenHandler,
    final HttpParams params) {
  this(LogFactory.getLog(DefaultRequestDirector.class),
      requestExec,
      conman,
      reustrat,
      kastrat,
      rouplan,
      httpProcessor,
      retryHandler,
      redirectHandler,
      targetAuthHandler,
      proxyAuthHandler,
      userTokenHandler,
      params);

}
项目:cJUnit-mc626    文件:AbstractHttpClient.java   
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler stateHandler,
        final HttpParams params) {
    return new DefaultRequestDirector(
            log,
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            stateHandler,
            params);
}
项目:cJUnit-mc626    文件:DefaultRequestDirector.java   
public DefaultRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler userTokenHandler,
        final HttpParams params) {
    this(LogFactory.getLog(DefaultRequestDirector.class),
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            userTokenHandler,
            params);

}
项目:ZTLib    文件:RedirectExec.java   
public RedirectExec(
        final ClientExecChain requestExecutor,
        final HttpRoutePlanner routePlanner,
        final RedirectStrategy redirectStrategy) {
    super();
    Args.notNull(requestExecutor, "HTTP client request executor");
    Args.notNull(routePlanner, "HTTP route planner");
    Args.notNull(redirectStrategy, "HTTP redirect strategy");
    this.requestExecutor = requestExecutor;
    this.routePlanner = routePlanner;
    this.redirectStrategy = redirectStrategy;
}
项目:YiBo    文件:LibHttpClient.java   
@Override
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler stateHandler,
        final HttpParams params) {
    return new LibRequestDirector(
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            stateHandler,
            params);
}
项目:yibo-library    文件:YiBoHttpClient.java   
@Override
protected RequestDirector createClientRequestDirector(
        final HttpRequestExecutor requestExec,
        final ClientConnectionManager conman,
        final ConnectionReuseStrategy reustrat,
        final ConnectionKeepAliveStrategy kastrat,
        final HttpRoutePlanner rouplan,
        final HttpProcessor httpProcessor,
        final HttpRequestRetryHandler retryHandler,
        final RedirectHandler redirectHandler,
        final AuthenticationHandler targetAuthHandler,
        final AuthenticationHandler proxyAuthHandler,
        final UserTokenHandler stateHandler,
        final HttpParams params) {
    return new YiBoRequestDirector(
            requestExec,
            conman,
            reustrat,
            kastrat,
            rouplan,
            httpProcessor,
            retryHandler,
            redirectHandler,
            targetAuthHandler,
            proxyAuthHandler,
            stateHandler,
            params);
}
项目:BigSemanticsJava    文件:RedirectHttpClient.java   
@Override
protected RequestDirector createClientRequestDirector(HttpRequestExecutor requestExec,
                                                      ClientConnectionManager conman,
                                                      ConnectionReuseStrategy reustrat,
                                                      ConnectionKeepAliveStrategy kastrat,
                                                      HttpRoutePlanner rouplan,
                                                      HttpProcessor httpProcessor,
                                                      HttpRequestRetryHandler retryHandler,
                                                      RedirectStrategy redirectStrategy,
                                                      AuthenticationStrategy targetAuthStrategy,
                                                      AuthenticationStrategy proxyAuthStrategy,
                                                      UserTokenHandler userTokenHandler,
                                                      HttpParams params)
{
  return new RedirectRequestDirector(log,
                                     requestExec,
                                     conman,
                                     reustrat,
                                     kastrat,
                                     rouplan,
                                     httpProcessor,
                                     retryHandler,
                                     redirectStrategy,
                                     targetAuthStrategy,
                                     proxyAuthStrategy,
                                     userTokenHandler,
                                     params);
}
项目:BigSemanticsJava    文件:RedirectRequestDirector.java   
public RedirectRequestDirector(Log log,
                               HttpRequestExecutor requestExec,
                               ClientConnectionManager conman,
                               ConnectionReuseStrategy reustrat,
                               ConnectionKeepAliveStrategy kastrat,
                               HttpRoutePlanner rouplan,
                               HttpProcessor httpProcessor,
                               HttpRequestRetryHandler retryHandler,
                               RedirectStrategy redirectStrategy,
                               AuthenticationStrategy targetAuthStrategy,
                               AuthenticationStrategy proxyAuthStrategy,
                               UserTokenHandler userTokenHandler,
                               HttpParams params)
{
  super(log,
        requestExec,
        conman,
        reustrat,
        kastrat,
        rouplan,
        httpProcessor,
        retryHandler,
        redirectStrategy,
        targetAuthStrategy,
        proxyAuthStrategy,
        userTokenHandler,
        params);
}
项目:SecureShareLib    文件:ApiWrapper.java   
/** This method mainly exists to make the wrapper more testable. oh, apache's insanity. */
protected RequestDirector getRequestDirector(HttpRequestExecutor requestExec,
                                             ClientConnectionManager conman,
                                             ConnectionReuseStrategy reustrat,
                                             ConnectionKeepAliveStrategy kastrat,
                                             HttpRoutePlanner rouplan,
                                             HttpProcessor httpProcessor,
                                             HttpRequestRetryHandler retryHandler,
                                             RedirectHandler redirectHandler,
                                             AuthenticationHandler targetAuthHandler,
                                             AuthenticationHandler proxyAuthHandler,
                                             UserTokenHandler stateHandler,
                                             HttpParams params
) {
    return new DefaultRequestDirector(requestExec, conman, reustrat, kastrat, rouplan,
            httpProcessor, retryHandler, redirectHandler, targetAuthHandler, proxyAuthHandler,
            stateHandler, params);
}
项目:lams    文件:AbstractHttpClient.java   
protected HttpRoutePlanner createHttpRoutePlanner() {
    return new DefaultHttpRoutePlanner(getConnectionManager().getSchemeRegistry());
}
项目:lams    文件:AbstractHttpClient.java   
public synchronized final HttpRoutePlanner getRoutePlanner() {
    if (this.routePlanner == null) {
        this.routePlanner = createHttpRoutePlanner();
    }
    return this.routePlanner;
}
项目:lams    文件:AbstractHttpClient.java   
public synchronized void setRoutePlanner(final HttpRoutePlanner routePlanner) {
    this.routePlanner = routePlanner;
}