Merge pull request #515 from jdaggett/master

hpcloud-objectstore provider bug fix
This commit is contained in:
Adrian Cole 2012-03-22 14:48:25 -07:00
commit 9e21b48bd3
4 changed files with 26 additions and 7 deletions

View File

@ -23,6 +23,7 @@ import java.util.Set;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import javax.ws.rs.Consumes; import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.HEAD; import javax.ws.rs.HEAD;
import javax.ws.rs.HeaderParam; import javax.ws.rs.HeaderParam;
@ -46,6 +47,8 @@ import org.jclouds.openstack.services.ObjectStore;
import org.jclouds.openstack.swift.CommonSwiftAsyncClient; import org.jclouds.openstack.swift.CommonSwiftAsyncClient;
import org.jclouds.openstack.swift.Storage; import org.jclouds.openstack.swift.Storage;
import org.jclouds.openstack.swift.domain.ContainerMetadata; import org.jclouds.openstack.swift.domain.ContainerMetadata;
import org.jclouds.openstack.swift.functions.ReturnTrueOn404FalseOn409;
import org.jclouds.openstack.swift.options.ListContainerOptions;
import org.jclouds.rest.annotations.Endpoint; import org.jclouds.rest.annotations.Endpoint;
import org.jclouds.rest.annotations.ExceptionParser; import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.Headers; import org.jclouds.rest.annotations.Headers;
@ -91,8 +94,25 @@ public interface HPCloudObjectStorageAsyncClient extends CommonSwiftAsyncClient
ListenableFuture<Boolean> createContainer(@PathParam("container") String container, ListenableFuture<Boolean> createContainer(@PathParam("container") String container,
CreateContainerOptions... options); CreateContainerOptions... options);
/**
* @see org.jclouds.openstack.swift.CommonSwiftClient#listContainers
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@QueryParams(keys = "format", values = "json")
@Path("/")
ListenableFuture<? extends Set<ContainerMetadata>> listContainers(ListContainerOptions... options);
/**
* @see org.jclouds.openstack.swift.CommonSwiftClient#deleteContainerIfEmpty
*/
@DELETE
@ExceptionParser(ReturnTrueOn404FalseOn409.class)
@Path("/{container}")
ListenableFuture<Boolean> deleteContainerIfEmpty(@PathParam("container") String container);
/** /**
* @see HPCloudObjectStorageClient#listCDNContainers(ListCDNContainerOptions) * @see HPCloudObjectStorageClient#listCDNContainers(ListCDNContainerOptions...)
*/ */
@Beta @Beta
@GET @GET

View File

@ -31,6 +31,7 @@ import org.jclouds.blobstore.strategy.internal.FetchBlobMetadata;
import org.jclouds.blobstore.util.BlobUtils; import org.jclouds.blobstore.util.BlobUtils;
import org.jclouds.collect.Memoized; import org.jclouds.collect.Memoized;
import org.jclouds.domain.Location; import org.jclouds.domain.Location;
import org.jclouds.hpcloud.objectstorage.HPCloudObjectStorageClient;
import org.jclouds.hpcloud.objectstorage.blobstore.functions.EnableCDNAndCache; import org.jclouds.hpcloud.objectstorage.blobstore.functions.EnableCDNAndCache;
import org.jclouds.openstack.swift.CommonSwiftClient; import org.jclouds.openstack.swift.CommonSwiftClient;
import org.jclouds.openstack.swift.blobstore.SwiftBlobStore; import org.jclouds.openstack.swift.blobstore.SwiftBlobStore;
@ -55,7 +56,7 @@ public class HPCloudObjectStorageBlobStore extends SwiftBlobStore {
@Inject @Inject
protected HPCloudObjectStorageBlobStore(BlobStoreContext context, BlobUtils blobUtils, protected HPCloudObjectStorageBlobStore(BlobStoreContext context, BlobUtils blobUtils,
Supplier<Location> defaultLocation, @Memoized Supplier<Set<? extends Location>> locations, Supplier<Location> defaultLocation, @Memoized Supplier<Set<? extends Location>> locations,
CommonSwiftClient sync, ContainerToResourceMetadata container2ResourceMd, HPCloudObjectStorageClient sync, ContainerToResourceMetadata container2ResourceMd,
BlobStoreListContainerOptionsToListContainerOptions container2ContainerListOptions, BlobStoreListContainerOptionsToListContainerOptions container2ContainerListOptions,
ContainerToResourceList container2ResourceList, ObjectToBlob object2Blob, BlobToObject blob2Object, ContainerToResourceList container2ResourceList, ObjectToBlob object2Blob, BlobToObject blob2Object,
ObjectToBlobMetadata object2BlobMd, BlobToHttpGetOptions blob2ObjectGetOptions, ObjectToBlobMetadata object2BlobMd, BlobToHttpGetOptions blob2ObjectGetOptions,

View File

@ -38,14 +38,12 @@ import org.jclouds.json.config.GsonModule.DateAdapter;
import org.jclouds.json.config.GsonModule.Iso8601DateAdapter; import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
import org.jclouds.location.suppliers.ImplicitLocationSupplier; import org.jclouds.location.suppliers.ImplicitLocationSupplier;
import org.jclouds.location.suppliers.RegionIdToURISupplier; import org.jclouds.location.suppliers.RegionIdToURISupplier;
import org.jclouds.location.suppliers.implicit.GetRegionIdMatchingProviderURIOrNull;
import org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstRegionOptionallyMatchingRegionId;
import org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstZone; import org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstZone;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule; import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
import org.jclouds.openstack.services.ObjectStore;
import org.jclouds.openstack.services.ServiceType; import org.jclouds.openstack.services.ServiceType;
import org.jclouds.openstack.swift.CommonSwiftAsyncClient; import org.jclouds.openstack.swift.CommonSwiftAsyncClient;
import org.jclouds.openstack.swift.CommonSwiftClient; import org.jclouds.openstack.swift.CommonSwiftClient;
import org.jclouds.openstack.swift.Storage;
import org.jclouds.openstack.swift.config.SwiftObjectModule; import org.jclouds.openstack.swift.config.SwiftObjectModule;
import org.jclouds.openstack.swift.handlers.ParseSwiftErrorFromHttpResponse; import org.jclouds.openstack.swift.handlers.ParseSwiftErrorFromHttpResponse;
import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.ConfiguresRestClient;
@ -110,7 +108,7 @@ public class HPCloudObjectStorageRestClientModule extends
@Provides @Provides
@Singleton @Singleton
@Storage @ObjectStore
protected Supplier<URI> provideStorageUrl(RegionIdToURISupplier.Factory factory, @ApiVersion String apiVersion) { protected Supplier<URI> provideStorageUrl(RegionIdToURISupplier.Factory factory, @ApiVersion String apiVersion) {
return getLastValueInMap(factory.createForApiTypeAndVersion(ServiceType.OBJECT_STORE, apiVersion)); return getLastValueInMap(factory.createForApiTypeAndVersion(ServiceType.OBJECT_STORE, apiVersion));
} }

View File

@ -28,5 +28,5 @@ public interface HPCloudObjectStorageConstants {
/** /**
* The CDN Endpoint property * The CDN Endpoint property
*/ */
public static final String PROPERTY_CDN_ENDPOINT = "jclouds.hpcloud-objectstorage-lvs.cdn.endpoint"; public static final String PROPERTY_CDN_ENDPOINT = "jclouds.hpcloud-objectstorage.cdn.endpoint";
} }