本文整理汇总了Java中com.amazonaws.ClientConfigurationFactory类的典型用法代码示例。如果您正苦于以下问题:Java ClientConfigurationFactory类的具体用法?Java ClientConfigurationFactory怎么用?Java ClientConfigurationFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientConfigurationFactory类属于com.amazonaws包,在下文中一共展示了ClientConfigurationFactory类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createKinesisClient
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
/**
* Creates an AmazonKinesis client.
* @param configProps configuration properties containing the access key, secret key, and region
* @return a new AmazonKinesis client
*/
public static AmazonKinesis createKinesisClient(Properties configProps) {
// set a Flink-specific user agent
ClientConfiguration awsClientConfig = new ClientConfigurationFactory().getConfig()
.withUserAgentPrefix(String.format(USER_AGENT_FORMAT,
EnvironmentInformation.getVersion(),
EnvironmentInformation.getRevisionInformation().commitId));
// utilize automatic refreshment of credentials by directly passing the AWSCredentialsProvider
AmazonKinesisClientBuilder builder = AmazonKinesisClientBuilder.standard()
.withCredentials(AWSUtil.getCredentialsProvider(configProps))
.withClientConfiguration(awsClientConfig)
.withRegion(Regions.fromName(configProps.getProperty(AWSConfigConstants.AWS_REGION)));
if (configProps.containsKey(AWSConfigConstants.AWS_ENDPOINT)) {
// Set signingRegion as null, to facilitate mocking Kinesis for local tests
builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(
configProps.getProperty(AWSConfigConstants.AWS_ENDPOINT),
null));
}
return builder.build();
}
示例2: createKinesisClient
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
/**
* Creates an Amazon Kinesis Client.
* @param configProps configuration properties containing the access key, secret key, and region
* @return a new Amazon Kinesis Client
*/
public static AmazonKinesisClient createKinesisClient(Properties configProps) {
// set a Flink-specific user agent
ClientConfiguration awsClientConfig = new ClientConfigurationFactory().getConfig();
awsClientConfig.setUserAgent("Apache Flink " + EnvironmentInformation.getVersion() +
" (" + EnvironmentInformation.getRevisionInformation().commitId + ") Kinesis Connector");
// utilize automatic refreshment of credentials by directly passing the AWSCredentialsProvider
AmazonKinesisClient client = new AmazonKinesisClient(
AWSUtil.getCredentialsProvider(configProps), awsClientConfig);
client.setRegion(Region.getRegion(Regions.fromName(configProps.getProperty(AWSConfigConstants.AWS_REGION))));
if (configProps.containsKey(AWSConfigConstants.AWS_ENDPOINT)) {
client.setEndpoint(configProps.getProperty(AWSConfigConstants.AWS_ENDPOINT));
}
return client;
}
示例3: AmazonS3Builder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
@SdkTestInternalApi
AmazonS3Builder(SdkFunction<AmazonS3ClientParamsWrapper, AmazonS3> clientFactory,
ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
super(clientConfigFactory, regionProvider);
this.clientFactory = clientFactory;
}
示例4: getS3Client
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
/**
* Get or initialize the S3 client.
* Note: this method must be synchronized because we're accessing the
* {@link #s3Client} field and we're calling this method from a worker thread.
* @return the S3 client
*/
private synchronized AmazonS3 getS3Client() {
if (s3Client == null) {
BasicAWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
AmazonS3ClientBuilder builder = AmazonS3ClientBuilder
.standard()
.withCredentials(new AWSStaticCredentialsProvider(credentials));
if (forceSignatureV2) {
ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
ClientConfiguration config = configFactory.getConfig();
config.setSignerOverride("S3SignerType");
builder = builder.withClientConfiguration(config);
}
String endpoint = "http://" + host + ":" + port;
String clientRegion = null;
if (!ServiceUtils.isS3USStandardEndpoint(endpoint)) {
clientRegion = AwsHostNameUtils.parseRegion(host,
AmazonS3Client.S3_SERVICE_NAME);
}
builder = builder.withEndpointConfiguration(new EndpointConfiguration(
endpoint, clientRegion));
builder = builder.withPathStyleAccessEnabled(pathStyleAccess);
s3Client = builder.build();
}
return s3Client;
}
示例5: createClientConfiguration
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
/**
* Create AWS client configuration and return it.
* @return AWS client configuration
*/
private ClientConfiguration createClientConfiguration() {
ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
ClientConfiguration config = configFactory.getConfig();
String s3SignerOverride = conf.getS3SignerOverride();
if (StringUtils.isNotBlank(s3SignerOverride)) {
config.setSignerOverride(s3SignerOverride);
}
return config;
}
示例6: forAWS
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
public static ClientConfiguration forAWS(@NotNull HttpUrl proxyUrl) {
return new ClientConfigurationFactory().getConfig()
.withProxyHost(proxyUrl.host())
.withProxyPort(proxyUrl.port())
.withProxyUsername(proxyUrl.username())
.withProxyPassword(proxyUrl.password());
}
示例7: AwsSyncClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
protected AwsSyncClientBuilder(ClientConfigurationFactory clientConfigFactory) {
super(clientConfigFactory);
}
示例8: AwsAsyncClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
protected AwsAsyncClientBuilder(ClientConfigurationFactory clientConfigFactory) {
super(clientConfigFactory);
}
示例9: AwsClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory) {
this(clientConfigFactory, DEFAULT_REGION_PROVIDER);
}
示例10: AmazonS3ClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
@SdkTestInternalApi
AmazonS3ClientBuilder(SdkFunction<AmazonS3ClientParamsWrapper, AmazonS3> clientFactory,
ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
super(clientFactory, clientConfigFactory, regionProvider);
}
示例11: AmazonTestWebserviceClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
private AmazonTestWebserviceClientBuilder() {
super(new ClientConfigurationFactory());
}