public class RegionUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static RegionMetadata |
regionMetadata |
Constructor and Description |
---|
RegionUtils() |
Modifier and Type | Method and Description |
---|---|
static Region |
getRegion(java.lang.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 java.util.List<Region> |
getRegions()
Returns a list of the available AWS regions.
|
static java.util.List<Region> |
getRegionsForService(java.lang.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(java.io.File file)
Deprecated.
|
static void |
initializeFromResource(java.lang.Class<?> clazz,
java.lang.String name)
Deprecated.
|
static void |
initializeFromResource(java.lang.ClassLoader classLoader,
java.lang.String name)
Deprecated.
|
static void |
initializeFromResource(java.lang.String name)
Deprecated.
|
static void |
initializeFromURI(java.net.URI uri)
Deprecated.
|
static void |
initializeFromURI(java.net.URI uri,
ClientConfiguration config)
Deprecated.
|
static void |
initializeWithMetadata(RegionMetadata metadata)
Directly sets the singleton
RegionMetadata instance. |
static RegionMetadata |
loadMetadataFromFile(java.io.File file)
Deprecated.
|
static RegionMetadata |
loadMetadataFromInputStream(java.io.InputStream stream)
Deprecated.
|
static RegionMetadata |
loadMetadataFromResource(java.lang.Class<?> clazz,
java.lang.String name)
Deprecated.
|
static RegionMetadata |
loadMetadataFromResource(java.lang.ClassLoader classLoader,
java.lang.String name)
Deprecated.
|
static RegionMetadata |
loadMetadataFromResource(java.lang.String name)
Deprecated.
|
static RegionMetadata |
loadMetadataFromURI(java.net.URI uri)
Deprecated.
|
static RegionMetadata |
loadMetadataFromURI(java.net.URI uri,
ClientConfiguration config)
Deprecated.
|
private static volatile RegionMetadata regionMetadata
public static RegionMetadata getRegionMetadata()
public static void initialize()
public static void initializeWithMetadata(RegionMetadata metadata)
RegionMetadata
instance.metadata
- the new region metadata objectpublic static java.util.List<Region> getRegions()
public static java.util.List<Region> getRegionsForService(java.lang.String serviceAbbreviation)
ServiceAbbreviations
public static Region getRegion(java.lang.String regionName)
@Deprecated public static RegionMetadata loadMetadataFromURI(java.net.URI uri) throws java.io.IOException
uri
- the uri of the XML file to parsejava.io.IOException
- on error fetching or parsing the XML file@Deprecated public static RegionMetadata loadMetadataFromURI(java.net.URI uri, ClientConfiguration config) throws java.io.IOException
uri
- the uri of the XML file to parseconfig
- configuration for the HTTP client to use to fetch the filejava.io.IOException
- on error fetching or parsing the XML file@Deprecated public static RegionMetadata loadMetadataFromFile(java.io.File file) throws java.io.IOException
file
- the file to load fromjava.io.IOException
- on error opening or reading from the file@Deprecated public static RegionMetadata loadMetadataFromResource(java.lang.String name) throws java.io.IOException
name
- the path of the resource, relative to the RegionUtils classjava.io.IOException
- if the resource is not found or cannot be parsed@Deprecated public static RegionMetadata loadMetadataFromResource(java.lang.Class<?> clazz, java.lang.String name) throws java.io.IOException
clazz
- the class to use as a base for the resourcename
- the path to the resource, relative to the given classjava.io.IOException
- if the resource is not found or cannot be parsed@Deprecated public static RegionMetadata loadMetadataFromResource(java.lang.ClassLoader classLoader, java.lang.String name) throws java.io.IOException
classLoader
- the class loader to load the resource fromname
- the path to the resourcejava.io.IOException
- if the resource is not found or cannot be parsed@Deprecated public static RegionMetadata loadMetadataFromInputStream(java.io.InputStream stream) throws java.io.IOException
InputStream
containing an XML file.stream
- the stream to load fromjava.io.IOException
- 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(java.net.URI uri)
uri
- the uri of the XML file to parseAmazonClientException
- on error@Deprecated public static void initializeFromURI(java.net.URI uri, ClientConfiguration config)
uri
- the uri of the XML file to parseconfig
- configuration for the HTTP client to use to fetch the fileAmazonClientException
- on error@Deprecated public static void initializeFromFile(java.io.File file)
file
- the file to load fromAmazonClientException
- on error opening or reading from the file@Deprecated public static void initializeFromResource(java.lang.String name)
name
- the path of the resource, relative to the RegionUtils classAmazonClientException
- on error@Deprecated public static void initializeFromResource(java.lang.Class<?> clazz, java.lang.String name)
clazz
- the class to use as a base for the resourcename
- the path to the resource, relative to the given classAmazonClientException
- on error@Deprecated public static void initializeFromResource(java.lang.ClassLoader classLoader, java.lang.String name)
classLoader
- the class loader to use to load the resourcename
- the path to the resourceAmazonClientException
- on error