com.amazonaws.regions
Class RegionMetadata

java.lang.Object
  extended by com.amazonaws.regions.RegionMetadata

public class RegionMetadata
extends java.lang.Object

A collection of metadata about a set of regions and the services they contain.

See Also:
RegionUtils

Constructor Summary
RegionMetadata(java.util.List<Region> regions)
          Creates a new RegionMetadata object from the given list of regions.
 
Method Summary
 Region getRegion(java.lang.String name)
          Returns the region with the name given, if it exists.
 Region getRegionByEndpoint(java.lang.String endpoint)
          Searches through all known regions to find one with any service at the specified endpoint.
 java.util.List<Region> getRegions()
          Returns an immutable list of all regions known to this region metadata object, in no particular order.
 java.util.List<Region> getRegionsForService(java.lang.String service)
          Returns a list of the regions that support the service given.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegionMetadata

public RegionMetadata(java.util.List<Region> regions)
Creates a new RegionMetadata object from the given list of regions.

Parameters:
regions - the list of regions
Method Detail

getRegions

public java.util.List<Region> getRegions()
Returns an immutable list of all regions known to this region metadata object, in no particular order.

Returns:
an immutable list of all regions

getRegion

public Region getRegion(java.lang.String name)
Returns the region with the name given, if it exists. Otherwise, returns null.

Parameters:
name - the name of the region to search for
Returns:
the corresponding region, if it exists

getRegionsForService

public java.util.List<Region> getRegionsForService(java.lang.String service)
Returns a list of the regions that support the service given.

Parameters:
service - the service abbreviation to search for
Returns:
the list of regions with support for the given service
See Also:
ServiceAbbreviations

getRegionByEndpoint

public Region getRegionByEndpoint(java.lang.String endpoint)
Searches through all known regions to find one with any service at the specified endpoint. If no region is found with a service at that endpoint, an exception is thrown.

Parameters:
endpoint - The endpoint for any service residing in the desired region.
Returns:
The region containing any service running at the specified endpoint, otherwise an exception is thrown if no region is found with a service at the specified endpoint.
Throws:
java.lang.IllegalArgumentException - If the given URL is malformed, or if the one of the service URLs on record is malformed.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.