Package com.amazonaws.regions
Class Region
- java.lang.Object
-
- com.amazonaws.regions.Region
-
public class Region extends Object
Metadata for an AWS region, including its name and what services are available in it.
-
-
Constructor Summary
Constructors Constructor Description Region(RegionImpl regionImpl)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends AmazonWebServiceClient>
TcreateClient(Class<T> serviceClass, AWSCredentialsProvider credentials, ClientConfiguration config)
Creates a new service client of the class given and configures it.boolean
equals(Object obj)
Collection<String>
getAvailableEndpoints()
Returns a immutable collection of all endpoints available in the metadata.String
getDomain()
Returns the domain for this region; ex: "amazonaws.com".String
getName()
The unique system ID for this region; ex: "us-east-1".String
getPartition()
Returns the partition this region is in.static Region
getRegion(Regions region)
Returns the region with the id given, or null if it cannot be found in the current regions.xml file.String
getServiceEndpoint(String serviceName)
Returns the endpoint for the service given.int
hashCode()
boolean
hasHttpEndpoint(String serviceName)
Returns whether the given service support the http protocol in this region.boolean
hasHttpsEndpoint(String serviceName)
Returns whether the given service support the https protocol in this region.boolean
isServiceSupported(String serviceName)
Returns whether the given service is supported in this region.String
toString()
-
-
-
Constructor Detail
-
Region
public Region(RegionImpl regionImpl)
-
-
Method Detail
-
getRegion
public static Region getRegion(Regions region)
Returns the region with the id given, or null if it cannot be found in the current regions.xml file.
-
getName
public String getName()
The unique system ID for this region; ex: "us-east-1".- Returns:
- The unique system ID for this region.
-
getDomain
public String getDomain()
Returns the domain for this region; ex: "amazonaws.com".- Returns:
- The domain for this region.
-
getPartition
public String getPartition()
Returns the partition this region is in. I.E. 'aws' or 'aws-cn'- Returns:
- The partition this region is in.
-
getServiceEndpoint
public String getServiceEndpoint(String serviceName)
Returns the endpoint for the service given.- See Also:
ServiceAbbreviations
-
isServiceSupported
public boolean isServiceSupported(String serviceName)
Returns whether the given service is supported in this region.- See Also:
ServiceAbbreviations
-
hasHttpsEndpoint
public boolean hasHttpsEndpoint(String serviceName)
Returns whether the given service support the https protocol in this region.- See Also:
ServiceAbbreviations
-
hasHttpEndpoint
public boolean hasHttpEndpoint(String serviceName)
Returns whether the given service support the http protocol in this region.- See Also:
ServiceAbbreviations
-
getAvailableEndpoints
public Collection<String> getAvailableEndpoints()
Returns a immutable collection of all endpoints available in the metadata.
-
createClient
public <T extends AmazonWebServiceClient> T createClient(Class<T> serviceClass, AWSCredentialsProvider credentials, ClientConfiguration config)
Creates a new service client of the class given and configures it. If credentials or config are null, defaults will be used.- Parameters:
serviceClass
- The service client class to instantiate, e.g. AmazonS3Client.classcredentials
- The credentials provider to use, or null for the default credentials providerconfig
- The configuration to use, or null for the default configuration- See Also:
ServiceAbbreviations
-
-