Java 类org.apache.http.client.ServiceUnavailableRetryStrategy 实例源码

项目:lams    文件:AutoRetryHttpClient.java   
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;
}
项目:remote-files-sync    文件:ServiceUnavailableRetryExec.java   
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;
}
项目:purecloud-iot    文件:AutoRetryHttpClient.java   
public AutoRetryHttpClient(
        final HttpClient client, final ServiceUnavailableRetryStrategy retryStrategy) {
    super();
    Args.notNull(client, "HttpClient");
    Args.notNull(retryStrategy, "ServiceUnavailableRetryStrategy");
    this.backend = client;
    this.retryStrategy = retryStrategy;
}
项目:purecloud-iot    文件:ServiceUnavailableRetryExec.java   
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;
}
项目:Visit    文件:ServiceUnavailableRetryExec.java   
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;
}
项目:ZTLib    文件:ServiceUnavailableRetryExec.java   
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;
}
项目:appframework    文件:HttpClientUtil.java   
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;

}
项目:springboot-shiro-cas-mybatis    文件:SimpleHttpClientFactoryBean.java   
public ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
    return this.serviceUnavailableRetryStrategy;
}
项目:springboot-shiro-cas-mybatis    文件:SimpleHttpClientFactoryBean.java   
public void setServiceUnavailableRetryStrategy(final ServiceUnavailableRetryStrategy serviceUnavailableRetryStrategy) {
    this.serviceUnavailableRetryStrategy = serviceUnavailableRetryStrategy;
}
项目:springboot-shiro-cas-mybatis    文件:SimpleHttpClientFactoryBean.java   
public ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
    return this.serviceUnavailableRetryStrategy;
}
项目:springboot-shiro-cas-mybatis    文件:SimpleHttpClientFactoryBean.java   
public void setServiceUnavailableRetryStrategy(final ServiceUnavailableRetryStrategy serviceUnavailableRetryStrategy) {
    this.serviceUnavailableRetryStrategy = serviceUnavailableRetryStrategy;
}
项目:cas-5.1.0    文件:SimpleHttpClientFactoryBean.java   
public ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
    return this.serviceUnavailableRetryStrategy;
}
项目:cas-5.1.0    文件:SimpleHttpClientFactoryBean.java   
public void setServiceUnavailableRetryStrategy(final ServiceUnavailableRetryStrategy serviceUnavailableRetryStrategy) {
    this.serviceUnavailableRetryStrategy = serviceUnavailableRetryStrategy;
}
项目:cas-server-4.2.1    文件:SimpleHttpClientFactoryBean.java   
public ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
    return this.serviceUnavailableRetryStrategy;
}
项目:cas-server-4.2.1    文件:SimpleHttpClientFactoryBean.java   
public void setServiceUnavailableRetryStrategy(final ServiceUnavailableRetryStrategy serviceUnavailableRetryStrategy) {
    this.serviceUnavailableRetryStrategy = serviceUnavailableRetryStrategy;
}
项目:remote-files-sync    文件:HttpClientBuilder.java   
/**
 * Assigns {@link ServiceUnavailableRetryStrategy} instance.
 */
public final HttpClientBuilder setServiceUnavailableRetryStrategy(
        final ServiceUnavailableRetryStrategy serviceUnavailStrategy) {
    this.serviceUnavailStrategy = serviceUnavailStrategy;
    return this;
}
项目:FoDBugTrackerUtility    文件:OctaneAuthenticatingRestConnection.java   
@Override
protected ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
    return new OctaneUnauthorizedRetryStrategy();
}
项目:FoDBugTrackerUtility    文件:FoDBasicRestConnection.java   
@Override
protected ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
    return new TooManyRequestsRetryStrategy("X-Rate-Limit-Reset");
}
项目:FoDBugTrackerUtility    文件:RestConnection.java   
protected ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
    return null;
}
项目:cas4.1.9    文件:SimpleHttpClientFactoryBean.java   
public ServiceUnavailableRetryStrategy getServiceUnavailableRetryStrategy() {
    return this.serviceUnavailableRetryStrategy;
}
项目:cas4.1.9    文件:SimpleHttpClientFactoryBean.java   
public void setServiceUnavailableRetryStrategy(final ServiceUnavailableRetryStrategy serviceUnavailableRetryStrategy) {
    this.serviceUnavailableRetryStrategy = serviceUnavailableRetryStrategy;
}
项目:purecloud-iot    文件:HttpClientBuilder.java   
/**
 * Assigns {@link ServiceUnavailableRetryStrategy} instance.
 */
public final HttpClientBuilder setServiceUnavailableRetryStrategy(
        final ServiceUnavailableRetryStrategy serviceUnavailStrategy) {
    this.serviceUnavailStrategy = serviceUnavailStrategy;
    return this;
}
项目:Visit    文件:HttpClientBuilder.java   
/**
 * Assigns {@link ServiceUnavailableRetryStrategy} instance.
 */
public final HttpClientBuilder setServiceUnavailableRetryStrategy(
        final ServiceUnavailableRetryStrategy serviceUnavailStrategy) {
    this.serviceUnavailStrategy = serviceUnavailStrategy;
    return this;
}
项目:ZTLib    文件:HttpClientBuilder.java   
/**
 * Assigns {@link ServiceUnavailableRetryStrategy} instance.
 */
public final HttpClientBuilder setServiceUnavailableRetryStrategy(
        final ServiceUnavailableRetryStrategy serviceUnavailStrategy) {
    this.serviceUnavailStrategy = serviceUnavailStrategy;
    return this;
}
项目:lams    文件:AutoRetryHttpClient.java   
/**
 * Constructs a {@code AutoRetryHttpClient} with the given caching options that
 * stores cache entries in memory and uses a vanilla
 * {@link DefaultHttpClient} for backend requests.
 *
 * @param config
 *            retry configuration module options
 */
public AutoRetryHttpClient(ServiceUnavailableRetryStrategy config) {
    this(new DefaultHttpClient(), config);
}
项目:purecloud-iot    文件:AutoRetryHttpClient.java   
/**
 * Constructs a {@code AutoRetryHttpClient} with the given caching options that
 * stores cache entries in memory and uses a vanilla
 * {@link DefaultHttpClient} for backend requests.
 *
 * @param config
 *            retry configuration module options
 */
public AutoRetryHttpClient(final ServiceUnavailableRetryStrategy config) {
    this(new DefaultHttpClient(), config);
}