Package io.clonecloudstore.driver.azure
Class DriverAzure
java.lang.Object
io.clonecloudstore.driver.azure.DriverAzure
- All Implemented Interfaces:
DriverApi,Closeable,AutoCloseable
Azure Driver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbucketCreate(StorageBucket bucket) Create one Bucket and returns itvoidbucketDelete(String bucket) Delete one Bucket if it exists and is emptybooleanbucketExists(String bucket) Check existence of BucketGet one Bucket and returns itbucketImport(StorageBucket bucket) Import one Bucket and returns itlongCount BucketsIterator on Buckets listStream Buckets listvoidclose()Close with no exception.directoryOrObjectExistsInBucket(String bucket, String directoryOrObject) Check if Directory or Object exists in specified Bucket (based on prefix)objectCopy(StorageObject objectSource, StorageObject objectTarget) Copy one object to another one, possibly in a different bucket.voidobjectDeleteInBucket(String bucket, String object) Delete the Object from this BucketobjectFinalizeCreateInBucket(String bucket, String object, long realLen, String sha256) Second step in creation of an object within a Bucket.objectGetInputStreamInBucket(String bucket, String object) Get the content of the specified Object within specified BucketobjectGetMetadataInBucket(String bucket, String object) Get the Object metadata from this Bucket (those available from Object Storage)voidobjectPrepareCreateInBucket(StorageObject object, InputStream inputStream) First step in creation of an object within a Bucket.longobjectsCountInBucket(String bucket) Count Objects in specified BucketlongobjectsCountInBucket(String bucket, String prefix, Instant from, Instant to) Count Objects in specified Bucket with filters (all optionals)objectsIteratorInBucket(String bucket) Iterator on Objects in specified BucketobjectsIteratorInBucket(String bucket, String prefix, Instant from, Instant to) Iterator on Objects in specified Bucket with filters (all optionals)objectsStreamInBucket(String bucket) Stream Objects in specified BucketobjectsStreamInBucket(String bucket, String prefix, Instant from, Instant to) Stream Objects in specified Bucket with filters (all optionals)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.clonecloudstore.driver.api.DriverApi
bucketDelete, bucketExists, directoryOrObjectExistsInBucket, objectCopy, objectDeleteInBucket, objectFinalizeCreateInBucket, objectGetInputStreamInBucket, objectGetMetadataInBucket, objectsCountInBucket, objectsCountInBucket, objectsIteratorInBucket, objectsIteratorInBucket, objectsStreamInBucket, objectsStreamInBucket, validCopy
-
Constructor Details
-
DriverAzure
- Throws:
DriverRuntimeException
-
-
Method Details
-
bucketsCount
Description copied from interface:DriverApiCount Buckets- Specified by:
bucketsCountin interfaceDriverApi- Throws:
DriverException
-
bucketsStream
Description copied from interface:DriverApiStream Buckets list- Specified by:
bucketsStreamin interfaceDriverApi- Throws:
DriverException
-
bucketsIterator
Description copied from interface:DriverApiIterator on Buckets list- Specified by:
bucketsIteratorin interfaceDriverApi- Throws:
DriverException
-
bucketGet
Description copied from interface:DriverApiGet one Bucket and returns it- Specified by:
bucketGetin interfaceDriverApi- Returns:
- the StorageBucket as instantiated within the Object Storage (real values)
- Throws:
DriverNotFoundExceptionDriverException
-
bucketCreate
public StorageBucket bucketCreate(StorageBucket bucket) throws DriverNotAcceptableException, DriverAlreadyExistException, DriverException Description copied from interface:DriverApiCreate one Bucket and returns it- Specified by:
bucketCreatein interfaceDriverApi- Parameters:
bucket- contains various information that could be implemented within Object Storage, but, except the name of the bucket and the client Id, nothing is mandatory- Returns:
- the StorageBucket as instantiated within the Object Storage (real values)
- Throws:
DriverNotAcceptableExceptionDriverAlreadyExistExceptionDriverException
-
bucketImport
public StorageBucket bucketImport(StorageBucket bucket) throws DriverNotAcceptableException, DriverAlreadyExistException, DriverException Description copied from interface:DriverApiImport one Bucket and returns it- Specified by:
bucketImportin interfaceDriverApi- Parameters:
bucket- contains various information that could be implemented within Object Storage, but, except the name of the bucket and the client Id, nothing is mandatory- Returns:
- the StorageBucket as instantiated within the Object Storage (real values)
- Throws:
DriverNotAcceptableExceptionDriverAlreadyExistExceptionDriverException
-
bucketDelete
public void bucketDelete(String bucket) throws DriverNotAcceptableException, DriverNotFoundException, DriverException Description copied from interface:DriverApiDelete one Bucket if it exists and is empty- Specified by:
bucketDeletein interfaceDriverApi- Throws:
DriverNotAcceptableExceptionDriverNotFoundExceptionDriverException
-
bucketExists
Description copied from interface:DriverApiCheck existence of Bucket- Specified by:
bucketExistsin interfaceDriverApi- Throws:
DriverException
-
objectsCountInBucket
Description copied from interface:DriverApiCount Objects in specified Bucket- Specified by:
objectsCountInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsCountInBucket
public long objectsCountInBucket(String bucket, String prefix, Instant from, Instant to) throws DriverNotFoundException, DriverException Description copied from interface:DriverApiCount Objects in specified Bucket with filters (all optionals)- Specified by:
objectsCountInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsStreamInBucket
public Stream<StorageObject> objectsStreamInBucket(String bucket) throws DriverNotFoundException, DriverException Description copied from interface:DriverApiStream Objects in specified Bucket- Specified by:
objectsStreamInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsStreamInBucket
public Stream<StorageObject> objectsStreamInBucket(String bucket, String prefix, Instant from, Instant to) throws DriverNotFoundException, DriverException Description copied from interface:DriverApiStream Objects in specified Bucket with filters (all optionals)- Specified by:
objectsStreamInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsIteratorInBucket
public Iterator<StorageObject> objectsIteratorInBucket(String bucket) throws DriverNotFoundException, DriverException Description copied from interface:DriverApiIterator on Objects in specified Bucket- Specified by:
objectsIteratorInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsIteratorInBucket
public Iterator<StorageObject> objectsIteratorInBucket(String bucket, String prefix, Instant from, Instant to) throws DriverNotFoundException, DriverException Description copied from interface:DriverApiIterator on Objects in specified Bucket with filters (all optionals)- Specified by:
objectsIteratorInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
directoryOrObjectExistsInBucket
public StorageType directoryOrObjectExistsInBucket(String bucket, String directoryOrObject) throws DriverException Description copied from interface:DriverApiCheck if Directory or Object exists in specified Bucket (based on prefix)- Specified by:
directoryOrObjectExistsInBucketin interfaceDriverApi- Throws:
DriverException
-
objectPrepareCreateInBucket
public void objectPrepareCreateInBucket(StorageObject object, InputStream inputStream) throws DriverNotFoundException, DriverAlreadyExistException, DriverException Description copied from interface:DriverApiFirst step in creation of an object within a Bucket. The InputStream is ready to be read in a concurrent independent thread to be provided by the driver. Sha256 might be null or empty. Len might be 0, meaning unknown.- Specified by:
objectPrepareCreateInBucketin interfaceDriverApi- Parameters:
object- contains various information that could be implemented within Object Storage, but, except the name of the bucket and the key of the object, nothing is mandatory- Throws:
DriverNotFoundExceptionDriverAlreadyExistExceptionDriverException
-
objectFinalizeCreateInBucket
public StorageObject objectFinalizeCreateInBucket(String bucket, String object, long realLen, String sha256) throws DriverNotFoundException, DriverAlreadyExistException, DriverException Description copied from interface:DriverApiSecond step in creation of an object within a Bucket. Sha256 might be null or empty. Reallen must not be 0. This method waits for the prepare method to end and returns the final result.- Specified by:
objectFinalizeCreateInBucketin interfaceDriverApi- Returns:
- the StorageObject as instantiated within the Object Storage (real values)
- Throws:
DriverNotFoundExceptionDriverAlreadyExistExceptionDriverException
-
objectGetInputStreamInBucket
public InputStream objectGetInputStreamInBucket(String bucket, String object) throws DriverNotFoundException, DriverException Description copied from interface:DriverApiGet the content of the specified Object within specified Bucket- Specified by:
objectGetInputStreamInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectCopy
public StorageObject objectCopy(StorageObject objectSource, StorageObject objectTarget) throws DriverNotFoundException, DriverAlreadyExistException, DriverException Description copied from interface:DriverApiCopy one object to another one, possibly in a different bucket. Hash and Size come from given source, while Metadata and expired date come from target- Specified by:
objectCopyin interfaceDriverApi- Parameters:
objectSource- source objectobjectTarget- target object- Throws:
DriverNotFoundExceptionDriverAlreadyExistExceptionDriverException
-
objectGetMetadataInBucket
public StorageObject objectGetMetadataInBucket(String bucket, String object) throws DriverNotFoundException, DriverException Description copied from interface:DriverApiGet the Object metadata from this Bucket (those available from Object Storage)- Specified by:
objectGetMetadataInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectDeleteInBucket
public void objectDeleteInBucket(String bucket, String object) throws DriverNotAcceptableException, DriverNotFoundException, DriverException Description copied from interface:DriverApiDelete the Object from this Bucket- Specified by:
objectDeleteInBucketin interfaceDriverApi- Throws:
DriverNotAcceptableExceptionDriverNotFoundExceptionDriverException
-
close
public void close()Description copied from interface:DriverApiClose with no exception. Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.
-