@Test public void testParseRegionWithBJSEndpoints() { assertEquals("cn-north-1", AwsHostNameUtils.parseRegion("iam.cn-north-1.amazonaws.com.cn", "iam")); assertEquals("cn-north-1", AwsHostNameUtils.parseRegion("ec2.cn-north-1.amazonaws.com.cn", "ec2")); assertEquals("cn-north-1", AwsHostNameUtils.parseRegion("s3.cn-north-1.amazonaws.com.cn", "s3")); assertEquals("cn-north-1", AwsHostNameUtils.parseRegion("bucket.name.with.periods.s3.cn-north-1.amazonaws.com.cn", "s3")); assertEquals("cn-north-1", AwsHostNameUtils.parseRegion("cloudsearch.cn-north-1.amazonaws.com.cn", "cloudsearch")); assertEquals("cn-north-1", AwsHostNameUtils.parseRegion("domain.cn-north-1.cloudsearch.amazonaws.com.cn", "cloudsearch")); }
public static String parseRegion(String host, String serviceHint) { String result; result = parseRegionFromInternalConfig(host); if (result != null) { return result; } result = parseRegionFromAwsPartitionPattern(host); if (result != null) { return result; } result = parseRegionUsingServiceHint(host, serviceHint); if (result != null) { return result; } result = parseRegionFromAfterServiceName(host, serviceHint); return result; }
AwsHostNameUtils { public static String parseRegion(String host, String serviceHint) { String result; result = parseRegionFromInternalConfig(host); if (result != null) { return result; } result = parseRegionFromAwsPartitionPattern(host); if (result != null) { return result; } result = parseRegionUsingServiceHint(host, serviceHint); if (result != null) { return result; } result = parseRegionFromAfterServiceName(host, serviceHint); return result; } }
AwsHostNameUtils { public static String parseRegion(String host, String serviceHint) { String result; result = parseRegionFromInternalConfig(host); if (result != null) { return result; } result = parseRegionFromAwsPartitionPattern(host); if (result != null) { return result; } result = parseRegionUsingServiceHint(host, serviceHint); if (result != null) { return result; } result = parseRegionFromAfterServiceName(host, serviceHint); return result; }  }
AwsHostNameUtils { public static String parseRegion(String host, String serviceHint) { String result; result = parseRegionFromInternalConfig(host); if (result != null) { return result; } result = parseRegionFromAwsPartitionPattern(host); if (result != null) { return result; } result = parseRegionUsingServiceHint(host, serviceHint); if (result != null) { return result; } result = parseRegionFromAfterServiceName(host, serviceHint); return result; }  @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host,
                                         final String serviceHint); static String parseRegion(String host, String serviceHint); @SdkProtectedApi static String parseRegionFromInternalConfig(String host); @SdkProtectedApi static String parseRegionFromAwsPartitionPattern(String host); @SdkProtectedApi static String parseRegionUsingServiceHint(String host, String serviceHint); static String parseRegionFromAfterServiceName(String host, String serviceHint); @Deprecated static String parseServiceName(URI endpoint); static String localHostName(); }
AwsHostNameUtils { public static String parseRegion(String host, String serviceHint) { String result; result = parseRegionFromInternalConfig(host); if (result != null) { return result; } result = parseRegionFromAwsPartitionPattern(host); if (result != null) { return result; } result = parseRegionUsingServiceHint(host, serviceHint); if (result != null) { return result; } result = parseRegionFromAfterServiceName(host, serviceHint); return result; }  @Deprecated static String parseRegionName(URI endpoint); @Deprecated static String parseRegionName(final String host,
                                         final String serviceHint); static String parseRegion(String host, String serviceHint); @SdkProtectedApi static String parseRegionFromInternalConfig(String host); @SdkProtectedApi static String parseRegionFromAwsPartitionPattern(String host); @SdkProtectedApi static String parseRegionUsingServiceHint(String host, String serviceHint); static String parseRegionFromAfterServiceName(String host, String serviceHint); @Deprecated static String parseServiceName(URI endpoint); static String localHostName();  }