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)
ContentAddressableStorage
createContainer
in interface ContentAddressableStorage
containerName
- name of container to createpublic boolean isExistingContainer(String containerName)
ContentAddressableStorage
isExistingContainer
in interface ContentAddressableStorage
containerName
- name of containerpublic String putObject(String containerName, String objectName, InputStream stream, DigestType digestType, Long size) throws ContentAddressableStorageException
ContentAddressableStorage
putObject
in interface ContentAddressableStorage
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 existspublic ObjectContent getObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
ContentAddressableStorage
getObject
in interface ContentAddressableStorage
containerName
- container where this exists.objectName
- fully qualified name relative to the container.ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
public String createReadOrderRequest(String containerName, List<String> objectsIds) throws ContentAddressableStorageServerException, ContentAddressableStorageNotFoundException
ContentAddressableStorage
createReadOrderRequest
in interface ContentAddressableStorage
containerName
- container where this exists.objectsIds
- list of the fully qualified name relative to the container.ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
public void removeReadOrderRequest(String readRequestID) throws ContentAddressableStorageServerException
ContentAddressableStorage
removeReadOrderRequest
in interface ContentAddressableStorage
readRequestID
- the read request ID.ContentAddressableStorageServerException
public void deleteObject(String containerName, String objectName) throws ContentAddressableStorageServerException, ContentAddressableStorageNotFoundException
ContentAddressableStorage
deleteObject
in interface ContentAddressableStorage
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.ContentAddressableStorageServerException
public boolean isExistingObject(String containerName, String objectName) throws ContentAddressableStorageServerException
ContentAddressableStorage
isExistingObject
in interface ContentAddressableStorage
containerName
- 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
ContentAddressableStorage
getObjectDigest
in interface ContentAddressableStorage
containerName
- 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)
ContentAddressableStorage
getContainerInformation
in interface ContentAddressableStorage
containerName
- the container namepublic MetadatasObject getObjectMetadata(String containerName, String objectName, boolean noCache) throws ContentAddressableStorageException
ContentAddressableStorage
getObjectMetadata
in interface ContentAddressableStorage
containerName
- the container nameobjectName
- the objectId to checkContentAddressableStorageException
- Thrown when get action failed due some other failurepublic VitamPageSet<? extends VitamStorageMetadata> listContainer(String containerName)
ContentAddressableStorage
listContainer
in interface ContentAddressableStorage
containerName
- the container namepublic VitamPageSet<? extends VitamStorageMetadata> listContainerNext(String containerName, String nextMarker)
ContentAddressableStorage
listContainerNext
in interface ContentAddressableStorage
containerName
- the container namenextMarker
- the last id of the list to get nextpublic void close()
close
in interface VitamAutoCloseable
close
in interface AutoCloseable
Copyright © 2019 Vitam. All rights reserved.