public interface ContentAddressableStorage extends VitamAutoCloseable
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkObject(String containerName,
String objectId,
String digest,
DigestType digestAlgorithm)
Check object
|
String |
computeObjectDigest(String containerName,
String objectName,
DigestType algo)
compute Object Digest using a defined algorithm
|
long |
countObjects(String containerName)
Determines if a container exists
|
void |
createContainer(String containerName)
Creates a container
|
void |
deleteObject(String containerName,
String objectName)
Deletes a object representing the data at location containerName/objectName
|
ContainerInformation |
getContainerInformation(String containerName)
Get container information like capacity
|
javax.ws.rs.core.Response |
getObject(String containerName,
String objectName)
Retrieves an object representing the data at location containerName/objectName
|
javax.ws.rs.core.Response |
getObjectAsync(String containerName,
String objectName)
Retrieves an object representing the data at location containerName/objectName
|
com.fasterxml.jackson.databind.JsonNode |
getObjectInformation(String containerName,
String objectName)
Retrieves information about an object at location containerName/objectName
|
MetadatasObject |
getObjectMetadatas(String containerName,
String objectId)
get metadata of the object
|
boolean |
isExistingContainer(String containerName)
Determines if a container exists
|
boolean |
isExistingObject(String containerName,
String objectName)
Determines if an object exists
|
VitamPageSet<? extends VitamStorageMetadata> |
listContainer(String containerName)
List container (create cursor)
|
VitamPageSet<? extends VitamStorageMetadata> |
listContainerNext(String containerName,
String nextMarker)
List container (next on cursor)
|
void |
putObject(String containerName,
String objectName,
InputStream stream,
DigestType digestType,
Long size)
Adds an object representing the data at location containerName/objectName
|
closevoid createContainer(String containerName) throws ContentAddressableStorageAlreadyExistException, ContentAddressableStorageServerException
containerName - name of container to createContentAddressableStorageAlreadyExistException - Thrown when creating a container while it (containerName)
already existsContentAddressableStorageServerException - Thrown when internal server error happensboolean isExistingContainer(String containerName) throws ContentAddressableStorageServerException
containerName - name of containerContentAddressableStorageServerException - Thrown when internal server error happenslong countObjects(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
containerName - name of containerContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerException - Thrown when internal server error happensvoid putObject(String containerName, String objectName, InputStream stream, DigestType digestType, Long size) throws ContentAddressableStorageException
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 streamContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageException - Thrown when put action failed due some other failureContentAddressableStorageAlreadyExistException - Thrown when object creating existsjavax.ws.rs.core.Response getObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
WARNING : use this method only if the response has to be consumed right away. If the response has to be
forwarded, you should use the method getObjectAsync
instead
containerName - container where this exists.objectName - fully qualified name relative to the container.ContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageException - Thrown when get action failed due some other failureContentAddressableStorageAlreadyExistException - Thrown when object creating existsjavax.ws.rs.core.Response getObjectAsync(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
containerName - container where this exists.objectName - fully qualified name relative to the container.ContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageException - Thrown when get action failed due some other failureContentAddressableStorageAlreadyExistException - Thrown when object creating existsvoid deleteObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
containerName - container where this exists.objectName - fully qualified name relative to the container.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 failureboolean isExistingObject(String containerName, String objectName) throws ContentAddressableStorageServerException
containerName - container where the object residesobjectName - fully qualified name relative to the container.ContentAddressableStorageServerException - Thrown when internal server error happensString computeObjectDigest(String containerName, String objectName, DigestType algo) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException, ContentAddressableStorageException
containerName - container where this exists.objectName - fully qualified name relative to the container.algo - Digest algoContentAddressableStorageNotFoundException - Thrown when the container or the object cannot be locatedContentAddressableStorageServerException - Thrown when internal server error happensContentAddressableStorageException - Thrown when put action failed due some other failureContainerInformation getContainerInformation(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
containerName - the container nameContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerException - Thrown when internal server error happenscom.fasterxml.jackson.databind.JsonNode getObjectInformation(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
containerName - container where the object is.objectName - fully qualified name relative to the container.ContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageException - Thrown when get action failed due some other failureboolean checkObject(String containerName, String objectId, String digest, DigestType digestAlgorithm) throws ContentAddressableStorageException
containerName - the container nameobjectId - the objectId to checkdigest - the digest to be compared withdigestAlgorithm - the digest AlgorithmContentAddressableStorageException - Thrown when check action failed due some other failureMetadatasObject getObjectMetadatas(String containerName, String objectId) throws ContentAddressableStorageException, IOException
containerName - the container nameobjectId - the objectId to checkContentAddressableStorageException - Thrown when get action failed due some other failureIOException - if an IOException is encountered with filesIllegalArgumentException - thrown when containerName or objectId is nullVitamPageSet<? extends VitamStorageMetadata> listContainer(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
containerName - the container nameContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerException - Thrown when internal server error happensVitamPageSet<? extends VitamStorageMetadata> listContainerNext(String containerName, String nextMarker) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
containerName - the container namenextMarker - the last id of the list to get nextContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerException - Thrown when internal server error happensCopyright © 2018 Vitam. All rights reserved.