com.amazonaws.regions.Region.getAvailableEndpoints()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中com.amazonaws.regions.Region.getAvailableEndpoints方法的一些代码示例,展示了Region.getAvailableEndpoints的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Region.getAvailableEndpoints方法的具体详情如下:
包路径:com.amazonaws.regions.Region
类名称:Region
方法名:getAvailableEndpoints

Region.getAvailableEndpoints介绍

[英]Returns a immutable collection of all endpoints available in the metadata.
[中]返回元数据中所有可用端点的不可变集合。

代码示例

代码示例来源:origin: aws/aws-sdk-java

@Override
public Region getRegionByEndpoint(String endpoint) {
  String host = getHost(endpoint);
  for (Region region : getRegions()) {
    for (String serviceEndpoint :
        region.getAvailableEndpoints()) {
      if (host.equals(getHost(serviceEndpoint))) {
        return region;
      }
    }
  }
  throw new IllegalArgumentException(
      "No region found with any service for endpoint " + endpoint);
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-core

@Override
public Region getRegionByEndpoint(String endpoint) {
  String host = getHost(endpoint);
  for (Region region : getRegions()) {
    for (String serviceEndpoint :
        region.getAvailableEndpoints()) {
      if (host.equals(getHost(serviceEndpoint))) {
        return region;
      }
    }
  }
  throw new IllegalArgumentException(
      "No region found with any service for endpoint " + endpoint);
}

代码示例来源:origin: Nextdoor/bender

@Override
public Region getRegionByEndpoint(String endpoint) {
  String host = getHost(endpoint);
  for (Region region : getRegions()) {
    for (String serviceEndpoint :
        region.getAvailableEndpoints()) {
      if (host.equals(getHost(serviceEndpoint))) {
        return region;
      }
    }
  }
  throw new IllegalArgumentException(
      "No region found with any service for endpoint " + endpoint);
}

相关文章