public class TapeLibraryContentAddressableStorage extends Object implements ContentAddressableStorage
| Constructor and Description |
|---|
TapeLibraryContentAddressableStorage(BasicFileStorage basicFileStorage,
ObjectReferentialRepository objectReferentialRepository,
ArchiveReferentialRepository archiveReferentialRepository,
ReadRequestReferentialRepository readRequestReferentialRepository,
FileBucketTarCreatorManager fileBucketTarCreatorManager,
QueueRepository readWriteQueue,
TapeCatalogService tapeCatalogService,
String outputTarStorageFolder,
ArchiveOutputRetentionPolicy archiveOutputRetentionPolicy) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
createContainer(String containerName)
Creates a container
|
String |
createReadOrderRequest(String containerName,
List<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(String containerName,
String objectName)
Deletes a object representing the data at location containerName/objectName
|
ContainerInformation |
getContainerInformation(String containerName)
Get container information like capacity
|
ObjectContent |
getObject(String containerName,
String objectName)
Retrieves an object representing the data at location containerName/objectName
|
String |
getObjectDigest(String containerName,
String objectName,
DigestType algo,
boolean noCache)
compute Object Digest using a defined algorithm
|
MetadatasObject |
getObjectMetadata(String containerName,
String objectName,
boolean noCache)
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)
|
String |
putObject(String containerName,
String objectName,
InputStream stream,
DigestType digestType,
Long size)
Adds an object representing the data at location containerName/objectName
|
void |
removeReadOrderRequest(String readRequestID)
Purge all read request id to cleanup local FS
|
public TapeLibraryContentAddressableStorage(BasicFileStorage basicFileStorage, ObjectReferentialRepository objectReferentialRepository, ArchiveReferentialRepository archiveReferentialRepository, ReadRequestReferentialRepository readRequestReferentialRepository, FileBucketTarCreatorManager fileBucketTarCreatorManager, QueueRepository readWriteQueue, TapeCatalogService tapeCatalogService, String outputTarStorageFolder, ArchiveOutputRetentionPolicy archiveOutputRetentionPolicy)
public void createContainer(String containerName)
ContentAddressableStoragecreateContainer in interface ContentAddressableStoragecontainerName - name of container to createpublic boolean isExistingContainer(String containerName)
ContentAddressableStorageisExistingContainer in interface ContentAddressableStoragecontainerName - name of containerpublic String putObject(String containerName, String objectName, InputStream stream, DigestType digestType, Long size) throws ContentAddressableStorageException
ContentAddressableStorageputObject in interface 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 ObjectContent getObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
ContentAddressableStoragegetObject in interface ContentAddressableStoragecontainerName - container where this exists.objectName - fully qualified name relative to the container.ContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerExceptionpublic String createReadOrderRequest(String containerName, List<String> objectsIds) throws ContentAddressableStorageServerException, ContentAddressableStorageNotFoundException
ContentAddressableStoragecreateReadOrderRequest in interface ContentAddressableStoragecontainerName - container where this exists.objectsIds - list of the fully qualified name relative to the container.ContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerExceptionpublic void removeReadOrderRequest(String readRequestID) throws ContentAddressableStorageServerException
ContentAddressableStorageremoveReadOrderRequest in interface ContentAddressableStoragereadRequestID - the read request ID.ContentAddressableStorageServerExceptionpublic void deleteObject(String containerName, String objectName) throws ContentAddressableStorageServerException, ContentAddressableStorageNotFoundException
ContentAddressableStoragedeleteObject in interface 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.ContentAddressableStorageServerExceptionpublic boolean isExistingObject(String containerName, String objectName) throws ContentAddressableStorageServerException
ContentAddressableStorageisExistingObject in interface ContentAddressableStoragecontainerName - container where the object residesobjectName - fully qualified name relative to the container.ContentAddressableStorageServerException - Thrown when internal server error happenspublic String getObjectDigest(String containerName, String objectName, DigestType algo, boolean noCache) throws ContentAddressableStorageException
ContentAddressableStoragegetObjectDigest in interface ContentAddressableStoragecontainerName - container where this exists.objectName - fully qualified name relative to the container.algo - Digest algonoCache - forces full digest computationContentAddressableStorageNotFoundException - 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 ContainerInformation getContainerInformation(String containerName)
ContentAddressableStoragegetContainerInformation in interface ContentAddressableStoragecontainerName - the container namepublic MetadatasObject getObjectMetadata(String containerName, String objectName, boolean noCache) throws ContentAddressableStorageException
ContentAddressableStoragegetObjectMetadata in interface ContentAddressableStoragecontainerName - the container nameobjectName - the objectId to checkContentAddressableStorageException - Thrown when get action failed due some other failurepublic VitamPageSet<? extends VitamStorageMetadata> listContainer(String containerName)
ContentAddressableStoragelistContainer in interface ContentAddressableStoragecontainerName - the container namepublic VitamPageSet<? extends VitamStorageMetadata> listContainerNext(String containerName, String nextMarker)
ContentAddressableStoragelistContainerNext in interface ContentAddressableStoragecontainerName - the container namenextMarker - the last id of the list to get nextpublic void close()
close in interface VitamAutoCloseableclose in interface AutoCloseableCopyright © 2019 Vitam. All rights reserved.