org.dasein.cloud.services.dc
Class Region

java.lang.Object
  extended by org.dasein.cloud.services.dc.Region
All Implemented Interfaces:
Serializable

public class Region
extends Object
implements Serializable

A group of data centers that share a jurisidiction and some common points of failure. If a data center is in two different regions, it should have no common failure points. Similarly, if two data centers are in the same region, they share the same jurisdiction.

Author:
George Reese @ enStratus (http://www.enstratus.com)
See Also:
Serialized Form

Constructor Summary
Region()
          Constructs an empty region instance used in marshalling a region across the wire.
Region(String regionId, String name, boolean active, boolean available)
          Constructs a region with the specified state characteristics.
 
Method Summary
 boolean equals(Object ob)
           
 String getName()
          A (hopefully) user-friendly name for the region as known by the provider.
 String getProviderRegionId()
           
 boolean isActive()
          A regionis considered to be active if it should have at least one available data center.
 boolean isAvailable()
          A region is considered available if at least one of its data centers is available.
 void setActive(boolean active)
          Used only for marshalling and not to be used programatically.
 void setAvailable(boolean available)
          Used only for marshalling and not to be used programatically.
 void setName(String name)
          Used only for marshalling and not to be used programatically.
 void setProviderRegionId(String id)
          Used only for marshalling and not to be used programatically.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Region

public Region()
Constructs an empty region instance used in marshalling a region across the wire.


Region

public Region(String regionId,
              String name,
              boolean active,
              boolean available)
Constructs a region with the specified state characteristics.

Parameters:
regionId - the unique provider ID for the region
name - the user-friendly name for the region
active - whether or not the active zones in this region should be available
available - whether or not at least one zone in this region is available
Method Detail

equals

public boolean equals(Object ob)
Overrides:
equals in class Object

getName

public String getName()
A (hopefully) user-friendly name for the region as known by the provider. If the provider does not support meta-data, this value should be the same as the region ID.

Returns:
the user-friendly name for the region

getProviderRegionId

public String getProviderRegionId()
Returns:
the unique provider ID for the region

isActive

public boolean isActive()
A regionis considered to be active if it should have at least one available data center. In other words, this value will be false only for discontinued regions or for new regions not quite released for production.

Returns:
true if this region should be operational

isAvailable

public boolean isAvailable()
A region is considered available if at least one of its data centers is available. A region can be unavailable and active, but it cannot be inactive and available.

Returns:
true if at least one data center in the region is available

setActive

public void setActive(boolean active)
Used only for marshalling and not to be used programatically.

Parameters:
active - whether or not the marshalled region is active

setAvailable

public void setAvailable(boolean available)
Used only for marshalling and not to be used programatically.

Parameters:
available - whether or not the marshalled region is available

setName

public void setName(String name)
Used only for marshalling and not to be used programatically.

Parameters:
name - the name of the region being marshalled

setProviderRegionId

public void setProviderRegionId(String id)
Used only for marshalling and not to be used programatically.

Parameters:
id - the unique provider ID of the region being marshalled