public class RegionMetadata extends Object
RegionUtils
Constructor and Description |
---|
RegionMetadata(List<Region> regions)
Creates a new RegionMetadata object from the given list of regions.
|
RegionMetadata(RegionMetadataProvider provider) |
Modifier and Type | Method and Description |
---|---|
Region |
getRegion(String name)
Returns the region with the name given, if it exists.
|
Region |
getRegionByEndpoint(String endpoint)
Deprecated.
sdk no longer holds the complete endpoint for every service in the region.
It now uses the partition metadata to compute the endpoints dynamically for new regions and services.
|
List<Region> |
getRegions()
Returns an immutable list of all regions known to this region metadata
object, in no particular order.
|
List<Region> |
getRegionsForService(String service)
Returns a list of the regions that support the service given.
|
String |
toString() |
Region |
tryGetRegionByEndpointDnsSuffix(String endpoint)
Returns the region associated with the specified endpoint by searching the endpoint configuration for a partition
that matches the DNS suffix of the provided endpoint and extracting the region name based on the endpoint pattern for
that partition.
|
Region |
tryGetRegionByExplicitEndpoint(String endpoint)
Returns the region associated with the specified endpoint by searching the endpoint configuration for an endpoint
that is explicitly listed.
|
public RegionMetadata(List<Region> regions)
regions
- the list of regionspublic RegionMetadata(RegionMetadataProvider provider)
public List<Region> getRegions()
public Region getRegion(String name)
name
- the name of the region to search forpublic List<Region> getRegionsForService(String service)
service
- The service endpoint prefix which can be retrieved from the
constant ENDPOINT_PREFIX of the specific service client interface,
e.g. AmazonEC2.ENDPOINT_PREFIX.public Region tryGetRegionByExplicitEndpoint(String endpoint)
getRegionByEndpoint(String)
, this returns null on failure instead of raising an exception.endpoint
- The endpoint to look up in the region metadata.public Region tryGetRegionByEndpointDnsSuffix(String endpoint)
getRegionByEndpoint(String)
, this returns null on failure instead of raising an exception.endpoint
- The endpoint to look up in the region metadata based on the DNS suffix.@Deprecated public Region getRegionByEndpoint(String endpoint)
endpoint
- The endpoint for any service residing in the desired region.IllegalArgumentException
- If the given URL is malformed, or if the one of the service
URLs on record is malformed.Copyright © 2024. All rights reserved.