diff --git a/aws/core/src/main/clojure/org/jclouds/aws/ebs.clj b/aws/core/src/main/clojure/org/jclouds/aws/ebs.clj
index 53555bba6b..91a7e04993 100644
--- a/aws/core/src/main/clojure/org/jclouds/aws/ebs.clj
+++ b/aws/core/src/main/clojure/org/jclouds/aws/ebs.clj
@@ -53,13 +53,13 @@
([v] (get-region v nil))
([v default-region]
(cond
- (keyword? v) (Region/fromValue (name v))
+ (keyword? v) (name v)
(instance? Region v) v
(instance? NodeMetadata v) (let [zone (.getLocationId v)]
; no easier way to go from zone -> region?
- (Region/fromValue (if (> (.indexOf zone "-") -1)
+ (if (> (.indexOf zone "-") -1)
(subs zone 0 (-> zone count dec))
- zone)))
+ zone))
:else default-region)))
(defn get-volume-id
diff --git a/aws/core/src/main/java/org/jclouds/aws/domain/Region.java b/aws/core/src/main/java/org/jclouds/aws/domain/Region.java
index 879a05767e..b6187090cd 100644
--- a/aws/core/src/main/java/org/jclouds/aws/domain/Region.java
+++ b/aws/core/src/main/java/org/jclouds/aws/domain/Region.java
@@ -31,12 +31,7 @@ import com.google.common.base.CaseFormat;
* "http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?LocationSelection.html" />
*
*/
-public enum Region {
-
- /**
- * Region returned is unknown.
- */
- UNKNOWN,
+public class Region {
/**
* EU (Ireland)
@@ -46,7 +41,7 @@ public enum Region {
* In Amazon S3, the EU (Ireland) Region provides read-after-write consistency for PUTS of new
* objects in your Amazon S3 bucket and eventual consistency for overwrite PUTS and DELETES.
*/
- EU_WEST_1,
+ public static final String EU_WEST_1 = "eu-west-1";
/**
*
@@ -60,12 +55,12 @@ public enum Region {
* with the lowest latency. To use this region, do not set the LocationConstraint bucket
* parameter. The US Standard Region provides eventual consistency for all requests.
*/
- US_STANDARD,
+ public static final String US_STANDARD = "us-standard";
/**
*
*/
- US_EAST_1,
+ public static final String US_EAST_1 = "us-east-1";
/**
* US-West (Northern California)
S3
Uses Amazon S3 servers in Northern California
@@ -78,21 +73,11 @@ public enum Region {
* for PUTS of new objects in your Amazon S3 bucket and eventual consistency for overwrite PUTS
* and DELETES.
*/
- US_WEST_1,
-
- AP_SOUTHEAST_1;
+ public static final String US_WEST_1 = "us-west-1";
- public String value() {
- return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name());
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static Region fromValue(String region) {
- return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(region,
- "region")));
- }
+ /**
+ * Region in Singapore, launched April 28, 2010.
+ * This region improves latency for Asia-based users
+ */
+ public static final String AP_SOUTHEAST_1 = "ap-southeast-1";
}
\ No newline at end of file
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/EC2ComputeService.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/EC2ComputeService.java
index 35a2be6fbf..ea2962d7c9 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/EC2ComputeService.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/EC2ComputeService.java
@@ -86,7 +86,7 @@ public class EC2ComputeService extends BaseComputeService {
this.instanceStateTerminated = instanceStateTerminated;
}
- private void deleteSecurityGroup(Region region, String tag) {
+ private void deleteSecurityGroup(String region, String tag) {
if (ec2Client.getSecurityGroupServices().describeSecurityGroupsInRegion(region, tag).size() > 0) {
logger.debug(">> deleting securityGroup(%s)", tag);
ec2Client.getSecurityGroupServices().deleteSecurityGroupInRegion(region, tag);
@@ -96,7 +96,7 @@ public class EC2ComputeService extends BaseComputeService {
}
}
- private void deleteKeyPair(Region region, String tag) {
+ private void deleteKeyPair(String region, String tag) {
for (KeyPair keyPair : ec2Client.getKeyPairServices().describeKeyPairsInRegion(region)) {
if (keyPair.getKeyName().matches(tag + "-[0-9]+")) {
logger.debug(">> deleting keyPair(%s)", tag);
@@ -119,7 +119,7 @@ public class EC2ComputeService extends BaseComputeService {
}
});
if (Iterables.size(nodes) > 0) {
- Region region = getRegionFromNodeOrDefault.apply(Iterables.get(nodes, 0));
+ String region = getRegionFromNodeOrDefault.apply(Iterables.get(nodes, 0));
deleteKeyPair(region, tag);
deleteSecurityGroup(region, tag);
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/config/EC2ComputeServiceContextModule.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/config/EC2ComputeServiceContextModule.java
index 99f7b3f1f4..c70e0aac99 100755
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/config/EC2ComputeServiceContextModule.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/config/EC2ComputeServiceContextModule.java
@@ -134,7 +134,7 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
@Override
public Iterable extends ComputeMetadata> execute(GetNodesOptions options) {
Set nodes = Sets.newHashSet();
- for (Region region : ImmutableSet.of(Region.US_EAST_1, Region.US_WEST_1, Region.EU_WEST_1)) {
+ for (String region : ImmutableSet.of(Region.US_EAST_1, Region.US_WEST_1, Region.EU_WEST_1)) {
Iterables.addAll(nodes, Iterables.transform(Iterables.concat(client
.describeInstancesInRegion(region)), runningInstanceToNodeMetadata));
}
@@ -144,11 +144,11 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
}
@Singleton
- public static class GetRegionFromNodeOrDefault implements Function {
- public Region apply(ComputeMetadata node) {
+ public static class GetRegionFromNodeOrDefault implements Function {
+ public String apply(ComputeMetadata node) {
Location location = node.getLocation();
- Region region = location.getScope() == LocationScope.REGION ? Region.fromValue(location
- .getId()) : Region.fromValue(location.getParent());
+ String region = location.getScope() == LocationScope.REGION ? location
+ .getId() : location.getParent();
return region;
}
}
@@ -171,7 +171,7 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
@Override
public NodeMetadata execute(ComputeMetadata node) {
- Region region = getRegionFromNodeOrDefault.apply(node);
+ String region = getRegionFromNodeOrDefault.apply(node);
RunningInstance runningInstance = Iterables.getOnlyElement(getAllRunningInstancesInRegion(
client, region, node.getId()));
return runningInstanceToNodeMetadata.apply(runningInstance);
@@ -180,7 +180,7 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
}
public static Iterable getAllRunningInstancesInRegion(InstanceClient client,
- Region region, String id) {
+ String region, String id) {
return Iterables.concat(client.describeInstancesInRegion(region, id));
}
@@ -198,7 +198,7 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
@Override
public boolean execute(ComputeMetadata node) {
- Region region = getRegionFromNodeOrDefault.apply(node);
+ String region = getRegionFromNodeOrDefault.apply(node);
client.rebootInstancesInRegion(region, node.getId());
return true;
}
@@ -257,23 +257,23 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
@Provides
@Singleton
- Map provideLocations(Map map) {
+ Map provideLocations(Map availabilityZoneToRegionMap) {
Map locations = Maps.newLinkedHashMap();
- for (AvailabilityZone zone : map.keySet()) {
+ for (AvailabilityZone zone : availabilityZoneToRegionMap.keySet()) {
locations.put(zone.toString(), new LocationImpl(LocationScope.ZONE, zone.toString(), zone
- .toString(), map.get(zone).toString()));
+ .toString(), availabilityZoneToRegionMap.get(zone)));
}
- for (Region region : map.values()) {
- locations.put(region.toString(), new LocationImpl(LocationScope.REGION, region.toString(),
- region.toString(), null));
+ for (String region : availabilityZoneToRegionMap.values()) {
+ locations.put(region, new LocationImpl(LocationScope.REGION, region,
+ region, null));
}
return locations;
}
@Provides
@Singleton
- Location getDefaultLocation(@EC2 Region region, Map map) {
- return map.get(region.toString());
+ Location getDefaultLocation(@EC2 String region, Map map) {
+ return map.get(region);
}
private static class LogHolder {
@@ -292,14 +292,14 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
@Provides
@Singleton
protected Map provideImages(final EC2Client sync,
- @EC2 Map regionMap, LogHolder holder,
+ @EC2 Map regionMap, LogHolder holder,
Function indexer,
@Named(PROPERTY_EC2_AMI_OWNERS) String[] amiOwners, ImageParser parser)
throws InterruptedException, ExecutionException, TimeoutException {
final Set images = Sets.newHashSet();
holder.logger.debug(">> providing images");
- for (final Region region : regionMap.keySet()) {
+ for (final String region : regionMap.keySet()) {
for (final org.jclouds.aws.ec2.domain.Image from : sync.getAMIServices()
.describeImagesInRegion(region, ownedBy(amiOwners))) {
Image image = parser.apply(from);
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/domain/PortsRegionTag.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/domain/PortsRegionTag.java
index 45ba345d05..0eaa665410 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/domain/PortsRegionTag.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/domain/PortsRegionTag.java
@@ -19,8 +19,6 @@
package org.jclouds.aws.ec2.compute.domain;
-import org.jclouds.aws.domain.Region;
-
/**
*
* @author Adrian Cole
@@ -28,7 +26,7 @@ import org.jclouds.aws.domain.Region;
public class PortsRegionTag extends RegionTag {
private final int[] ports;
- public PortsRegionTag(Region region, String tag, int[] ports) {
+ public PortsRegionTag(String region, String tag, int[] ports) {
super(region, tag);
this.ports = ports;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/domain/RegionTag.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/domain/RegionTag.java
index 885ab27e5b..67b6291ad1 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/domain/RegionTag.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/domain/RegionTag.java
@@ -18,17 +18,15 @@
*/
package org.jclouds.aws.ec2.compute.domain;
-import org.jclouds.aws.domain.Region;
-
/**
*
* @author Adrian Cole
*/
public class RegionTag {
- protected final Region region;
+ protected final String region;
protected final String tag;
- public RegionTag(Region region, String tag) {
+ public RegionTag(String region, String tag) {
this.region = region;
this.tag = tag;
}
@@ -64,7 +62,7 @@ public class RegionTag {
return true;
}
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/CreateNewKeyPair.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/CreateNewKeyPair.java
index 38f88c0ff2..a5a6979e15 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/CreateNewKeyPair.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/CreateNewKeyPair.java
@@ -59,7 +59,7 @@ public class CreateNewKeyPair implements Function {
return createNewKeyPairInRegion(from.getRegion(), from.getTag());
}
- private KeyPair createNewKeyPairInRegion(Region region, String tag) {
+ private KeyPair createNewKeyPairInRegion(String region, String tag) {
checkNotNull(region, "region");
checkNotNull(tag, "tag");
logger.debug(">> creating keyPair region(%s) tag(%s)", region, tag);
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/CreateSecurityGroupIfNeeded.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/CreateSecurityGroupIfNeeded.java
index 0b616b3e85..2978d49577 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/CreateSecurityGroupIfNeeded.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/CreateSecurityGroupIfNeeded.java
@@ -37,7 +37,7 @@ public class CreateSecurityGroupIfNeeded implements Function> creating securityGroup region(%s) name(%s)", region, name);
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/ImageParser.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/ImageParser.java
index 9ae8fd3c50..f648ae7831 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/ImageParser.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/functions/ImageParser.java
@@ -105,7 +105,7 @@ public class ImageParser implements Function of("owner", from.getImageOwnerId()),
description,
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/strategy/EC2DestroyNodeStrategy.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/strategy/EC2DestroyNodeStrategy.java
index 7a673aa5a0..02161ad709 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/strategy/EC2DestroyNodeStrategy.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/strategy/EC2DestroyNodeStrategy.java
@@ -67,7 +67,7 @@ public class EC2DestroyNodeStrategy implements DestroyNodeStrategy {
public boolean execute(ComputeMetadata metadata) {
NodeMetadata node = metadata instanceof NodeMetadata ? NodeMetadata.class.cast(metadata)
: getNodeMetadataStrategy.execute(metadata);
- Region region = getRegionFromNodeOrDefault.apply(node);
+ String region = getRegionFromNodeOrDefault.apply(node);
ec2Client.getInstanceServices().terminateInstancesInRegion(region, node.getId());
return instanceStateTerminated.apply(Iterables.getOnlyElement(Iterables.concat(ec2Client
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/strategy/EC2RunNodesAndAddToSetStrategy.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/strategy/EC2RunNodesAndAddToSetStrategy.java
index e6ab741f12..432d6f5aa2 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/strategy/EC2RunNodesAndAddToSetStrategy.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/strategy/EC2RunNodesAndAddToSetStrategy.java
@@ -127,8 +127,8 @@ public class EC2RunNodesAndAddToSetStrategy implements RunNodesAndAddToSetStrate
: null;
// if the location has a parent, it must be an availability zone.
- Region region = zone == null ? Region.fromValue(template.getLocation().getId()) : Region
- .fromValue(template.getLocation().getParent());
+ String region = zone == null ? template.getLocation().getId() :
+ template.getLocation().getParent();
// get or create incidental resources
// TODO race condition. we were using MapMaker, but it doesn't seem to refresh properly when
@@ -188,7 +188,7 @@ public class EC2RunNodesAndAddToSetStrategy implements RunNodesAndAddToSetStrate
return responses;
}
- private Iterable getInstances(Region region, Iterable ids) {
+ private Iterable getInstances(String region, Iterable ids) {
return Iterables.concat(ec2Client.getInstanceServices().describeInstancesInRegion(region,
Iterables.toArray(ids, String.class)));
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/config/EC2RestClientModule.java b/aws/core/src/main/java/org/jclouds/aws/ec2/config/EC2RestClientModule.java
index b2d1a11b8c..fb38c9b2b3 100755
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/config/EC2RestClientModule.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/config/EC2RestClientModule.java
@@ -115,10 +115,10 @@ public class EC2RestClientModule extends AbstractModule {
@Provides
@Singleton
@EC2
- Region provideCurrentRegion(@EC2 Map regionMap, @EC2 URI currentUri) {
- ImmutableBiMap map = ImmutableBiMap. builder().putAll(regionMap)
+ String provideCurrentRegion(@EC2 Map regionMap, @EC2 URI currentUri) {
+ ImmutableBiMap map = ImmutableBiMap. builder().putAll(regionMap)
.build().inverse();
- Region region = map.get(currentUri);
+ String region = map.get(currentUri);
assert region != null : currentUri + " not in " + map;
return region;
}
@@ -126,16 +126,16 @@ public class EC2RestClientModule extends AbstractModule {
@Provides
@Singleton
@EC2
- Map provideRegions(AvailabilityZoneAndRegionClient client) {
+ Map provideRegions(AvailabilityZoneAndRegionClient client) {
return client.describeRegions();
}
@Provides
@Singleton
- Map provideAvailabilityZoneToRegions(
- AvailabilityZoneAndRegionClient client, @EC2 Map regions) {
- Map map = Maps.newHashMap();
- for (Region region : regions.keySet()) {
+ Map provideAvailabilityZoneToRegions(
+ AvailabilityZoneAndRegionClient client, @EC2 Map regions) {
+ Map map = Maps.newHashMap();
+ for (String region : regions.keySet()) {
for (AvailabilityZoneInfo zoneInfo : client.describeAvailabilityZonesInRegion(region)) {
map.put(zoneInfo.getZone(), region);
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Attachment.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Attachment.java
index 83e24b5ea0..eeb3e98a68 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Attachment.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Attachment.java
@@ -48,14 +48,14 @@ public class Attachment implements Comparable {
}
}
- private final Region region;
+ private final String region;
private final String volumeId;
private final String instanceId;
private final String device;
private final Status status;
private final Date attachTime;
- public Attachment(Region region, String volumeId, String instanceId, String device,
+ public Attachment(String region, String volumeId, String instanceId, String device,
Status status, Date attachTime) {
this.region = checkNotNull(region, "region");
this.volumeId = volumeId;
@@ -69,7 +69,7 @@ public class Attachment implements Comparable {
* Snapshots are tied to Regions and can only be used for volumes within the same Region.
*
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/AvailabilityZoneInfo.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/AvailabilityZoneInfo.java
index 95cec11ad5..2cfaa18dcb 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/AvailabilityZoneInfo.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/AvailabilityZoneInfo.java
@@ -54,11 +54,11 @@ public class AvailabilityZoneInfo implements Comparable{
private final String zoneName;
private final AvailabilityZone zone;
private final State state;
- private final Region region;
+ private final String region;
private final Set messages = Sets.newHashSet();
public AvailabilityZoneInfo(String zoneName, AvailabilityZone zone, State zoneState,
- Region region, Iterable messages) {
+ String region, Iterable messages) {
this.zoneName = checkNotNull(zoneName, "zoneName");
this.zone = checkNotNull(zone, "zone");
this.state = checkNotNull(zoneState, "zoneState");
@@ -90,7 +90,7 @@ public class AvailabilityZoneInfo implements Comparable{
/**
* Name of the Region.
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Image.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Image.java
index a754931df9..137a762238 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Image.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Image.java
@@ -38,7 +38,7 @@ import com.google.inject.internal.Nullable;
*/
public class Image implements Comparable {
- private final Region region;
+ private final String region;
private final Architecture architecture;
@Nullable
private final String name;
@@ -62,7 +62,7 @@ public class Image implements Comparable {
private final String rootDeviceName;
private final Map ebsBlockDevices = Maps.newHashMap();
- public Image(Region region, Architecture architecture, @Nullable String name,
+ public Image(String region, Architecture architecture, @Nullable String name,
@Nullable String description, String imageId, String imageLocation,
String imageOwnerId, ImageState imageState, ImageType imageType, boolean isPublic,
Iterable productCodes, @Nullable String kernelId, @Nullable String platform,
@@ -200,7 +200,7 @@ public class Image implements Comparable {
* AMIs are tied to the Region where its files are located within Amazon S3.
*
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/InstanceStateChange.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/InstanceStateChange.java
index 79034ee7c9..a010eb2d66 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/InstanceStateChange.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/InstanceStateChange.java
@@ -31,7 +31,7 @@ import org.jclouds.aws.domain.Region;
*/
public class InstanceStateChange implements Comparable {
- private final Region region;
+ private final String region;
private final String instanceId;
private final InstanceState currentState;
private final InstanceState previousState;
@@ -40,7 +40,7 @@ public class InstanceStateChange implements Comparable {
return (this == o) ? 0 : getInstanceId().compareTo(o.getInstanceId());
}
- public InstanceStateChange(Region region, String instanceId, InstanceState currentState,
+ public InstanceStateChange(String region, String instanceId, InstanceState currentState,
InstanceState previousState) {
this.region = checkNotNull(region, "region");
this.instanceId = instanceId;
@@ -51,7 +51,7 @@ public class InstanceStateChange implements Comparable {
/**
* Instances are tied to Availability Zones. However, the instance ID is tied to the Region.
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/KeyPair.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/KeyPair.java
index ab00e81c54..e9833f494c 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/KeyPair.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/KeyPair.java
@@ -32,13 +32,13 @@ import com.google.inject.internal.Nullable;
* @author Adrian Cole
*/
public class KeyPair implements Comparable {
- private final Region region;
+ private final String region;
private final String keyName;
private final String keyFingerprint;
@Nullable
private final String keyMaterial;
- public KeyPair(Region region, String keyName, String keyFingerprint, @Nullable String keyMaterial) {
+ public KeyPair(String region, String keyName, String keyFingerprint, @Nullable String keyMaterial) {
this.region = checkNotNull(region, "region");
this.keyName = checkNotNull(keyName, "keyName");
this.keyFingerprint = checkNotNull(keyFingerprint, "keyFingerprint");
@@ -48,7 +48,7 @@ public class KeyPair implements Comparable {
/**
* Key pairs (to connect to instances) are Region-specific.
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/PublicIpInstanceIdPair.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/PublicIpInstanceIdPair.java
index 51811900b8..272d037f93 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/PublicIpInstanceIdPair.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/PublicIpInstanceIdPair.java
@@ -34,12 +34,12 @@ import com.google.inject.internal.Nullable;
*/
public class PublicIpInstanceIdPair implements Comparable {
- private final Region region;
+ private final String region;
@Nullable
private final String instanceId;
private final InetAddress publicIp;
- public PublicIpInstanceIdPair(Region region, InetAddress publicIp, @Nullable String instanceId) {
+ public PublicIpInstanceIdPair(String region, InetAddress publicIp, @Nullable String instanceId) {
this.region = checkNotNull(region, "region");
this.instanceId = instanceId;
this.publicIp = checkNotNull(publicIp, "publicIp");
@@ -48,7 +48,7 @@ public class PublicIpInstanceIdPair implements Comparable implements Compa
/** The serialVersionUID */
private static final long serialVersionUID = -9051777593518861395L;
- private final Region region;
+ private final String region;
private final Set groupIds = Sets.newLinkedHashSet();
private final @Nullable
String ownerId;
@@ -49,7 +49,7 @@ public class Reservation extends LinkedHashSet implements Compa
private final @Nullable
String reservationId;
- public Reservation(Region region, Iterable groupIds,
+ public Reservation(String region, Iterable groupIds,
Iterable instances, @Nullable String ownerId,
@Nullable String requesterId, @Nullable String reservationId) {
this.region = checkNotNull(region, "region");
@@ -63,7 +63,7 @@ public class Reservation extends LinkedHashSet implements Compa
/**
* Instances are tied to Availability Zones. However, the instance ID is tied to the Region.
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/RunningInstance.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/RunningInstance.java
index 6a0ba53f7a..49aa27b89c 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/RunningInstance.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/RunningInstance.java
@@ -116,7 +116,7 @@ public class RunningInstance implements Comparable {
}
- private final Region region;
+ private final String region;
private final String amiLaunchIndex;
@Nullable
private final String dnsName;
@@ -157,7 +157,7 @@ public class RunningInstance implements Comparable {
return (this == o) ? 0 : getId().compareTo(o.getId());
}
- public RunningInstance(Region region, @Nullable String amiLaunchIndex, @Nullable String dnsName,
+ public RunningInstance(String region, @Nullable String amiLaunchIndex, @Nullable String dnsName,
String imageId, String instanceId, InstanceState instanceState,
String instanceType, @Nullable InetAddress ipAddress, @Nullable String kernelId,
@Nullable String keyName, Date launchTime, boolean monitoring,
@@ -195,7 +195,7 @@ public class RunningInstance implements Comparable {
/**
* Instance Ids are scoped to the region.
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/SecurityGroup.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/SecurityGroup.java
index aad0236d73..c419d0e6fa 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/SecurityGroup.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/SecurityGroup.java
@@ -32,13 +32,13 @@ import org.jclouds.aws.domain.Region;
*/
public class SecurityGroup implements Comparable {
- private final Region region;
+ private final String region;
private final String name;
private final String ownerId;
private final String description;
private final Set ipPermissions;
- public SecurityGroup(Region region, String name, String ownerId, String description,
+ public SecurityGroup(String region, String name, String ownerId, String description,
Set ipPermissions) {
this.region = checkNotNull(region, "region");
this.name = name;
@@ -52,7 +52,7 @@ public class SecurityGroup implements Comparable {
* with instances outside the Region using group-based firewall rules. Traffic from instances in
* another Region is seen as WAN bandwidth.
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Snapshot.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Snapshot.java
index 98032c8581..987c9e0972 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Snapshot.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Snapshot.java
@@ -47,7 +47,7 @@ public class Snapshot implements Comparable {
}
}
- private final Region region;
+ private final String region;
private final String id;
private final String volumeId;
private final int volumeSize;
@@ -58,7 +58,7 @@ public class Snapshot implements Comparable {
private final String description;
private final String ownerAlias;
- public Snapshot(Region region, String id, String volumeId, int volumeSize, Status status,
+ public Snapshot(String region, String id, String volumeId, int volumeSize, Status status,
Date startTime, int progress, String ownerId, String description, String ownerAlias) {
this.region = checkNotNull(region, "region");
this.id = id;
@@ -75,7 +75,7 @@ public class Snapshot implements Comparable {
/**
* Snapshots are tied to Regions and can only be used for volumes within the same Region.
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Volume.java b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Volume.java
index 7e3d288d96..51a80f119e 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Volume.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/domain/Volume.java
@@ -79,7 +79,7 @@ public class Volume implements Comparable {
}
}
- private final Region region;
+ private final String region;
private final String id;
private final int size;
@Nullable
@@ -89,7 +89,7 @@ public class Volume implements Comparable {
private final Date createTime;
private final Set attachments = Sets.newLinkedHashSet();
- public Volume(Region region, String id, int size, String snapshotId,
+ public Volume(String region, String id, int size, String snapshotId,
AvailabilityZone availabilityZone, Volume.Status status, Date createTime,
Iterable attachments) {
this.region = checkNotNull(region, "region");
@@ -106,7 +106,7 @@ public class Volume implements Comparable {
* An Amazon EBS volume must be located within the same Availability Zone as the instance to
* which it attaches.
*/
- public Region getRegion() {
+ public String getRegion() {
return region;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/functions/AvailabilityZoneToEndpoint.java b/aws/core/src/main/java/org/jclouds/aws/ec2/functions/AvailabilityZoneToEndpoint.java
index 55a73eeef7..e90ecd0ffc 100644
--- a/aws/core/src/main/java/org/jclouds/aws/ec2/functions/AvailabilityZoneToEndpoint.java
+++ b/aws/core/src/main/java/org/jclouds/aws/ec2/functions/AvailabilityZoneToEndpoint.java
@@ -36,12 +36,12 @@ import com.google.common.base.Function;
*/
@Singleton
public class AvailabilityZoneToEndpoint implements Function