public class EndpointToRegion extends Object
AwsHostNameUtils.parseRegion(String, String)
, this also considers the contents of endpoints.json, and unlike
RegionMetadata.getRegionByEndpoint(String)
, this considers common endpoint patterns and supports more than just the
"known" regions, like the legacy XML file would.Constructor and Description |
---|
EndpointToRegion() |
Modifier and Type | Method and Description |
---|---|
static Region |
guessRegionForEndpoint(String hostname)
Attempt to convert the provided hostname into a region, returning null if the conversion fails.
|
static Region |
guessRegionForEndpoint(String endpoint,
String serviceHint)
Attempt to convert the provided hostname and service hint into a region, returning null if the conversion fails.
|
static String |
guessRegionNameForEndpoint(String hostname)
Attempt to convert the provided hostname into a region name, returning null if the conversion fails.
|
static String |
guessRegionNameForEndpoint(String endpoint,
String serviceHint)
Attempt to convert the provided hostname and service hint into a region name, returning null if the conversion fails.
|
static String |
guessRegionNameForEndpointWithDefault(String hostname,
String serviceHint,
String defaultRegion)
Attempt to convert the provided hostname and service hint into a region name, returning null if the conversion fails.
|
public static String guessRegionNameForEndpoint(String hostname)
public static String guessRegionNameForEndpoint(String endpoint, String serviceHint)
public static String guessRegionNameForEndpointWithDefault(String hostname, String serviceHint, String defaultRegion)
public static Region guessRegionForEndpoint(String hostname)