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


Java JerseyClientConfiguration.setConnectionRequestTimeout方法代码示例

本文整理汇总了Java中io.dropwizard.client.JerseyClientConfiguration.setConnectionRequestTimeout方法的典型用法代码示例。如果您正苦于以下问题:Java JerseyClientConfiguration.setConnectionRequestTimeout方法的具体用法?Java JerseyClientConfiguration.setConnectionRequestTimeout怎么用?Java JerseyClientConfiguration.setConnectionRequestTimeout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.dropwizard.client.JerseyClientConfiguration的用法示例。


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

示例1: getNewSecureClient

import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
protected Client getNewSecureClient(String keyStoreResourcePath) throws Exception {
    TlsConfiguration tlsConfiguration = new TlsConfiguration();
    tlsConfiguration.setKeyStorePath(new File(resourceFilePath(keyStoreResourcePath)));
    tlsConfiguration.setKeyStorePassword("notsecret");

    tlsConfiguration.setTrustStorePath(new File(resourceFilePath("tls/test-truststore.jks")));
    tlsConfiguration.setTrustStorePassword("notsecret");

    tlsConfiguration.setVerifyHostname(false);

    tlsConfiguration.setSupportedCiphers(Lists.newArrayList("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"));
    tlsConfiguration.setSupportedProtocols(Lists.newArrayList("TLSv1.2"));

    JerseyClientConfiguration configuration = new JerseyClientConfiguration();
    configuration.setTlsConfiguration(tlsConfiguration);
    configuration.setTimeout(Duration.seconds(30));
    configuration.setConnectionTimeout(Duration.seconds(30));
    configuration.setConnectionRequestTimeout(Duration.seconds(30));

    return new JerseyClientBuilder(USER_INFO_APP_RULE.getEnvironment())
            .using(configuration)
            .build(UUID.randomUUID().toString());
}
 
开发者ID:wdawson,项目名称:dropwizard-auth-example,代码行数:24,代码来源:IntegrationTest.java

示例2: createClient

import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
@Before
public void createClient() {
    final JerseyClientConfiguration configuration = new JerseyClientConfiguration();
    configuration.setTimeout(Duration.minutes(1L));
    configuration.setConnectionTimeout(Duration.minutes(1L));
    configuration.setConnectionRequestTimeout(Duration.minutes(1L));
    this.client = new JerseyClientBuilder(this.RULE.getEnvironment()).using(configuration)
            .build("test client");

    assertThat(this.client
            .target(String.format(CREDENTIAL_END_POINT, this.RULE.getLocalPort()))
            .request()
            .header(X_AUTH_RSA_HEADER, BASE_64_PUBLIC_KEY)
            .post(Entity.json(this.credential)).getStatus())
                    .isEqualTo(Status.CREATED.getStatusCode());
}
 
开发者ID:mtakaki,项目名称:CredentialStorageService,代码行数:17,代码来源:CredentialStorageApplicationTest.java

示例3: setupClass

import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
@BeforeClass
    public static void setupClass() {
        // We need to enable typing otherwise abstract types, e.g. ExpressionItem, won't be deserialisable.
        RULE.getEnvironment().getObjectMapper().enableDefaultTyping();
        app = RULE.getApplication();
        JerseyClientConfiguration clientConfiguration = new JerseyClientConfiguration();
        clientConfiguration.setConnectionRequestTimeout(io.dropwizard.util.Duration.seconds(10));
        clientConfiguration.setConnectionTimeout(io.dropwizard.util.Duration.seconds(10));
        clientConfiguration.setTimeout(Duration.seconds(10));
        client = new JerseyClientBuilder(RULE.getEnvironment())
                .using(clientConfiguration)
                .build("test client");
        APPLICATION_PORT = RULE.getLocalPort();
        ADMIN_PORT = RULE.getAdminPort();

//        STATISTICS_URL = String.format("http://localhost:%d/statistics", APPLICATION_PORT);
        QUERY_SEARCH_URL = String.format("http://localhost:%d" +
                ResourcePaths.ROOT_PATH +
                ResourcePaths.STROOM_STATS +
                ResourcePaths.V2 +
                QueryResource.SEARCH_ENDPOINT, APPLICATION_PORT);

        BASE_TASKS_URL = String.format("http://localhost:%d/tasks/", ADMIN_PORT);
        HEALTH_CHECKS_URL = String.format("http://localhost:%d/admin/healthcheck?pretty=true", ADMIN_PORT);
        START_PROCESSING_URL = BASE_TASKS_URL + "startProcessing";
        STOP_PROCESSING_URL = BASE_TASKS_URL + "stopProcessing";

        LOGGER.info("Query url:            {}", QUERY_SEARCH_URL);
        LOGGER.info("Health checks url:    {}", HEALTH_CHECKS_URL);
        LOGGER.info("Start processing url: {}, e.g. curl -X POST {}", START_PROCESSING_URL, START_PROCESSING_URL);
        LOGGER.info("Stop processing url:  {}, e.g. curl -X POST {}", STOP_PROCESSING_URL, STOP_PROCESSING_URL);
    }
 
开发者ID:gchq,项目名称:stroom-stats,代码行数:33,代码来源:AbstractAppIT.java

示例4: createClient

import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
@Before
public void createClient() {
    final JerseyClientConfiguration configuration = new JerseyClientConfiguration();
    configuration.setTimeout(Duration.minutes(1L));
    configuration.setConnectionTimeout(Duration.minutes(1L));
    configuration.setConnectionRequestTimeout(Duration.minutes(1L));
    this.client = new JerseyClientBuilder(this.RULE.getEnvironment()).using(configuration)
            .build("test client");
}
 
开发者ID:mtakaki,项目名称:dropwizard-hikaricp,代码行数:10,代码来源:ManagedPooledDataSourceTest.java

示例5: setupClient

import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
@Before
public void setupClient() {
    final JerseyClientConfiguration jerseyClientConfiguration = new JerseyClientConfiguration();
    jerseyClientConfiguration.setConnectionTimeout(Duration.minutes(1L));
    jerseyClientConfiguration.setConnectionRequestTimeout(Duration.minutes(1L));
    jerseyClientConfiguration.setTimeout(Duration.minutes(1L));
    client = new JerseyClientBuilder(this.RULE.getEnvironment())
            .using(jerseyClientConfiguration)
            .withProperty(ClientProperties.FOLLOW_REDIRECTS, Boolean.FALSE)
            .build("test client");
}
 
开发者ID:mtakaki,项目名称:dropwizard-circuitbreaker,代码行数:12,代码来源:CircuitBreakerBundleIntegrationTest.java


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