diff --git a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/ElasticStackComputeServiceAdapter.java b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/ElasticStackComputeServiceAdapter.java index 6b30b560a1..2142e7a053 100644 --- a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/ElasticStackComputeServiceAdapter.java +++ b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/ElasticStackComputeServiceAdapter.java @@ -57,7 +57,6 @@ import org.jclouds.elasticstack.domain.ServerInfo; import org.jclouds.elasticstack.domain.ServerStatus; import org.jclouds.elasticstack.domain.WellKnownImage; import org.jclouds.elasticstack.reference.ElasticStackConstants; -import org.jclouds.location.suppliers.JustProvider; import org.jclouds.logging.Logger; import com.google.common.base.Function; @@ -82,7 +81,6 @@ public class ElasticStackComputeServiceAdapter implements private final Predicate driveNotClaimed; private final Map preinstalledImages; private final LoadingCache cache; - private final JustProvider locationSupplier; private final String defaultVncPassword; private final ExecutorService executor; @@ -92,12 +90,11 @@ public class ElasticStackComputeServiceAdapter implements @Inject public ElasticStackComputeServiceAdapter(ElasticStackClient client, Predicate driveNotClaimed, - JustProvider locationSupplier, Map preinstalledImages, LoadingCache cache, + Map preinstalledImages, LoadingCache cache, @Named(ElasticStackConstants.PROPERTY_VNC_PASSWORD) String defaultVncPassword, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) { this.client = checkNotNull(client, "client"); this.driveNotClaimed = checkNotNull(driveNotClaimed, "driveNotClaimed"); - this.locationSupplier = checkNotNull(locationSupplier, "locationSupplier"); this.preinstalledImages = checkNotNull(preinstalledImages, "preinstalledImages"); this.cache = checkNotNull(cache, "cache"); this.defaultVncPassword = checkNotNull(defaultVncPassword, "defaultVncPassword"); @@ -195,10 +192,10 @@ public class ElasticStackComputeServiceAdapter implements return (Iterable) client.listServerInfo(); } - @SuppressWarnings("unchecked") @Override public Iterable listLocations() { - return (Iterable) locationSupplier.get(); + // Not using the adapter to determine locations + return ImmutableSet.of(); } @Override diff --git a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/config/ElasticStackComputeServiceContextModule.java b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/config/ElasticStackComputeServiceContextModule.java index cfac4f105a..19f7e43533 100644 --- a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/config/ElasticStackComputeServiceContextModule.java +++ b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/config/ElasticStackComputeServiceContextModule.java @@ -38,10 +38,10 @@ import org.jclouds.elasticstack.ElasticStackAsyncClient; import org.jclouds.elasticstack.ElasticStackClient; import org.jclouds.elasticstack.compute.ElasticStackComputeServiceAdapter; import org.jclouds.elasticstack.compute.functions.ServerInfoToNodeMetadata; +import org.jclouds.elasticstack.compute.functions.WellKnownImageToImage; import org.jclouds.elasticstack.compute.functions.ServerInfoToNodeMetadata.DeviceToVolume; import org.jclouds.elasticstack.compute.functions.ServerInfoToNodeMetadata.FindImageForId; import org.jclouds.elasticstack.compute.functions.ServerInfoToNodeMetadata.GetImageIdFromServer; -import org.jclouds.elasticstack.compute.functions.WellKnownImageToImage; import org.jclouds.elasticstack.domain.Device; import org.jclouds.elasticstack.domain.DriveInfo; import org.jclouds.elasticstack.domain.Server; @@ -51,17 +51,15 @@ import org.jclouds.elasticstack.predicates.DriveClaimed; import org.jclouds.functions.IdentityFunction; import org.jclouds.json.Json; import org.jclouds.location.Provider; -import org.jclouds.location.suppliers.OnlyLocationOrFirstZone; import org.jclouds.predicates.RetryablePredicate; import org.jclouds.util.Strings2; import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.base.Predicates; -import com.google.common.base.Supplier; -import com.google.common.cache.LoadingCache; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; import com.google.common.collect.Maps; import com.google.inject.Provides; import com.google.inject.TypeLiteral; @@ -100,10 +98,8 @@ public class ElasticStackComputeServiceContextModule }).to(FindImageForId.class); bind(new TypeLiteral>() { }).to(WellKnownImageToImage.class); - bind(new TypeLiteral>() { - }).to(OnlyLocationOrFirstZone.class); } - + @Provides @Singleton protected LoadingCache cache(GetDrive getDrive) {