mirror of https://github.com/apache/jclouds.git
Merge pull request #515 from jdaggett/master
hpcloud-objectstore provider bug fix
This commit is contained in:
commit
9e21b48bd3
|
@ -23,6 +23,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.DELETE;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.HEAD;
|
||||
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.Storage;
|
||||
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.ExceptionParser;
|
||||
import org.jclouds.rest.annotations.Headers;
|
||||
|
@ -91,8 +94,25 @@ public interface HPCloudObjectStorageAsyncClient extends CommonSwiftAsyncClient
|
|||
ListenableFuture<Boolean> createContainer(@PathParam("container") String container,
|
||||
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
|
||||
@GET
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.jclouds.blobstore.strategy.internal.FetchBlobMetadata;
|
|||
import org.jclouds.blobstore.util.BlobUtils;
|
||||
import org.jclouds.collect.Memoized;
|
||||
import org.jclouds.domain.Location;
|
||||
import org.jclouds.hpcloud.objectstorage.HPCloudObjectStorageClient;
|
||||
import org.jclouds.hpcloud.objectstorage.blobstore.functions.EnableCDNAndCache;
|
||||
import org.jclouds.openstack.swift.CommonSwiftClient;
|
||||
import org.jclouds.openstack.swift.blobstore.SwiftBlobStore;
|
||||
|
@ -55,7 +56,7 @@ public class HPCloudObjectStorageBlobStore extends SwiftBlobStore {
|
|||
@Inject
|
||||
protected HPCloudObjectStorageBlobStore(BlobStoreContext context, BlobUtils blobUtils,
|
||||
Supplier<Location> defaultLocation, @Memoized Supplier<Set<? extends Location>> locations,
|
||||
CommonSwiftClient sync, ContainerToResourceMetadata container2ResourceMd,
|
||||
HPCloudObjectStorageClient sync, ContainerToResourceMetadata container2ResourceMd,
|
||||
BlobStoreListContainerOptionsToListContainerOptions container2ContainerListOptions,
|
||||
ContainerToResourceList container2ResourceList, ObjectToBlob object2Blob, BlobToObject blob2Object,
|
||||
ObjectToBlobMetadata object2BlobMd, BlobToHttpGetOptions blob2ObjectGetOptions,
|
||||
|
|
|
@ -38,14 +38,12 @@ import org.jclouds.json.config.GsonModule.DateAdapter;
|
|||
import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
|
||||
import org.jclouds.location.suppliers.ImplicitLocationSupplier;
|
||||
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.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
|
||||
import org.jclouds.openstack.services.ObjectStore;
|
||||
import org.jclouds.openstack.services.ServiceType;
|
||||
import org.jclouds.openstack.swift.CommonSwiftAsyncClient;
|
||||
import org.jclouds.openstack.swift.CommonSwiftClient;
|
||||
import org.jclouds.openstack.swift.Storage;
|
||||
import org.jclouds.openstack.swift.config.SwiftObjectModule;
|
||||
import org.jclouds.openstack.swift.handlers.ParseSwiftErrorFromHttpResponse;
|
||||
import org.jclouds.rest.ConfiguresRestClient;
|
||||
|
@ -110,7 +108,7 @@ public class HPCloudObjectStorageRestClientModule extends
|
|||
|
||||
@Provides
|
||||
@Singleton
|
||||
@Storage
|
||||
@ObjectStore
|
||||
protected Supplier<URI> provideStorageUrl(RegionIdToURISupplier.Factory factory, @ApiVersion String apiVersion) {
|
||||
return getLastValueInMap(factory.createForApiTypeAndVersion(ServiceType.OBJECT_STORE, apiVersion));
|
||||
}
|
||||
|
|
|
@ -28,5 +28,5 @@ public interface HPCloudObjectStorageConstants {
|
|||
/**
|
||||
* 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";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue