当前位置: 首页>>代码示例>>Java>>正文


Java ServiceUnavailableRetryStrategy类代码示例

本文整理汇总了Java中org.apache.http.client.ServiceUnavailableRetryStrategy的典型用法代码示例。如果您正苦于以下问题:Java ServiceUnavailableRetryStrategy类的具体用法?Java ServiceUnavailableRetryStrategy怎么用?Java ServiceUnavailableRetryStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServiceUnavailableRetryStrategy类属于org.apache.http.client包,在下文中一共展示了ServiceUnavailableRetryStrategy类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AutoRetryHttpClient

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
public AutoRetryHttpClient(
        final HttpClient client, final ServiceUnavailableRetryStrategy retryStrategy) {
    super();
    if (client == null) {
        throw new IllegalArgumentException("HttpClient may not be null");
    }
    if (retryStrategy == null) {
        throw new IllegalArgumentException(
                "ServiceUnavailableRetryStrategy may not be null");
    }
    this.backend = client;
    this.retryStrategy = retryStrategy;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:AutoRetryHttpClient.java

示例2: ServiceUnavailableRetryExec

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
public ServiceUnavailableRetryExec(
        final ClientExecChain requestExecutor,
        final ServiceUnavailableRetryStrategy retryStrategy) {
    super();
    Args.notNull(requestExecutor, "HTTP request executor");
    Args.notNull(retryStrategy, "Retry strategy");
    this.requestExecutor = requestExecutor;
    this.retryStrategy = retryStrategy;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:10,代码来源:ServiceUnavailableRetryExec.java

示例3: AutoRetryHttpClient

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
public AutoRetryHttpClient(
        final HttpClient client, final ServiceUnavailableRetryStrategy retryStrategy) {
    super();
    Args.notNull(client, "HttpClient");
    Args.notNull(retryStrategy, "ServiceUnavailableRetryStrategy");
    this.backend = client;
    this.retryStrategy = retryStrategy;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:9,代码来源:AutoRetryHttpClient.java

示例4: getHttpClientBuilder

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
public static HttpClientBuilder getHttpClientBuilder(final String charset, String proxyIp,
        int proxyPort) {

    HttpClientBuilder builder = HttpClients.custom();

    Charset chartset = charset == null ? Charset.forName(CHARSET_UTF8)
            : Charset.forName(charset);
    ConnectionConfig.Builder connBuilder = ConnectionConfig.custom().setCharset(chartset);

    RequestConfig.Builder reqBuilder = RequestConfig.custom();
    reqBuilder.setExpectContinueEnabled(false);
    reqBuilder.setSocketTimeout(10 * 60 * 1000);
    reqBuilder.setConnectTimeout(10 * 60 * 1000);
    reqBuilder.setMaxRedirects(10);

    if (StringUtils.isNotBlank(proxyIp) && proxyPort > 0) {
        logger.info("using proxy {}:{} to request ", proxyIp, String.valueOf(proxyPort));
        HttpHost proxy = new HttpHost(proxyIp, proxyPort);
        reqBuilder.setProxy(proxy);
    }

    ServiceUnavailableRetryStrategy serviceUnavailableRetryStrategy = new DefaultServiceUnavailableRetryStrategy(
            3, 3000);
    builder.setServiceUnavailableRetryStrategy(serviceUnavailableRetryStrategy);
    // 模拟浏览器,解决一些服务器程序只允许浏览器访问的问题
    builder.setUserAgent(
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0");

    builder.setDefaultRequestConfig(reqBuilder.build());
    builder.setDefaultConnectionConfig(connBuilder.build());
    builder.setConnectionManager(getConnectionManager());

    // HostnameVerifier allowAllHostnameVerifier =
    // NoopHostnameVerifier.INSTANCE;
    // builder.setSSLHostnameVerifier(allowAllHostnameVerifier);

    return builder;

}
 
开发者ID:jiucai,项目名称:appframework,代码行数:40,代码来源:HttpClientUtil.java

示例5: getServiceUnavailableRetryStrategy

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
public ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
    return this.serviceUnavailableRetryStrategy;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:4,代码来源:SimpleHttpClientFactoryBean.java

示例6: setServiceUnavailableRetryStrategy

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
public void setServiceUnavailableRetryStrategy(final ServiceUnavailableRetryStrategy serviceUnavailableRetryStrategy) {
    this.serviceUnavailableRetryStrategy = serviceUnavailableRetryStrategy;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:4,代码来源:SimpleHttpClientFactoryBean.java

示例7: setServiceUnavailableRetryStrategy

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
/**
 * Assigns {@link ServiceUnavailableRetryStrategy} instance.
 */
public final HttpClientBuilder setServiceUnavailableRetryStrategy(
        final ServiceUnavailableRetryStrategy serviceUnavailStrategy) {
    this.serviceUnavailStrategy = serviceUnavailStrategy;
    return this;
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:9,代码来源:HttpClientBuilder.java

示例8: getServiceUnavailableRetryStrategy

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
@Override
protected ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
	return new OctaneUnauthorizedRetryStrategy();
}
 
开发者ID:fod-dev,项目名称:FoDBugTrackerUtility,代码行数:5,代码来源:OctaneAuthenticatingRestConnection.java

示例9: getServiceUnavailableRetryStrategy

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
@Override
protected ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
	return new TooManyRequestsRetryStrategy("X-Rate-Limit-Reset");
}
 
开发者ID:fod-dev,项目名称:FoDBugTrackerUtility,代码行数:5,代码来源:FoDBasicRestConnection.java

示例10: getServiceUnavailableRetryStrategy

import org.apache.http.client.ServiceUnavailableRetryStrategy; //导入依赖的package包/类
protected ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
	return null;
}
 
开发者ID:fod-dev,项目名称:FoDBugTrackerUtility,代码行数:4,代码来源:RestConnection.java


注:本文中的org.apache.http.client.ServiceUnavailableRetryStrategy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。