本文整理汇总了Java中org.apache.http.client.protocol.RequestClientConnControl类的典型用法代码示例。如果您正苦于以下问题:Java RequestClientConnControl类的具体用法?Java RequestClientConnControl怎么用?Java RequestClientConnControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestClientConnControl类属于org.apache.http.client.protocol包,在下文中一共展示了RequestClientConnControl类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ProxyClient
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
public ProxyClient(final HttpParams params) {
super();
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
this.httpProcessor = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
new RequestContent(),
new RequestTargetHost(),
new RequestClientConnControl(),
new RequestUserAgent(),
new RequestProxyAuthentication()
} );
this.requestExec = new HttpRequestExecutor();
this.proxyAuthStrategy = new ProxyAuthenticationStrategy();
this.authenticator = new HttpAuthenticator();
this.proxyAuthState = new AuthState();
this.authSchemeRegistry = new AuthSchemeRegistry();
this.authSchemeRegistry.register(AuthPolicy.BASIC, new BasicSchemeFactory());
this.authSchemeRegistry.register(AuthPolicy.DIGEST, new DigestSchemeFactory());
this.authSchemeRegistry.register(AuthPolicy.NTLM, new NTLMSchemeFactory());
this.authSchemeRegistry.register(AuthPolicy.SPNEGO, new SPNegoSchemeFactory());
this.authSchemeRegistry.register(AuthPolicy.KERBEROS, new KerberosSchemeFactory());
this.reuseStrategy = new DefaultConnectionReuseStrategy();
this.params = params;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:ProxyClient.java
示例2: createHttpProcessor
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
/**
* Create the processor with the following interceptors:
* <ul>
* <li>{@link RequestDefaultHeaders}</li>
* <li>{@link RequestContent}</li>
* <li>{@link RequestTargetHost}</li>
* <li>{@link RequestClientConnControl}</li>
* <li>{@link RequestUserAgent}</li>
* <li>{@link RequestExpectContinue}</li>
* <li>{@link RequestAddCookies}</li>
* <li>{@link ResponseProcessCookies}</li>
* <li>{@link RequestAuthCache}</li>
* <li>{@link RequestTargetAuthentication}</li>
* <li>{@link RequestProxyAuthentication}</li>
* </ul>
* <p>
* @return the processor with the added interceptors.
*/
@Override
protected BasicHttpProcessor createHttpProcessor() {
BasicHttpProcessor httpproc = new BasicHttpProcessor();
httpproc.addInterceptor(new RequestDefaultHeaders());
// Required protocol interceptors
httpproc.addInterceptor(new RequestContent());
httpproc.addInterceptor(new RequestTargetHost());
// Recommended protocol interceptors
httpproc.addInterceptor(new RequestClientConnControl());
httpproc.addInterceptor(new RequestUserAgent());
httpproc.addInterceptor(new RequestExpectContinue());
// HTTP state management interceptors
httpproc.addInterceptor(new RequestAddCookies());
httpproc.addInterceptor(new ResponseProcessCookies());
// HTTP authentication interceptors
httpproc.addInterceptor(new RequestAuthCache());
httpproc.addInterceptor(new RequestTargetAuthentication());
httpproc.addInterceptor(new RequestProxyAuthentication());
return httpproc;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:39,代码来源:DefaultHttpClient.java
示例3: MinimalClientExec
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
public MinimalClientExec(
final HttpRequestExecutor requestExecutor,
final HttpClientConnectionManager connManager,
final ConnectionReuseStrategy reuseStrategy,
final ConnectionKeepAliveStrategy keepAliveStrategy) {
Args.notNull(requestExecutor, "HTTP request executor");
Args.notNull(connManager, "Client connection manager");
Args.notNull(reuseStrategy, "Connection reuse strategy");
Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
this.httpProcessor = new ImmutableHttpProcessor(
new RequestContentHC4(),
new RequestTargetHostHC4(),
new RequestClientConnControl(),
new RequestUserAgentHC4(VersionInfoHC4.getUserAgent(
"Apache-HttpClient", "org.apache.http.client", getClass())));
this.requestExecutor = requestExecutor;
this.connManager = connManager;
this.reuseStrategy = reuseStrategy;
this.keepAliveStrategy = keepAliveStrategy;
}
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:21,代码来源:MinimalClientExec.java
示例4: ProxyClient
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
/**
* @since 4.3
*/
public ProxyClient(
final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
final ConnectionConfig connectionConfig,
final RequestConfig requestConfig) {
super();
this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;
this.connectionConfig = connectionConfig != null ? connectionConfig : ConnectionConfig.DEFAULT;
this.requestConfig = requestConfig != null ? requestConfig : RequestConfig.DEFAULT;
this.httpProcessor = new ImmutableHttpProcessor(
new RequestTargetHostHC4(), new RequestClientConnControl(), new RequestUserAgentHC4());
this.requestExec = new HttpRequestExecutor();
this.proxyAuthStrategy = new ProxyAuthenticationStrategy();
this.authenticator = new HttpAuthenticator();
this.proxyAuthState = new AuthStateHC4();
this.authSchemeRegistry = new AuthSchemeRegistry();
this.authSchemeRegistry.register(AuthSchemes.BASIC, new BasicSchemeFactoryHC4());
this.authSchemeRegistry.register(AuthSchemes.DIGEST, new DigestSchemeFactoryHC4());
this.authSchemeRegistry.register(AuthSchemes.NTLM, new NTLMSchemeFactory());
this.reuseStrategy = new DefaultConnectionReuseStrategyHC4();
}
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:24,代码来源:ProxyClient.java
示例5: _getApacheKissHttpClientBuilder
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
private static HttpClientBuilder _getApacheKissHttpClientBuilder() {
return HttpClients.custom()
.addInterceptorFirst(new RequestDefaultHeaders())
.addInterceptorFirst(new RequestContent())
.addInterceptorFirst(new RequestTargetHost())
.addInterceptorFirst(new RequestClientConnControl())
.addInterceptorFirst(new RequestAddCookies())
.addInterceptorFirst(new ResponseProcessCookies())
.addInterceptorFirst(new RequestAuthCache())
.addInterceptorLast(new HttpRequestInterceptor() {
@Override
public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException {
if (request.containsHeader("User-Agent")) {
request.removeHeaders("User-Agent");
}
if (request.containsHeader("Custom-User-Agent")) {
request.addHeader("User-Agent", request.getFirstHeader("Custom-User-Agent").getValue());
request.removeHeaders("Custom-User-Agent");
}
}
});
}
开发者ID:tonikelope,项目名称:megabasterd,代码行数:32,代码来源:MiscTools.java
示例6: createHttpProcessor
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
/**
* Create the processor with the following interceptors:
* <ul>
* <li>{@link RequestDefaultHeaders}</li>
* <li>{@link RequestContent}</li>
* <li>{@link RequestTargetHost}</li>
* <li>{@link RequestClientConnControl}</li>
* <li>{@link RequestUserAgent}</li>
* <li>{@link RequestExpectContinue}</li>
* <li>{@link RequestAddCookies}</li>
* <li>{@link ResponseProcessCookies}</li>
* <li>{@link RequestAuthCache}</li>
* <li>{@link RequestTargetAuthentication}</li>
* <li>{@link RequestProxyAuthentication}</li>
* </ul>
* <p>
* @return the processor with the added interceptors.
*/
@Override
protected BasicHttpProcessor createHttpProcessor() {
final BasicHttpProcessor httpproc = new BasicHttpProcessor();
httpproc.addInterceptor(new RequestDefaultHeaders());
// Required protocol interceptors
httpproc.addInterceptor(new RequestContent());
httpproc.addInterceptor(new RequestTargetHost());
// Recommended protocol interceptors
httpproc.addInterceptor(new RequestClientConnControl());
httpproc.addInterceptor(new RequestUserAgent());
httpproc.addInterceptor(new RequestExpectContinue());
// HTTP state management interceptors
httpproc.addInterceptor(new RequestAddCookies());
httpproc.addInterceptor(new ResponseProcessCookies());
// HTTP authentication interceptors
httpproc.addInterceptor(new RequestAuthCache());
httpproc.addInterceptor(new RequestTargetAuthentication());
httpproc.addInterceptor(new RequestProxyAuthentication());
return httpproc;
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:39,代码来源:DefaultHttpClient.java
示例7: MinimalClientExec
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
public MinimalClientExec(
final HttpRequestExecutor requestExecutor,
final HttpClientConnectionManager connManager,
final ConnectionReuseStrategy reuseStrategy,
final ConnectionKeepAliveStrategy keepAliveStrategy) {
Args.notNull(requestExecutor, "HTTP request executor");
Args.notNull(connManager, "Client connection manager");
Args.notNull(reuseStrategy, "Connection reuse strategy");
Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
this.httpProcessor = new ImmutableHttpProcessor(
new RequestContent(),
new RequestTargetHost(),
new RequestClientConnControl(),
new RequestUserAgent(VersionInfo.getUserAgent(
"Apache-HttpClient", "org.apache.http.client", getClass())));
this.requestExecutor = requestExecutor;
this.connManager = connManager;
this.reuseStrategy = reuseStrategy;
this.keepAliveStrategy = keepAliveStrategy;
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:21,代码来源:MinimalClientExec.java
示例8: ProxyClient
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
/**
* @since 4.3
*/
public ProxyClient(
final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
final ConnectionConfig connectionConfig,
final RequestConfig requestConfig) {
super();
this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;
this.connectionConfig = connectionConfig != null ? connectionConfig : ConnectionConfig.DEFAULT;
this.requestConfig = requestConfig != null ? requestConfig : RequestConfig.DEFAULT;
this.httpProcessor = new ImmutableHttpProcessor(
new RequestTargetHost(), new RequestClientConnControl(), new RequestUserAgent());
this.requestExec = new HttpRequestExecutor();
this.proxyAuthStrategy = new ProxyAuthenticationStrategy();
this.authenticator = new HttpAuthenticator();
this.proxyAuthState = new AuthState();
this.authSchemeRegistry = new AuthSchemeRegistry();
this.authSchemeRegistry.register(AuthSchemes.BASIC, new BasicSchemeFactory());
this.authSchemeRegistry.register(AuthSchemes.DIGEST, new DigestSchemeFactory());
this.authSchemeRegistry.register(AuthSchemes.NTLM, new NTLMSchemeFactory());
this.authSchemeRegistry.register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory());
this.authSchemeRegistry.register(AuthSchemes.KERBEROS, new KerberosSchemeFactory());
this.reuseStrategy = new DefaultConnectionReuseStrategy();
}
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:26,代码来源:ProxyClient.java
示例9: createHttpProcessor
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
@Override
protected BasicHttpProcessor createHttpProcessor() {
BasicHttpProcessor httpproc = new BasicHttpProcessor();
httpproc.addInterceptor(new RequestDefaultHeaders());
// Required protocol interceptors
httpproc.addInterceptor(new RequestContent());
httpproc.addInterceptor(new RequestTargetHost());
// Recommended protocol interceptors
httpproc.addInterceptor(new RequestClientConnControl());
httpproc.addInterceptor(new RequestUserAgent());
httpproc.addInterceptor(new RequestExpectContinue());
// HTTP state management interceptors
httpproc.addInterceptor(new RequestAddCookies());
httpproc.addInterceptor(new ResponseProcessCookies());
// HTTP authentication interceptors
httpproc.addInterceptor(new RequestTargetAuthentication());
httpproc.addInterceptor(new RequestProxyAuthentication());
return httpproc;
}
开发者ID:tdopires,项目名称:cJUnit-mc626,代码行数:20,代码来源:DefaultHttpClient.java
示例10: MainClientExec
import org.apache.http.client.protocol.RequestClientConnControl; //导入依赖的package包/类
public MainClientExec(
final HttpRequestExecutor requestExecutor,
final HttpClientConnectionManager connManager,
final ConnectionReuseStrategy reuseStrategy,
final ConnectionKeepAliveStrategy keepAliveStrategy,
final AuthenticationStrategy targetAuthStrategy,
final AuthenticationStrategy proxyAuthStrategy,
final UserTokenHandler userTokenHandler) {
Args.notNull(requestExecutor, "HTTP request executor");
Args.notNull(connManager, "Client connection manager");
Args.notNull(reuseStrategy, "Connection reuse strategy");
Args.notNull(keepAliveStrategy, "Connection keep alive strategy");
Args.notNull(targetAuthStrategy, "Target authentication strategy");
Args.notNull(proxyAuthStrategy, "Proxy authentication strategy");
Args.notNull(userTokenHandler, "User token handler");
this.authenticator = new HttpAuthenticator();
this.proxyHttpProcessor = new ImmutableHttpProcessor(
new RequestTargetHostHC4(), new RequestClientConnControl());
this.routeDirector = new BasicRouteDirector();
this.requestExecutor = requestExecutor;
this.connManager = connManager;
this.reuseStrategy = reuseStrategy;
this.keepAliveStrategy = keepAliveStrategy;
this.targetAuthStrategy = targetAuthStrategy;
this.proxyAuthStrategy = proxyAuthStrategy;
this.userTokenHandler = userTokenHandler;
}
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:28,代码来源:MainClientExec.java
注:本文中的org.apache.http.client.protocol.RequestClientConnControl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论