Package org.jclouds.s3.blobstore
Class S3BlobStore
- java.lang.Object
-
- org.jclouds.blobstore.internal.BaseBlobStore
-
- org.jclouds.s3.blobstore.S3BlobStore
-
- All Implemented Interfaces:
BlobStore
- Direct Known Subclasses:
AWSS3BlobStore
@Singleton public class S3BlobStore extends BaseBlobStore
-
-
Field Summary
-
Fields inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobUtils, context, defaultLocation, locations, slicer
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
S3BlobStore(BlobStoreContext context, BlobUtils blobUtils, com.google.common.base.Supplier<Location> defaultLocation, com.google.common.base.Supplier<Set<? extends Location>> locations, PayloadSlicer slicer, S3Client sync, com.google.common.base.Function<Set<BucketMetadata>,PageSet<? extends StorageMetadata>> convertBucketsToStorageMetadata, ContainerToBucketListOptions container2BucketListOptions, BucketToResourceList bucket2ResourceList, ObjectToBlob object2Blob, BlobToHttpGetOptions blob2ObjectGetOptions, BlobToObject blob2Object, BlobToObjectMetadata blob2ObjectMetadata, ObjectToBlobMetadata object2BlobMd, javax.inject.Provider<FetchBlobMetadata> fetchBlobMetadataProvider)
-
Method Summary
-
Methods inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobBuilder, clearContainer, clearContainer, countBlobs, countBlobs, createDirectory, deleteContainer, deleteContainerIfEmpty, deleteDirectory, directoryExists, downloadBlob, downloadBlob, getBlob, getContext, list, listAssignableLocations, putMultipartBlob, putMultipartBlob, streamBlob, streamBlob
-
-
-
-
Constructor Detail
-
S3BlobStore
@Inject protected S3BlobStore(BlobStoreContext context, BlobUtils blobUtils, com.google.common.base.Supplier<Location> defaultLocation, com.google.common.base.Supplier<Set<? extends Location>> locations, PayloadSlicer slicer, S3Client sync, com.google.common.base.Function<Set<BucketMetadata>,PageSet<? extends StorageMetadata>> convertBucketsToStorageMetadata, ContainerToBucketListOptions container2BucketListOptions, BucketToResourceList bucket2ResourceList, ObjectToBlob object2Blob, BlobToHttpGetOptions blob2ObjectGetOptions, BlobToObject blob2Object, BlobToObjectMetadata blob2ObjectMetadata, ObjectToBlobMetadata object2BlobMd, javax.inject.Provider<FetchBlobMetadata> fetchBlobMetadataProvider)
-
-
Method Detail
-
list
public PageSet<? extends StorageMetadata> list()
This implementation invokesS3Client.listOwnedBuckets()
-
containerExists
public boolean containerExists(String container)
This implementation invokesS3Client.bucketExists(java.lang.String)
- Parameters:
container
- bucket name
-
createContainerInLocation
public boolean createContainerInLocation(Location location, String container)
This implementation invokesS3Client.putBucketInRegion(java.lang.String, java.lang.String, org.jclouds.s3.options.PutBucketOptions...)
- Parameters:
location
- corresponds to a Regioncontainer
- bucket name- Returns:
- true if the container was created, false if it already existed.
-
getContainerAccess
public ContainerAccess getContainerAccess(String container)
-
setContainerAccess
public void setContainerAccess(String container, ContainerAccess access)
-
list
public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
This implementation invokesS3Client.listBucket(java.lang.String, org.jclouds.s3.options.ListBucketOptions...)
- Parameters:
container
- bucket nameoptions
- size, recursion, and context of the list- Returns:
- a list that may be incomplete, depending on whether PageSet#getNextMarker is set
-
deletePathAndEnsureGone
protected void deletePathAndEnsureGone(String path)
This implementation invokesBaseBlobStore.clearContainer(java.lang.String)
thenS3Client.deleteBucketIfEmpty(java.lang.String)
until it is true.- Overrides:
deletePathAndEnsureGone
in classBaseBlobStore
-
blobExists
public boolean blobExists(String container, String key)
This implementation invokesS3Client.objectExists(java.lang.String, java.lang.String)
- Parameters:
container
- bucket namekey
- object key
-
blobMetadata
public BlobMetadata blobMetadata(String container, String key)
This implementation invokesS3Client.headObject(java.lang.String, java.lang.String)
- Parameters:
container
- bucket namekey
- object key- Returns:
- null if name isn't present or the blob you intended to receive.
-
getBlob
public Blob getBlob(String container, String key, GetOptions optionsList)
This implementation invokesS3Client.getObject(java.lang.String, java.lang.String, org.jclouds.http.options.GetOptions...)
- Parameters:
container
- bucket namekey
- object keyoptionsList
- byte range or condition options- Returns:
- the blob you intended to receive or null, if it doesn't exist.
-
putBlob
public String putBlob(String container, Blob blob)
This implementation invokesS3Client.putObject(java.lang.String, org.jclouds.s3.domain.S3Object, org.jclouds.s3.options.PutObjectOptions...)
- Parameters:
container
- bucket nameblob
- object- Returns:
- etag of the blob you uploaded, possibly null where etags are unsupported
-
putBlob
public String putBlob(String container, Blob blob, PutOptions overrides)
This implementation invokesS3Client.putObject(java.lang.String, org.jclouds.s3.domain.S3Object, org.jclouds.s3.options.PutObjectOptions...)
- Parameters:
container
- bucket nameblob
- objectoverrides
- byte range options- Returns:
- etag of the blob you uploaded, possibly null where etags are unsupported
-
copyBlob
public String copyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options)
Description copied from interface:BlobStore
Copy blob from one container to another. Some providers implement this more efficiently than corresponding getBlob and putBlob operations. Note: options are currently ignored- Specified by:
copyBlob
in interfaceBlobStore
- Overrides:
copyBlob
in classBaseBlobStore
- Returns:
- ETag of new blob
-
removeBlob
public void removeBlob(String container, String key)
This implementation invokesS3Client.deleteObject(java.lang.String, java.lang.String)
- Parameters:
container
- bucket namekey
- object key
-
removeBlobs
public void removeBlobs(String container, Iterable<String> keys)
Description copied from interface:BlobStore
Deletes multipleBlob
s representing the data at locationcontainer/name
- Specified by:
removeBlobs
in interfaceBlobStore
- Overrides:
removeBlobs
in classBaseBlobStore
- Parameters:
container
- container where this exists.keys
- fully qualified names relative to the container.
-
getBlobAccess
public BlobAccess getBlobAccess(String container, String name)
-
setBlobAccess
public void setBlobAccess(String container, String name, BlobAccess access)
-
initiateMultipartUpload
public MultipartUpload initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions overrides)
-
abortMultipartUpload
public void abortMultipartUpload(MultipartUpload mpu)
-
completeMultipartUpload
public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
-
uploadMultipartPart
public MultipartPart uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
listMultipartUpload
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu)
-
listMultipartUploads
public List<MultipartUpload> listMultipartUploads(String container)
-
getMinimumMultipartPartSize
public long getMinimumMultipartPartSize()
-
getMaximumMultipartPartSize
public long getMaximumMultipartPartSize()
-
getMaximumNumberOfParts
public int getMaximumNumberOfParts()
-
deleteAndVerifyContainerGone
protected boolean deleteAndVerifyContainerGone(String container)
This implementation invokesS3Utils.deleteAndVerifyContainerGone(org.jclouds.s3.S3Client, java.lang.String)
- Specified by:
deleteAndVerifyContainerGone
in classBaseBlobStore
- Parameters:
container
- what to delete- Returns:
- whether container was deleted
-
createContainerInLocation
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options)
options
- controls default access control- See Also:
BlobStore.createContainerInLocation(Location,String)
-
-