public interface WorkspaceContentAddressableStorage
Modifier and Type | Method and Description |
---|---|
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 |
createFolder(String containerName,
String folderName)
Creates a folder (or a directory) marker depending on the service
|
void |
deleteContainer(String containerName,
boolean recursive)
Deletes everything inside a container recursively.
|
void |
deleteFolder(String containerName,
String folderName)
Deletes a folder (or a directory) marker depending on the service
|
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
|
List<URI> |
getListUriDigitalObjectFromFolder(String containerName,
String folderName)
Retrieves recursively the uri list of object inside a folder rootFolder/subfolder/
|
javax.ws.rs.core.Response |
getObject(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
|
boolean |
isExistingContainer(String containerName)
Determines if a container exists
|
boolean |
isExistingFolder(String containerName,
String folderName)
Determines if a folder (or a directory) exists
|
boolean |
isExistingObject(String containerName,
String objectName)
Determines if an object exists
|
void |
purgeContainer(String containerName)
Deletes the contents of a container at its root path without deleting the container
|
void |
putObject(String containerName,
String objectName,
InputStream stream)
Adds an object representing the data at location containerName/objectName
|
void |
uncompressObject(String containerName,
String folderName,
String archiveMimeType,
InputStream inputStreamObject)
create container: will be identified by GUID and extract objects and push it on the container
|
void 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 happensvoid purgeContainer(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
Note: this function will delete everything inside a container recursively.
containerName
- name of container to purgeContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
- Thrown when internal server error happensvoid deleteContainer(String containerName, boolean recursive) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
containerName
- name of the container to deleterecursive
- false : deletes a container if it is empty, true : deletes everything recursivelyContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
- Thrown when internal server error happensboolean isExistingContainer(String containerName)
containerName
- name of containerContentAddressableStorageServerException
void createFolder(String containerName, String folderName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageAlreadyExistException, ContentAddressableStorageServerException
containerName
- container to create the directory infolderName
- full path to the folder (or directory)ContentAddressableStorageAlreadyExistException
- Thrown when creating a directory while it already existsContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
- Thrown when internal server error happensvoid deleteFolder(String containerName, String folderName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
containerName
- container to delete the folder fromfolderName
- full path to the folder to deleteContentAddressableStorageNotFoundException
- Thrown when the directory cannot be located.ContentAddressableStorageServerException
- Thrown when internal server error happensboolean isExistingFolder(String containerName, String folderName)
containerName
- container where the folder residesfolderName
- full path to the folderList<URI> getListUriDigitalObjectFromFolder(String containerName, String folderName) throws ContentAddressableStorageException
containerName
- not null allowed container where this exists.folderName
- not null allowed fully qualified folder name relative to the container.ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageException
- Thrown when get action failed due some other failurevoid uncompressObject(String containerName, String folderName, String archiveMimeType, InputStream inputStreamObject) throws ContentAddressableStorageException
containerName
- : the container name (will be Guid created in ingest module)folderName
- : the folder namearchiveMimeType
- : the archive type (zip, tar, tar.gz, tar.bz2)inputStreamObject
- : SIP input streamContentAddressableStorageNotFoundException
- Thrown when the container cannot be locatedContentAddressableStorageAlreadyExistException
- Thrown when folder existsContentAddressableStorageServerException
- Thrown when internal server error happensContentAddressableStorageException
- Thrown when get action failed due some other failureContentAddressableStorageCompressedFileException
- Thrown when the file is not a zip or an empty zipvoid putObject(String containerName, String objectName, InputStream stream) throws ContentAddressableStorageException
containerName
- container to place the object.objectName
- fully qualified object name relative to the container.stream
- the dataContentAddressableStorageNotFoundException
- 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 ContentAddressableStorageException
WARNING : use this method only if the response has to be consumed right away.
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 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 get action failed due some other failureboolean isExistingObject(String containerName, String objectName)
containerName
- container where the object residesobjectName
- fully qualified name relative to the container.String computeObjectDigest(String containerName, String objectName, DigestType algo) throws 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 storage is not available or container does not
existContentAddressableStorageServerException
com.fasterxml.jackson.databind.JsonNode getObjectInformation(String containerName, String objectName) throws 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 failurelong countObjects(String containerName) throws ContentAddressableStorageException
containerName
- name of containerContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageException
- Thrown when get action failed due some other failureCopyright © 2018 Vitam. All rights reserved.