Class FakeDriver
java.lang.Object
io.clonecloudstore.test.driver.fake.FakeDriver
- All Implemented Interfaces:
DriverApi,Closeable,AutoCloseable
Fake Driver that does not store anything except references in memory
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbucketCreate(StorageBucket bucket) voidbucketDelete(String bucket) booleanbucketExists(String bucket) bucketImport(StorageBucket bucket) longvoidclose()directoryOrObjectExistsInBucket(String bucket, String directoryOrObject) voidforTestsOnlyCreateMultipleObjects(StorageObject object, long realLen, String sha256, List<String> names) Take the object as base definition, and use name from listobjectCopy(StorageObject objectSource, StorageObject objectTarget) Copy one object to another one, possibly in a different bucket.voidobjectDeleteInBucket(String bucket, String object) objectFinalizeCreateInBucket(String bucket, String object, long realLen, String sha256) objectGetInputStreamInBucket(String bucket, String object) objectGetMetadataInBucket(String bucket, String object) voidobjectPrepareCreateInBucket(StorageObject object, InputStream inputStream) longobjectsCountInBucket(String bucket) longobjectsCountInBucket(String bucket, String prefix, Instant from, Instant to) objectsIteratorInBucket(String bucket) objectsIteratorInBucket(String bucket, String prefix, Instant from, Instant to) objectsStreamInBucket(String bucket) objectsStreamInBucket(String bucket, String prefix, Instant from, Instant to) 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
-
Field Details
-
shallRaiseAnException
public static boolean shallRaiseAnException
-
-
Method Details
-
bucketsCount
- Specified by:
bucketsCountin interfaceDriverApi- Throws:
DriverException
-
bucketsStream
- Specified by:
bucketsStreamin interfaceDriverApi- Throws:
DriverException
-
bucketsIterator
- Specified by:
bucketsIteratorin interfaceDriverApi- Throws:
DriverException
-
bucketGet
- Specified by:
bucketGetin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
bucketCreate
public StorageBucket bucketCreate(StorageBucket bucket) throws DriverNotAcceptableException, DriverAlreadyExistException, DriverException - Specified by:
bucketCreatein interfaceDriverApi- Throws:
DriverNotAcceptableExceptionDriverAlreadyExistExceptionDriverException
-
bucketImport
public StorageBucket bucketImport(StorageBucket bucket) throws DriverNotAcceptableException, DriverAlreadyExistException, DriverException - Specified by:
bucketImportin interfaceDriverApi- Throws:
DriverNotAcceptableExceptionDriverAlreadyExistExceptionDriverException
-
bucketDelete
public void bucketDelete(String bucket) throws DriverNotAcceptableException, DriverNotFoundException, DriverException - Specified by:
bucketDeletein interfaceDriverApi- Throws:
DriverNotAcceptableExceptionDriverNotFoundExceptionDriverException
-
bucketExists
- Specified by:
bucketExistsin interfaceDriverApi- Throws:
DriverException
-
objectsCountInBucket
- Specified by:
objectsCountInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsCountInBucket
public long objectsCountInBucket(String bucket, String prefix, Instant from, Instant to) throws DriverNotFoundException, DriverException - Specified by:
objectsCountInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsStreamInBucket
public Stream<StorageObject> objectsStreamInBucket(String bucket) throws DriverNotFoundException, DriverException - Specified by:
objectsStreamInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsStreamInBucket
public Stream<StorageObject> objectsStreamInBucket(String bucket, String prefix, Instant from, Instant to) throws DriverNotFoundException, DriverException - Specified by:
objectsStreamInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsIteratorInBucket
public Iterator<StorageObject> objectsIteratorInBucket(String bucket) throws DriverNotFoundException, DriverException - Specified by:
objectsIteratorInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectsIteratorInBucket
public Iterator<StorageObject> objectsIteratorInBucket(String bucket, String prefix, Instant from, Instant to) throws DriverNotFoundException, DriverException - Specified by:
objectsIteratorInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
directoryOrObjectExistsInBucket
public StorageType directoryOrObjectExistsInBucket(String bucket, String directoryOrObject) throws DriverException - Specified by:
directoryOrObjectExistsInBucketin interfaceDriverApi- Throws:
DriverException
-
objectPrepareCreateInBucket
public void objectPrepareCreateInBucket(StorageObject object, InputStream inputStream) throws DriverNotFoundException, DriverAlreadyExistException, DriverException - Specified by:
objectPrepareCreateInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverAlreadyExistExceptionDriverException
-
objectFinalizeCreateInBucket
public StorageObject objectFinalizeCreateInBucket(String bucket, String object, long realLen, String sha256) throws DriverNotFoundException, DriverAlreadyExistException, DriverException - Specified by:
objectFinalizeCreateInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverAlreadyExistExceptionDriverException
-
objectCopy
public StorageObject objectCopy(StorageObject objectSource, StorageObject objectTarget) throws DriverNotFoundException, DriverAlreadyExistException, DriverException Copy 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
-
forTestsOnlyCreateMultipleObjects
public void forTestsOnlyCreateMultipleObjects(StorageObject object, long realLen, String sha256, List<String> names) throws DriverNotFoundException, DriverAlreadyExistException, DriverException Take the object as base definition, and use name from list -
objectGetInputStreamInBucket
public InputStream objectGetInputStreamInBucket(String bucket, String object) throws DriverNotFoundException, DriverException - Specified by:
objectGetInputStreamInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectGetMetadataInBucket
public StorageObject objectGetMetadataInBucket(String bucket, String object) throws DriverNotFoundException, DriverException - Specified by:
objectGetMetadataInBucketin interfaceDriverApi- Throws:
DriverNotFoundExceptionDriverException
-
objectDeleteInBucket
public void objectDeleteInBucket(String bucket, String object) throws DriverNotAcceptableException, DriverNotFoundException, DriverException - Specified by:
objectDeleteInBucketin interfaceDriverApi- Throws:
DriverNotAcceptableExceptionDriverNotFoundExceptionDriverException
-
close
public void close()
-