Interface ContentAddressableStorage
-
- All Superinterfaces:
java.lang.AutoCloseable
,VitamAutoCloseable
- All Known Implementing Classes:
AmazonS3V1
,ContentAddressableStorageAbstract
,ContentAddressableStorageJcloudsAbstract
,FileSystem
,HashFileSystem
,OpenstackSwift
,Swift
,TapeLibraryContentAddressableStorage
public interface ContentAddressableStorage extends VitamAutoCloseable
The ContentAddressableStorage interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
createContainer(java.lang.String containerName)
Creates a containerjava.lang.String
createReadOrderRequest(java.lang.String containerName, java.util.List<java.lang.String> objectsIds)
Create read order (asynchronous read from tape to local FS) for the given objects representing the data at location containerName/objectId.void
deleteObject(java.lang.String containerName, java.lang.String objectName)
Deletes a object representing the data at location containerName/objectNameContainerInformation
getContainerInformation(java.lang.String containerName)
Get container information like capacityObjectContent
getObject(java.lang.String containerName, java.lang.String objectName)
Retrieves an object representing the data at location containerName/objectNamejava.lang.String
getObjectDigest(java.lang.String containerName, java.lang.String objectName, DigestType algo, boolean noCache)
compute Object Digest using a defined algorithmMetadatasObject
getObjectMetadata(java.lang.String containerName, java.lang.String objectId, boolean noCache)
get metadata of the objectboolean
isExistingContainer(java.lang.String containerName)
Determines if a container existsboolean
isExistingObject(java.lang.String containerName, java.lang.String objectName)
Determines if an object existsvoid
listContainer(java.lang.String containerName, ObjectListingListener objectListingListener)
List container objectsjava.lang.String
putObject(java.lang.String containerName, java.lang.String objectName, java.io.InputStream stream, DigestType digestType, java.lang.Long size)
Adds an object representing the data at location containerName/objectNamevoid
removeReadOrderRequest(java.lang.String readRequestID)
Purge all read request id to cleanup local FS-
Methods inherited from interface fr.gouv.vitam.common.model.VitamAutoCloseable
close
-
-
-
-
Method Detail
-
createContainer
void createContainer(java.lang.String containerName) throws ContentAddressableStorageServerException
Creates a container- Parameters:
containerName
- name of container to create- Throws:
ContentAddressableStorageServerException
- Thrown when internal server error happens
-
isExistingContainer
boolean isExistingContainer(java.lang.String containerName) throws ContentAddressableStorageServerException
Determines if a container exists- Parameters:
containerName
- name of container- Returns:
- boolean type
- Throws:
ContentAddressableStorageServerException
- Thrown when internal server error happens
-
putObject
java.lang.String putObject(java.lang.String containerName, java.lang.String objectName, java.io.InputStream stream, DigestType digestType, java.lang.Long size) throws ContentAddressableStorageException
Adds 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.stream
- the datadigestType
- 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 failureContentAddressableStorageAlreadyExistException
- Thrown when object creating exists
-
getObject
ObjectContent getObject(java.lang.String containerName, java.lang.String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
Retrieves 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.ContentAddressableStorageException
- Thrown when get action failed due some other failureContentAddressableStorageAlreadyExistException
- Thrown when object creating exists
-
createReadOrderRequest
java.lang.String createReadOrderRequest(java.lang.String containerName, java.util.List<java.lang.String> objectsIds) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
Create read order (asynchronous read from tape to local FS) for the given objects representing the data at location containerName/objectId. Return read order entity- Parameters:
containerName
- container where this exists.objectsIds
- list of the fully qualified name relative to the container.- Returns:
- read order request id
- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageException
- Thrown when get action failed due some other failureContentAddressableStorageAlreadyExistException
- Thrown when object creating exists
-
removeReadOrderRequest
void removeReadOrderRequest(java.lang.String readRequestID) throws ContentAddressableStorageServerException
Purge all read request id to cleanup local FS- Parameters:
readRequestID
- the read request ID.- Throws:
ContentAddressableStorageServerException
-
deleteObject
void deleteObject(java.lang.String containerName, java.lang.String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
Deletes 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.ContentAddressableStorageException
- Thrown when delete action failed due some other failure
-
isExistingObject
boolean isExistingObject(java.lang.String containerName, java.lang.String objectName) throws ContentAddressableStorageServerException
Determines if an object exists- Parameters:
containerName
- container where the object residesobjectName
- fully qualified name relative to the container.- Returns:
- boolean type
- Throws:
ContentAddressableStorageServerException
- Thrown when internal server error happens
-
getObjectDigest
java.lang.String getObjectDigest(java.lang.String containerName, java.lang.String objectName, DigestType algo, boolean noCache) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException, ContentAddressableStorageException
compute Object Digest using a defined algorithm- Parameters:
containerName
- container where this exists.objectName
- fully qualified name relative to the container.algo
- Digest algonoCache
- forces full digest computation- Returns:
- the digest object as String
- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container or the object cannot be locatedContentAddressableStorageServerException
- Thrown when internal server error happensContentAddressableStorageException
- Thrown when put action failed due some other failure
-
getContainerInformation
ContainerInformation getContainerInformation(java.lang.String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
Get container information like capacity- Parameters:
containerName
- the container name- Returns:
- container information like usableSpace
- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
- Thrown when internal server error happens
-
getObjectMetadata
MetadatasObject getObjectMetadata(java.lang.String containerName, java.lang.String objectId, boolean noCache) throws ContentAddressableStorageException, java.io.IOException
get metadata of the object- Parameters:
containerName
- the container nameobjectId
- the objectId to check- Returns:
- MetadatasObjectResult
- Throws:
ContentAddressableStorageException
- Thrown when get action failed due some other failurejava.io.IOException
- if an IOException is encountered with filesjava.lang.IllegalArgumentException
- thrown when containerName or objectId is null
-
listContainer
void listContainer(java.lang.String containerName, ObjectListingListener objectListingListener) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException, java.io.IOException
List container objects- Parameters:
containerName
- the container name- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
- Thrown when internal server error happensjava.io.IOException
-
-