Java 类com.amazonaws.PredefinedClientConfigurations 实例源码

项目:kafka-connect-storage-cloud    文件:S3Storage.java   
public ClientConfiguration newClientConfiguration(S3SinkConnectorConfig config) {
  String version = String.format(VERSION_FORMAT, Version.getVersion());

  ClientConfiguration clientConfiguration = PredefinedClientConfigurations.defaultConfig();
  clientConfiguration.withUserAgentPrefix(version);
  if (StringUtils.isNotBlank(config.getString(S3_PROXY_URL_CONFIG))) {
    S3ProxyConfig proxyConfig = new S3ProxyConfig(config);
    clientConfiguration.withProtocol(proxyConfig.protocol())
        .withProxyHost(proxyConfig.host())
        .withProxyPort(proxyConfig.port())
        .withProxyUsername(proxyConfig.user())
        .withProxyPassword(proxyConfig.pass());
  }

  return clientConfiguration;
}
项目:ibm-cos-sdk-java    文件:AwsClientBuilderTest.java   
@Test
public void defaultClientConfigAndNoExplicitExecutor_UsesDefaultExecutorBasedOnMaxConns() {
    ExecutorService executor = builderWithRegion().build().getAsyncParams().getExecutor();
    assertThat(executor, instanceOf(ThreadPoolExecutor.class));
    assertEquals(PredefinedClientConfigurations.defaultConfig().getMaxConnections(),
                 ((ThreadPoolExecutor) executor).getMaximumPoolSize());
}
项目:mot-public-api    文件:Decrypt.java   
private AWSKMS getClient() throws IOException {

        AWSKMSClientBuilder clientBuilder = AWSKMSClientBuilder.standard();

        ClientConfiguration clientConfig = PredefinedClientConfigurations.defaultConfig();

        String proxyHost = ConfigManager.getEnvironmentVariable(ConfigKeys.ProxyHost);
        if (proxyHost != null) {
            clientConfig.setProxyHost(proxyHost);
            clientConfig.setProxyPort(Integer.parseInt(ConfigManager.getEnvironmentVariable(ConfigKeys.ProxyPort)));
        }
        clientBuilder.setClientConfiguration(clientConfig);

        return clientBuilder.build();
    }