public class RegionUtils extends Object
Constructor and Description |
---|
RegionUtils() |
Modifier and Type | Method and Description |
---|---|
static Region |
getRegion(String regionName)
Returns the region with the id given, if it exists.
|
static RegionMetadata |
getRegionMetadata()
Returns the current set of region metadata for this process,
initializing it if it has not yet been explicitly initialized before.
|
static List<Region> |
getRegions()
Returns a list of the available AWS regions.
|
static List<Region> |
getRegionsForService(String serviceAbbreviation)
Returns a list of the regions that support the service given.
|
static void |
init()
Deprecated.
in favor of
initialize() |
static void |
initialize()
Initializes the region metadata by loading from the default hierarchy
of region metadata locations.
|
static void |
initializeFromFile(File file)
Deprecated.
|
static void |
initializeFromResource(Class<?> clazz,
String name)
Deprecated.
|
static void |
initializeFromResource(ClassLoader classLoader,
String name)
Deprecated.
|
static void |
initializeFromResource(String name)
Deprecated.
|
static void |
initializeFromURI(URI uri)
Deprecated.
|
static void |
initializeFromURI(URI uri,
ClientConfiguration config)
Deprecated.
|
static void |
initializeWithMetadata(RegionMetadata metadata)
Directly sets the singleton
RegionMetadata instance. |
static RegionMetadata |
loadMetadataFromFile(File file)
Deprecated.
|
static RegionMetadata |
loadMetadataFromInputStream(InputStream stream)
Deprecated.
|
static RegionMetadata |
loadMetadataFromResource(Class<?> clazz,
String name)
Deprecated.
|
static RegionMetadata |
loadMetadataFromResource(ClassLoader classLoader,
String name)
Deprecated.
|
static RegionMetadata |
loadMetadataFromResource(String name)
Deprecated.
|
static RegionMetadata |
loadMetadataFromURI(URI uri)
Deprecated.
|
static RegionMetadata |
loadMetadataFromURI(URI uri,
ClientConfiguration config)
Deprecated.
|
public static RegionMetadata getRegionMetadata()
public static void initialize()
public static void initializeWithMetadata(RegionMetadata metadata)
RegionMetadata
instance.metadata
- the new region metadata objectpublic static List<Region> getRegionsForService(String serviceAbbreviation)
serviceAbbreviation
- The service endpoint prefix which can be retrieved from the
constant ENDPOINT_PREFIX of the specific service client interface.public static Region getRegion(String regionName)
@Deprecated public static RegionMetadata loadMetadataFromURI(URI uri) throws IOException
uri
- the uri of the XML file to parseIOException
- on error fetching or parsing the XML file@Deprecated public static RegionMetadata loadMetadataFromURI(URI uri, ClientConfiguration config) throws IOException
uri
- the uri of the XML file to parseconfig
- configuration for the HTTP client to use to fetch the fileIOException
- on error fetching or parsing the XML file@Deprecated public static RegionMetadata loadMetadataFromFile(File file) throws IOException
file
- the file to load fromIOException
- on error opening or reading from the file@Deprecated public static RegionMetadata loadMetadataFromResource(String name) throws IOException
name
- the path of the resource, relative to the RegionUtils classIOException
- if the resource is not found or cannot be parsed@Deprecated public static RegionMetadata loadMetadataFromResource(Class<?> clazz, String name) throws IOException
clazz
- the class to use as a base for the resourcename
- the path to the resource, relative to the given classIOException
- if the resource is not found or cannot be parsed@Deprecated public static RegionMetadata loadMetadataFromResource(ClassLoader classLoader, String name) throws IOException
classLoader
- the class loader to load the resource fromname
- the path to the resourceIOException
- if the resource is not found or cannot be parsed@Deprecated public static RegionMetadata loadMetadataFromInputStream(InputStream stream) throws IOException
InputStream
containing an XML file.stream
- the stream to load fromIOException
- on error reading from the stream@Deprecated public static void init()
initialize()
initialize
. If you want to maintain your own remote
copy of the region metadata and periodically refresh it at runtime,
call initializeFromURI
.@Deprecated public static void initializeFromURI(URI uri)
uri
- the uri of the XML file to parseSdkClientException
- on error@Deprecated public static void initializeFromURI(URI uri, ClientConfiguration config)
uri
- the uri of the XML file to parseconfig
- configuration for the HTTP client to use to fetch the fileSdkClientException
- on error@Deprecated public static void initializeFromFile(File file)
file
- the file to load fromSdkClientException
- on error opening or reading from the file@Deprecated public static void initializeFromResource(String name)
name
- the path of the resource, relative to the RegionUtils classSdkClientException
- on error@Deprecated public static void initializeFromResource(Class<?> clazz, String name)
clazz
- the class to use as a base for the resourcename
- the path to the resource, relative to the given classSdkClientException
- on error@Deprecated public static void initializeFromResource(ClassLoader classLoader, String name)
classLoader
- the class loader to use to load the resourcename
- the path to the resourceSdkClientException
- on errorCopyright © 2013 Amazon Web Services, Inc. All Rights Reserved.