@Test public void testParseRegionWithStandardEndpointsWithServiceHint() { assertEquals("us-east-1", AwsHostNameUtils.parseRegion("iam.amazonaws.com", "iam")); assertEquals("us-west-2", AwsHostNameUtils.parseRegion("iam.us-west-2.amazonaws.com", "iam")); assertEquals("us-west-2", AwsHostNameUtils.parseRegion("ec2.us-west-2.amazonaws.com", "ec2")); assertEquals("us-east-1", AwsHostNameUtils.parseRegion("s3.amazonaws.com", "s3")); assertEquals("us-east-1", AwsHostNameUtils.parseRegion("bucket.name.s3.amazonaws.com", "s3")); assertEquals("eu-west-1", AwsHostNameUtils.parseRegion("s3-eu-west-1.amazonaws.com", "s3")); assertEquals("eu-west-1", AwsHostNameUtils.parseRegion("s3.eu-west-1.amazonaws.com", "s3")); assertEquals("eu-west-1", AwsHostNameUtils.parseRegion("bucket.name.with.periods.s3-eu-west-1.amazonaws.com", "s3")); assertEquals("eu-west-1", AwsHostNameUtils.parseRegion("bucket.name.with.periods.s3.eu-west-1.amazonaws.com", "s3")); assertEquals("us-west-2", AwsHostNameUtils.parseRegion("cloudsearch.us-west-2.amazonaws.com", "cloudsearch")); assertEquals("us-west-2", AwsHostNameUtils.parseRegion("domain.us-west-2.cloudsearch.amazonaws.com", "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();  }