本文整理汇总了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();
}
开发者ID:axbaretto,项目名称:flink,代码行数:27,代码来源:AWSUtil.java
示例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;
}
开发者ID:axbaretto,项目名称:flink,代码行数:22,代码来源:AWSUtil.java
示例3: AmazonS3Builder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
@SdkTestInternalApi
AmazonS3Builder(SdkFunction<AmazonS3ClientParamsWrapper, AmazonS3> clientFactory,
ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
super(clientConfigFactory, regionProvider);
this.clientFactory = clientFactory;
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:8,代码来源:AmazonS3Builder.java
示例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;
}
开发者ID:georocket,项目名称:georocket,代码行数:37,代码来源:S3Store.java
示例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;
}
开发者ID:apache,项目名称:zeppelin,代码行数:16,代码来源:S3NotebookRepo.java
示例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());
}
开发者ID:Graylog2,项目名称:graylog-plugin-aws,代码行数:8,代码来源:Proxy.java
示例7: AwsSyncClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
protected AwsSyncClientBuilder(ClientConfigurationFactory clientConfigFactory) {
super(clientConfigFactory);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:4,代码来源:AwsSyncClientBuilder.java
示例8: AwsAsyncClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
protected AwsAsyncClientBuilder(ClientConfigurationFactory clientConfigFactory) {
super(clientConfigFactory);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:4,代码来源:AwsAsyncClientBuilder.java
示例9: AwsClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory) {
this(clientConfigFactory, DEFAULT_REGION_PROVIDER);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:4,代码来源:AwsClientBuilder.java
示例10: AmazonS3ClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
@SdkTestInternalApi
AmazonS3ClientBuilder(SdkFunction<AmazonS3ClientParamsWrapper, AmazonS3> clientFactory,
ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
super(clientFactory, clientConfigFactory, regionProvider);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:7,代码来源:AmazonS3ClientBuilder.java
示例11: AmazonTestWebserviceClientBuilder
import com.amazonaws.ClientConfigurationFactory; //导入依赖的package包/类
private AmazonTestWebserviceClientBuilder() {
super(new ClientConfigurationFactory());
}
开发者ID:spring-cloud,项目名称:spring-cloud-aws,代码行数:4,代码来源:AmazonTestWebserviceClientBuilder.java
注:本文中的com.amazonaws.ClientConfigurationFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论