public class HashFileSystem extends ContentAddressableStorageAbstract
LISTING_MAX_RESULTS| Constructor and Description |
|---|
HashFileSystem(StorageConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
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
|
String |
getObjectDigestFromMD(String containerName,
String objectName,
DigestType algo) |
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
|
String |
readExtendedMetadata(Path p,
String name) |
checkObjectpublic HashFileSystem(StorageConfiguration configuration)
configuration - public void createContainer(String containerName) throws ContentAddressableStorageAlreadyExistException, ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - name of container to createContentAddressableStorageAlreadyExistException - Thrown when creating a container while it (containerName)
already existsContentAddressableStorageServerException - Thrown when internal server error happenspublic boolean isExistingContainer(String containerName) throws ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - name of containerContentAddressableStorageServerException - Thrown when internal server error happenspublic long countObjects(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - name of containerContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerException - Thrown when internal server error happenspublic void putObject(String containerName, String objectName, InputStream stream, DigestType digestType, Long size) throws ContentAddressableStorageException
ContentAddressableStoragecontainerName - 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 existspublic javax.ws.rs.core.Response getObject(String containerName, String objectName) throws ContentAddressableStorageException
ContentAddressableStorage
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 existspublic javax.ws.rs.core.Response getObjectAsync(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
ContentAddressableStoragecontainerName - 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 existspublic void deleteObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
ContentAddressableStoragecontainerName - 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 failurepublic boolean isExistingObject(String containerName, String objectName) throws ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - container where the object residesobjectName - fully qualified name relative to the container.ContentAddressableStorageServerException - Thrown when internal server error happenspublic String computeObjectDigest(String containerName, String objectName, DigestType algo) throws ContentAddressableStorageException
ContentAddressableStoragecomputeObjectDigest in interface ContentAddressableStoragecomputeObjectDigest in class ContentAddressableStorageAbstractcontainerName - 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 failurepublic String getObjectDigestFromMD(String containerName, String objectName, DigestType algo) throws ContentAddressableStorageException
containerName - the container nameobjectName - the object namealgo - the algo typeContentAddressableStorageException - if workspace could not be reachedpublic ContainerInformation getContainerInformation(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - the container nameContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerException - Thrown when internal server error happenspublic com.fasterxml.jackson.databind.JsonNode getObjectInformation(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
ContentAddressableStoragecontainerName - 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 failurepublic MetadatasObject getObjectMetadatas(String containerName, String objectId) throws ContentAddressableStorageException, IOException
ContentAddressableStoragecontainerName - the container nameobjectId - the objectId to checkContentAddressableStorageException - Thrown when get action failed due some other failureIOException - if an IOException is encountered with filespublic VitamPageSet<? extends VitamStorageMetadata> listContainer(String containerName) throws ContentAddressableStorageNotFoundException
ContentAddressableStoragecontainerName - the container nameContentAddressableStorageNotFoundException - Thrown when the container cannot be located.public VitamPageSet<? extends VitamStorageMetadata> listContainerNext(String containerName, String nextMarker) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - 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 happenspublic void close()
public String readExtendedMetadata(Path p, String name) throws IOException
IOExceptionCopyright © 2018 Vitam. All rights reserved.