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


Java AwsRegionProvider类代码示例

本文整理汇总了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;
}
 
开发者ID:shinesolutions,项目名称:aem-orchestrator,代码行数:17,代码来源:AwsConfig.java

示例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;	
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:19,代码来源:FacadeFactory.java

示例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();
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:12,代码来源:AwsClientBuilderTest.java

示例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);
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:13,代码来源:AwsClientBuilderTest.java

示例5: AmazonS3Builder

import com.amazonaws.regions.AwsRegionProvider; //导入依赖的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

示例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);
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:10,代码来源:FacadeFactory.java

示例7: AwsSyncClientBuilder

import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@SdkTestInternalApi
protected AwsSyncClientBuilder(ClientConfigurationFactory clientConfigFactory,
                               AwsRegionProvider regionProvider) {
    super(clientConfigFactory, regionProvider);
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:6,代码来源:AwsSyncClientBuilder.java

示例8: AwsAsyncClientBuilder

import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@SdkTestInternalApi
protected AwsAsyncClientBuilder(ClientConfigurationFactory clientConfigFactory,
                                AwsRegionProvider regionProvider) {
    super(clientConfigFactory, regionProvider);
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:6,代码来源:AwsAsyncClientBuilder.java

示例9: AwsClientBuilder

import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@SdkTestInternalApi
protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
                           AwsRegionProvider regionProvider) {
    this.clientConfigFactory = clientConfigFactory;
    this.regionProvider = regionProvider;
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:7,代码来源:AwsClientBuilder.java

示例10: ConcreteAsyncBuilder

import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
private ConcreteAsyncBuilder(AwsRegionProvider mockRegionProvider) {
    super(new MockClientConfigurationFactory(), mockRegionProvider);
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:4,代码来源:AwsClientBuilderTest.java

示例11: AmazonS3ClientBuilder

import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
@SdkTestInternalApi
AmazonS3ClientBuilder(SdkFunction<AmazonS3ClientParamsWrapper, AmazonS3> clientFactory,
                      ClientConfigurationFactory clientConfigFactory,
                      AwsRegionProvider regionProvider) {
    super(clientFactory, clientConfigFactory, regionProvider);
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:7,代码来源:AmazonS3ClientBuilder.java

示例12: CloudClient

import com.amazonaws.regions.AwsRegionProvider; //导入依赖的package包/类
public CloudClient(AmazonEC2 ec2Client, AwsRegionProvider regionProvider) {
    this.ec2Client = ec2Client;
    this.regionProvider = regionProvider;
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:5,代码来源:CloudClient.java


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