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


Java Regions.fromName方法代码示例

本文整理汇总了Java中com.amazonaws.regions.Regions.fromName方法的典型用法代码示例。如果您正苦于以下问题:Java Regions.fromName方法的具体用法?Java Regions.fromName怎么用?Java Regions.fromName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.regions.Regions的用法示例。


在下文中一共展示了Regions.fromName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateRegion

import com.amazonaws.regions.Regions; //导入方法依赖的package包/类
private void validateRegion(
        final String region) {

    assertArgumentNotNull(
            REGION, 
            region);

    try {
        Regions.fromName(region);
        
    } catch (IllegalArgumentException illegalArgumentException) {
        throw new IllegalArgumentException(
                String.format(
                        INVALID_REGION_PATTERN, 
                        region), 
                illegalArgumentException);
    } 
}
 
开发者ID:eonian-technologies,项目名称:secrets-locker,代码行数:19,代码来源:KmsEncryptionService.java

示例2: initializeAwsAuthorizationData

import com.amazonaws.regions.Regions; //导入方法依赖的package包/类
private void initializeAwsAuthorizationData(String region) throws SdkClientException {
  final Regions awsRegion = Regions.fromName(region);
  AmazonECR ecr = AmazonECRClientBuilder.standard().withRegion(awsRegion).build();

  GetAuthorizationTokenResult authTokenResult = ecr.getAuthorizationToken(
      new GetAuthorizationTokenRequest()
  );
  AuthorizationData authData = authTokenResult.getAuthorizationData().get(0);

  String[] userAuthData = StringUtils.newStringUtf8(Base64.decodeBase64(
      authData.getAuthorizationToken())
  ).split(":");
  registryUsername = userAuthData[0];
  registryPassword = userAuthData[1];
  registryUrl = authData.getProxyEndpoint();
}
 
开发者ID:tsiq,项目名称:magic-beanstalk,代码行数:17,代码来源:AwsEcrAuthData.java

示例3: cfgRegion

import com.amazonaws.regions.Regions; //导入方法依赖的package包/类
private void cfgRegion(String regionName){
    try {
    	Regions tmpRegions = Regions.fromName(regionName);
        setRegion(Region.getRegion(tmpRegions));
        setRegions(tmpRegions);
    } catch( IllegalArgumentException e ) {
        throw new IllegalArgumentException( "Unrecognized region " + regionName );  
    }
}
 
开发者ID:datamachines,项目名称:KafkaToSQS,代码行数:10,代码来源:AWSKafkaConfig.java

示例4: deserialize

import com.amazonaws.regions.Regions; //导入方法依赖的package包/类
@Override
public Regions deserialize(JsonParser parser, DeserializationContext context)
        throws IOException {
    return Regions.fromName(parser.getValueAsString());
}
 
开发者ID:schibsted,项目名称:strongbox,代码行数:6,代码来源:RegionDeserializer.java

示例5: getKmsRegion

import com.amazonaws.regions.Regions; //导入方法依赖的package包/类
/**
 * Returns the the KMS region explicitly specified for the AWS KMS client
 * when such client is internally instantiated; or null if no explicit KMS
 * region is specified. This KMS region parameter is ignored when the AWS
 * KMS client of the S3 encryption client is explicitly passed in by the
 * users, instead of being implicitly created.
 *
 * @Deprecated This method is not forward compatible. Throws
 * IllegalArguementException when a new region is encountered.
 *
 * @use {@link #getAwsKmsRegion()} instead
 */
@Deprecated
public Regions getKmsRegion() {
    if (awskmsRegion == null) return null;
    return Regions.fromName(awskmsRegion.getName());
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:CryptoConfiguration.java


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