本文整理汇总了Java中com.amazonaws.regions.AwsRegionProvider类的典型用法代码示例。如果您正苦于以下问题:Java AwsRegionProvider类的具体用法?Java AwsRegionProvider怎么用?Java AwsRegionProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AwsRegionProvider类属于com.amazonaws.regions包,在下文中一共展示了AwsRegionProvider类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: awsRegion
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@Bean
public Region awsRegion() {
Region region;
if(regionString != null && !regionString.isEmpty()) {
region = RegionUtils.getRegion(regionString);
} else {
AwsRegionProvider regionProvider = new DefaultAwsRegionProviderChain();
region = RegionUtils.getRegion(regionProvider.getRegion());
}
if(region == null) {
throw new BeanInitializationException("Unable to determine AWS region");
}
return region;
}
示例2: createFacade
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
public AwsFacade createFacade() throws MissingArgumentException, CfnAssistException, InterruptedException {
if (awsFacade==null) {
init();
SNSEventSource eventSource = new SNSEventSource(snsClient, sqsClient);
MonitorStackEvents monitor;
if (snsMonitoring) {
monitor = new SNSMonitor(eventSource, cfnRepository);
} else {
monitor = new PollingStackMonitor(cfnRepository);
}
monitor.init();
AwsRegionProvider regionProvider = new DefaultAwsRegionProviderChain();
awsFacade = new AwsFacade(monitor, cfnRepository, vpcRepository, elbRepository,
cloudRepository, notificationSender, identityProvider);
}
return awsFacade;
}
示例3: noRegionProvidedExplicitlyOrImplicitly_ThrowsException
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
/**
* If no region is explicitly given and no region can be found from the {@link
* AwsRegionProvider} implementation then the builder should fail to build clients. We mock the
* provider to yield consistent results for the tests.
*/
@Test(expected = AmazonClientException.class)
public void noRegionProvidedExplicitlyOrImplicitly_ThrowsException() {
AwsRegionProvider mockRegionProvider = mock(AwsRegionProvider.class);
when(mockRegionProvider.getRegion()).thenReturn(null);
new ConcreteAsyncBuilder(mockRegionProvider).build();
}
示例4: regionImplicitlyProvided_UsesRegionToConstructEndpoint
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
/**
* Customers may not need to explicitly configure a builder with a region if one can be found
* from the {@link AwsRegionProvider} implementation. We mock the provider to yield consistent
* results for the tests.
*/
@Test
public void regionImplicitlyProvided_UsesRegionToConstructEndpoint() {
AwsRegionProvider mockRegionProvider = mock(AwsRegionProvider.class);
when(mockRegionProvider.getRegion()).thenReturn("ap-southeast-2");
final URI actualUri = new ConcreteAsyncBuilder(mockRegionProvider).build().getEndpoint();
assertEquals(URI.create("https://mockprefix.ap-southeast-2.amazonaws.com"), actualUri);
}
示例5: AmazonS3Builder
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@SdkTestInternalApi
AmazonS3Builder(SdkFunction<AmazonS3ClientParamsWrapper, AmazonS3> clientFactory,
ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
super(clientConfigFactory, regionProvider);
this.clientFactory = clientFactory;
}
示例6: createProviders
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
private void createProviders() {
loadBalancerClient = new LoadBalancerClient(elbClient);
AwsRegionProvider regionProvider = new DefaultAwsRegionProviderChain();
cloudClient = new CloudClient(ec2Client, regionProvider);
formationClient = new CloudFormationClient(cfnClient);
datastoreClient = new RDSClient(rdsClient);
notificationSender = new SNSNotificationSender(snsClient);
identityProvider = new IdentityProvider(iamClient);
}
示例7: AwsSyncClientBuilder
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@SdkTestInternalApi
protected AwsSyncClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
super(clientConfigFactory, regionProvider);
}
示例8: AwsAsyncClientBuilder
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@SdkTestInternalApi
protected AwsAsyncClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
super(clientConfigFactory, regionProvider);
}
示例9: AwsClientBuilder
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@SdkTestInternalApi
protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
this.clientConfigFactory = clientConfigFactory;
this.regionProvider = regionProvider;
}
示例10: ConcreteAsyncBuilder
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
private ConcreteAsyncBuilder(AwsRegionProvider mockRegionProvider) {
super(new MockClientConfigurationFactory(), mockRegionProvider);
}
示例11: AmazonS3ClientBuilder
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@SdkTestInternalApi
AmazonS3ClientBuilder(SdkFunction<AmazonS3ClientParamsWrapper, AmazonS3> clientFactory,
ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
super(clientFactory, clientConfigFactory, regionProvider);
}
示例12: CloudClient
import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
public CloudClient(AmazonEC2 ec2Client, AwsRegionProvider regionProvider) {
this.ec2Client = ec2Client;
this.regionProvider = regionProvider;
}