cloudsigma related changes for Issue 826

This commit is contained in:
Adrian Cole 2012-02-02 07:45:26 -08:00
parent 61854bf51c
commit 38fd18e8f0
2 changed files with 5 additions and 12 deletions

View File

@ -55,7 +55,6 @@ import org.jclouds.compute.domain.internal.VolumeImpl;
import org.jclouds.compute.reference.ComputeServiceConstants;
import org.jclouds.domain.Location;
import org.jclouds.domain.LoginCredentials;
import org.jclouds.location.suppliers.JustProvider;
import org.jclouds.logging.Logger;
import com.google.common.base.Function;
@ -88,7 +87,6 @@ public class CloudSigmaComputeServiceAdapter implements
});
private final CloudSigmaClient client;
private final Predicate<DriveInfo> driveNotClaimed;
private final JustProvider locationSupplier;
private final String defaultVncPassword;
private final LoadingCache<String, DriveInfo> cache;
private final ExecutorService executor;
@ -99,11 +97,10 @@ public class CloudSigmaComputeServiceAdapter implements
@Inject
public CloudSigmaComputeServiceAdapter(CloudSigmaClient client, Predicate<DriveInfo> driveNotClaimed,
JustProvider locationSupplier, @Named(CloudSigmaConstants.PROPERTY_VNC_PASSWORD) String defaultVncPassword,
@Named(CloudSigmaConstants.PROPERTY_VNC_PASSWORD) String defaultVncPassword,
LoadingCache<String, DriveInfo> cache, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
this.client = checkNotNull(client, "client");
this.driveNotClaimed = checkNotNull(driveNotClaimed, "driveNotClaimed");
this.locationSupplier = checkNotNull(locationSupplier, "locationSupplier");
this.defaultVncPassword = checkNotNull(defaultVncPassword, "defaultVncPassword");
checkArgument(defaultVncPassword.length() <= 8, "vnc passwords should be less that 8 characters!");
this.cache = checkNotNull(cache, "cache");
@ -202,10 +199,10 @@ public class CloudSigmaComputeServiceAdapter implements
return (Iterable<ServerInfo>) client.listServerInfo();
}
@SuppressWarnings("unchecked")
@Override
public Iterable<Location> listLocations() {
return (Iterable<Location>) locationSupplier.get();
// Not using the adapter to determine locations
return ImmutableSet.<Location>of();
}
@Override

View File

@ -52,16 +52,14 @@ import org.jclouds.compute.options.TemplateOptions;
import org.jclouds.compute.reference.ComputeServiceConstants;
import org.jclouds.domain.Location;
import org.jclouds.functions.IdentityFunction;
import org.jclouds.location.suppliers.OnlyLocationOrFirstZone;
import org.jclouds.predicates.RetryablePredicate;
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.inject.Injector;
import com.google.inject.Provides;
import com.google.inject.TypeLiteral;
@ -105,8 +103,6 @@ public class CloudSigmaComputeServiceContextModule
}).to(FindImageForId.class);
bind(new TypeLiteral<Function<String, OsFamilyVersion64Bit>>() {
}).to(ParseOsFamilyVersion64BitFromImageName.class);
bind(new TypeLiteral<Supplier<Location>>() {
}).to(OnlyLocationOrFirstZone.class);
bind(TemplateBuilder.class)
.to(CloudSigmaTemplateBuilderImpl.class);
}