Class ContentAddressableStorageJcloudsAbstract
java.lang.Object
fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorageAbstract
fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorageJcloudsAbstract
- All Implemented Interfaces:
- VitamAutoCloseable,- ContentAddressableStorage,- AutoCloseable
- Direct Known Subclasses:
- FileSystem,- OpenstackSwift
public abstract class ContentAddressableStorageJcloudsAbstract
extends ContentAddressableStorageAbstract
Abstract class of CAS that contains common methods for a Jclouds backend
- 
Field SummaryFieldsFields inherited from class fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorageAbstractLISTING_MAX_RESULTS
- 
Constructor SummaryConstructorsConstructorDescriptionContentAddressableStorageJcloudsAbstract(StorageConfiguration configuration) creates a new ContentAddressableStorageImpl with a storage configuration param
- 
Method SummaryModifier and TypeMethodDescriptionvoidcheckObjectDigestAndStoreDigest(String containerName, String objectName, String objectDigest, DigestType digestType, long size) Checks objet digest & update persist its digest in object metadataabstract voidClose context according to implementation (http client not closed)voidcreateContainer(String containerName) Creates a containervoiddeleteObject(String containerName, String objectName) Deletes a object representing the data at location containerName/objectNameabstract ContainerInformationgetContainerInformation(String containerName) Get container information like capacityabstract org.jclouds.blobstore.BlobStoreContextgetContext(StorageConfiguration configuration) enables the connection to a storage service with the param providedRetrieves an object representing the data at location containerName/objectNamegetObjectDigest(String containerName, String objectName, DigestType digestType, boolean noCache) compute Object Digest using a defined algorithmbooleanisExistingContainer(String containerName) Determines if a container existsbooleanisExistingObject(String containerName, String objectName) Determines if an object existsvoidlistContainer(String containerName, ObjectListingListener objectListingListener) List container objectsvoidwriteObject(String containerName, String objectName, InputStream inputStream, DigestType digestType, long size) Adds an object representing the data at location containerName/objectNameMethods inherited from class fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorageAbstractcacheExistsContainer, computeObjectDigest, computeObjectDigestAndSize, disableContainerCaching, getConfiguration, isExistingContainerInCacheMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStoragecheckAccessRequestStatuses, checkObjectAvailability, createAccessRequest, getObjectMetadata, putObject, removeAccessRequestMethods inherited from interface fr.gouv.vitam.common.model.VitamAutoCloseableclose
- 
Field Details- 
contextprotected final org.jclouds.blobstore.BlobStoreContext context
 
- 
- 
Constructor Details- 
ContentAddressableStorageJcloudsAbstractcreates a new ContentAddressableStorageImpl with a storage configuration param- Parameters:
- configuration-- StorageConfiguration
 
 
- 
- 
Method Details- 
getContextpublic abstract org.jclouds.blobstore.BlobStoreContext getContext(StorageConfiguration configuration) enables the connection to a storage service with the param provided- Parameters:
- configuration- the storage configuration
- Returns:
- BlobStoreContext
 
- 
closeContextpublic abstract void closeContext()Close context according to implementation (http client not closed)
- 
createContainerDescription copied from interface:ContentAddressableStorageCreates a container- Parameters:
- containerName- name of container to create
 
- 
isExistingContainerDescription copied from interface:ContentAddressableStorageDetermines if a container exists- Parameters:
- containerName- name of container
- Returns:
- boolean type
 
- 
writeObjectpublic void writeObject(String containerName, String objectName, InputStream inputStream, DigestType digestType, long size) throws ContentAddressableStorageException Description copied from interface:ContentAddressableStorageAdds an object representing the data at location containerName/objectName- Parameters:
- containerName- container to place the object.
- objectName- fully qualified object name relative to the container.
- inputStream- the data
- digestType- parameter to compute an hash.
- size- size off the input stream
- Throws:
- ContentAddressableStorageNotFoundException- Thrown when the container cannot be located.
- ContentAddressableStorageException- Thrown when put action failed due some other failure
- ContentAddressableStorageAlreadyExistException- Thrown when object creating exists
 
- 
checkObjectDigestAndStoreDigestpublic void checkObjectDigestAndStoreDigest(String containerName, String objectName, String objectDigest, DigestType digestType, long size) throws ContentAddressableStorageException Description copied from interface:ContentAddressableStorageChecks objet digest & update persist its digest in object metadata- Parameters:
- containerName- container to place the object.
- objectName- fully qualified object name relative to the container.
- objectDigest- object digest value
- digestType- object digest type
- size- size off the input stream
- Throws:
- ContentAddressableStorageException
 
- 
getObjectDigestpublic String getObjectDigest(String containerName, String objectName, DigestType digestType, boolean noCache) throws ContentAddressableStorageException Description copied from interface:ContentAddressableStoragecompute Object Digest using a defined algorithm- Parameters:
- containerName- container where this exists.
- objectName- fully qualified name relative to the container.
- digestType- Digest algo
- noCache- forces full digest computation
- Returns:
- the digest object as String
- Throws:
- ContentAddressableStorageNotFoundException- Thrown when the container or the object cannot be located
- ContentAddressableStorageServerException- Thrown when internal server error happens
- ContentAddressableStorageException- Thrown when put action failed due some other failure
 
- 
getObjectpublic ObjectContent getObject(String containerName, String objectName) throws ContentAddressableStorageException Description copied from interface:ContentAddressableStorageRetrieves an object representing the data at location containerName/objectName- Parameters:
- containerName- container where this exists.
- objectName- fully qualified name relative to the container.
- Returns:
- the object you intended to receive
- Throws:
- ContentAddressableStorageNotFoundException- Thrown when the container cannot be located.
- ContentAddressableStorageUnavailableDataFromAsyncOfferException- Thrown when object cannot be read due to missing access request on AsyncRead ContentAddressableStorage
- ContentAddressableStorageException- Thrown when get action failed due some other failure
 
- 
deleteObjectpublic void deleteObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException Description copied from interface:ContentAddressableStorageDeletes a object representing the data at location containerName/objectName- Parameters:
- containerName- container where this exists.
- objectName- fully qualified name relative to the container.
- Throws:
- ContentAddressableStorageNotFoundException- Thrown when the container cannot be located or the blob cannot be located in the container.
 
- 
isExistingObjectDescription copied from interface:ContentAddressableStorageDetermines if an object exists- Parameters:
- containerName- container where the object resides
- objectName- fully qualified name relative to the container.
- Returns:
- boolean type
 
- 
getContainerInformationpublic abstract ContainerInformation getContainerInformation(String containerName) throws ContentAddressableStorageNotFoundException Description copied from interface:ContentAddressableStorageGet container information like capacity- Parameters:
- containerName- the container name
- Returns:
- container information like usableSpace
- Throws:
- ContentAddressableStorageNotFoundException- Thrown when the container cannot be located.
 
- 
listContainerpublic void listContainer(String containerName, ObjectListingListener objectListingListener) throws ContentAddressableStorageNotFoundException, IOException Description copied from interface:ContentAddressableStorageList container objects- Parameters:
- containerName- the container name
- Throws:
- ContentAddressableStorageNotFoundException- Thrown when the container cannot be located.
- IOException
 
 
-