Package org.jclouds.azureblob.blobstore
Class AzureBlobStore
- java.lang.Object
-
- org.jclouds.blobstore.internal.BaseBlobStore
-
- org.jclouds.azureblob.blobstore.AzureBlobStore
-
- All Implemented Interfaces:
BlobStore
@Singleton public class AzureBlobStore extends BaseBlobStore
-
-
Field Summary
-
Fields inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobUtils, context, defaultLocation, locations, slicer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortMultipartUpload(MultipartUpload mpu)
boolean
blobExists(String container, String key)
This implementation invokesAzureBlobClient.blobExists(java.lang.String, java.lang.String)
BlobMetadata
blobMetadata(String container, String key)
This implementation invokesAzureBlobClient.getBlobProperties(java.lang.String, java.lang.String)
String
completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
boolean
containerExists(String container)
This implementation invokesAzureBlobClient#bucketExists
String
copyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options)
Copy blob from one container to another.boolean
createContainerInLocation(Location location, String container)
This implementation invokesAzureBlobClient#putBucketInRegion
boolean
createContainerInLocation(Location location, String container, CreateContainerOptions options)
protected boolean
deleteAndVerifyContainerGone(String container)
Delete a container if it is empty.void
deleteContainer(String container)
This implementation invokesAzureBlobClient.deleteContainer(java.lang.String)
Blob
getBlob(String container, String key, GetOptions options)
This implementation invokesAzureBlobClient.getBlob(java.lang.String, java.lang.String, org.jclouds.http.options.GetOptions...)
BlobAccess
getBlobAccess(String container, String key)
ListBlobBlocksResponse
getBlockList(String container, String name)
Get Block ID List for a blobContainerAccess
getContainerAccess(String container)
long
getMaximumMultipartPartSize()
int
getMaximumNumberOfParts()
long
getMinimumMultipartPartSize()
MultipartUpload
initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options)
PageSet<? extends StorageMetadata>
list()
This implementation invokesAzureBlobClient.listContainers(org.jclouds.azure.storage.options.ListOptions...)
PageSet<? extends StorageMetadata>
list(String container, ListContainerOptions options)
This implementation invokesAzureBlobClient.listBlobs(java.lang.String, org.jclouds.azureblob.options.ListBlobsOptions...)
List<MultipartPart>
listMultipartUpload(MultipartUpload mpu)
List<MultipartUpload>
listMultipartUploads(String container)
String
putBlob(String container, Blob blob)
This implementation invokesAzureBlobClient#putObject
String
putBlob(String container, Blob blob, PutOptions options)
This implementation invokesAzureBlobClient#putObject
void
putBlock(String container, String name, String blockId, Payload block)
The Put Block operation creates a block blob on Azure which can be later assembled into a single, large blob object with the Put Block List operation.String
putBlockList(String container, String name, List<String> blockIdList)
The Put Block operation creates a block blob on Azure which can be later assembled into a single, large blob object with the Put Block List operation.void
removeBlob(String container, String key)
This implementation invokesAzureBlobClient#deleteObject
void
setBlobAccess(String container, String key, BlobAccess access)
void
setContainerAccess(String container, ContainerAccess access)
InputStream
streamBlob(String container, String name)
MultipartPart
uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
Methods inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobBuilder, clearContainer, clearContainer, countBlobs, countBlobs, createDirectory, deleteContainerIfEmpty, deleteDirectory, deletePathAndEnsureGone, directoryExists, downloadBlob, downloadBlob, getBlob, getContext, list, listAssignableLocations, putMultipartBlob, putMultipartBlob, removeBlobs, streamBlob
-
-
-
-
Method Detail
-
list
public PageSet<? extends StorageMetadata> list()
This implementation invokesAzureBlobClient.listContainers(org.jclouds.azure.storage.options.ListOptions...)
-
containerExists
public boolean containerExists(String container)
This implementation invokesAzureBlobClient#bucketExists
- Parameters:
container
- container name
-
createContainerInLocation
public boolean createContainerInLocation(Location location, String container)
This implementation invokesAzureBlobClient#putBucketInRegion
- Parameters:
location
- currently ignoredcontainer
- container name- Returns:
- true if the container was created, false if it already existed.
-
list
public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
This implementation invokesAzureBlobClient.listBlobs(java.lang.String, org.jclouds.azureblob.options.ListBlobsOptions...)
- Parameters:
container
- container nameoptions
- size, recursion, and context of the list- Returns:
- a list that may be incomplete, depending on whether PageSet#getNextMarker is set
-
deleteContainer
public void deleteContainer(String container)
This implementation invokesAzureBlobClient.deleteContainer(java.lang.String)
- Specified by:
deleteContainer
in interfaceBlobStore
- Overrides:
deleteContainer
in classBaseBlobStore
- Parameters:
container
- container name
-
blobExists
public boolean blobExists(String container, String key)
This implementation invokesAzureBlobClient.blobExists(java.lang.String, java.lang.String)
- Parameters:
container
- container namekey
- blob key
-
getBlob
public Blob getBlob(String container, String key, GetOptions options)
This implementation invokesAzureBlobClient.getBlob(java.lang.String, java.lang.String, org.jclouds.http.options.GetOptions...)
- Parameters:
container
- container namekey
- blob keyoptions
- 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 invokesAzureBlobClient#putObject
- Parameters:
container
- container nameblob
- object- Returns:
- etag of the blob you uploaded, possibly null where etags are unsupported
-
putBlob
public String putBlob(String container, Blob blob, PutOptions options)
This implementation invokesAzureBlobClient#putObject
- Parameters:
container
- container nameblob
- objectoptions
- 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 invokesAzureBlobClient#deleteObject
- Parameters:
container
- container namekey
- blob key
-
putBlock
public void putBlock(String container, String name, String blockId, Payload block)
The Put Block operation creates a block blob on Azure which can be later assembled into a single, large blob object with the Put Block List operation.
-
putBlockList
public String putBlockList(String container, String name, List<String> blockIdList)
The Put Block operation creates a block blob on Azure which can be later assembled into a single, large blob object with the Put Block List operation. Azure will search the latest blocks uploaded with putBlock to assemble the blob.
-
getBlockList
public ListBlobBlocksResponse getBlockList(String container, String name)
Get Block ID List for a blob
-
blobMetadata
public BlobMetadata blobMetadata(String container, String key)
This implementation invokesAzureBlobClient.getBlobProperties(java.lang.String, java.lang.String)
- Parameters:
container
- container namekey
- blob key- Returns:
- null if name isn't present or the blob you intended to receive.
-
deleteAndVerifyContainerGone
protected boolean deleteAndVerifyContainerGone(String container)
Description copied from class:BaseBlobStore
Delete a container if it is empty.- 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)
-
getContainerAccess
public ContainerAccess getContainerAccess(String container)
-
setContainerAccess
public void setContainerAccess(String container, ContainerAccess access)
-
getBlobAccess
public BlobAccess getBlobAccess(String container, String key)
-
setBlobAccess
public void setBlobAccess(String container, String key, BlobAccess access)
-
initiateMultipartUpload
public MultipartUpload initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options)
-
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()
-
streamBlob
public InputStream streamBlob(String container, String name)
- Specified by:
streamBlob
in interfaceBlobStore
- Overrides:
streamBlob
in classBaseBlobStore
-
-