Class TapeLibraryContentAddressableStorage
- java.lang.Object
-
- fr.gouv.vitam.storage.offers.tape.cas.TapeLibraryContentAddressableStorage
-
- All Implemented Interfaces:
VitamAutoCloseable
,ContentAddressableStorage
,java.lang.AutoCloseable
public class TapeLibraryContentAddressableStorage extends java.lang.Object implements ContentAddressableStorage
-
-
Constructor Summary
Constructors Constructor Description TapeLibraryContentAddressableStorage(BasicFileStorage basicFileStorage, ObjectReferentialRepository objectReferentialRepository, ArchiveReferentialRepository archiveReferentialRepository, ReadRequestReferentialRepository readRequestReferentialRepository, FileBucketTarCreatorManager fileBucketTarCreatorManager, QueueRepository readWriteQueue, TapeCatalogService tapeCatalogService, java.lang.String outputTarStorageFolder, ArchiveOutputRetentionPolicy archiveOutputRetentionPolicy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
createContainer(java.lang.String containerName)
Creates a containerjava.lang.String
createReadOrderRequest(java.lang.String containerName, java.util.List<java.lang.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(java.lang.String containerName, java.lang.String objectName)
Deletes a object representing the data at location containerName/objectNameContainerInformation
getContainerInformation(java.lang.String containerName)
Get container information like capacityObjectContent
getObject(java.lang.String containerName, java.lang.String objectName)
Retrieves an object representing the data at location containerName/objectNamejava.lang.String
getObjectDigest(java.lang.String containerName, java.lang.String objectName, DigestType algo, boolean noCache)
compute Object Digest using a defined algorithmMetadatasObject
getObjectMetadata(java.lang.String containerName, java.lang.String objectName, boolean noCache)
get metadata of the objectboolean
isExistingContainer(java.lang.String containerName)
Determines if a container existsboolean
isExistingObject(java.lang.String containerName, java.lang.String objectName)
Determines if an object existsvoid
listContainer(java.lang.String containerName, ObjectListingListener objectListingListener)
List container objectsjava.lang.String
putObject(java.lang.String containerName, java.lang.String objectName, java.io.InputStream stream, DigestType digestType, java.lang.Long size)
Adds an object representing the data at location containerName/objectNamevoid
removeReadOrderRequest(java.lang.String readRequestID)
Purge all read request id to cleanup local FS
-
-
-
Constructor Detail
-
TapeLibraryContentAddressableStorage
public TapeLibraryContentAddressableStorage(BasicFileStorage basicFileStorage, ObjectReferentialRepository objectReferentialRepository, ArchiveReferentialRepository archiveReferentialRepository, ReadRequestReferentialRepository readRequestReferentialRepository, FileBucketTarCreatorManager fileBucketTarCreatorManager, QueueRepository readWriteQueue, TapeCatalogService tapeCatalogService, java.lang.String outputTarStorageFolder, ArchiveOutputRetentionPolicy archiveOutputRetentionPolicy)
-
-
Method Detail
-
createContainer
public void createContainer(java.lang.String containerName)
Description copied from interface:ContentAddressableStorage
Creates a container- Specified by:
createContainer
in interfaceContentAddressableStorage
- Parameters:
containerName
- name of container to create
-
isExistingContainer
public boolean isExistingContainer(java.lang.String containerName)
Description copied from interface:ContentAddressableStorage
Determines if a container exists- Specified by:
isExistingContainer
in interfaceContentAddressableStorage
- Parameters:
containerName
- name of container- Returns:
- boolean type
-
putObject
public java.lang.String putObject(java.lang.String containerName, java.lang.String objectName, java.io.InputStream stream, DigestType digestType, java.lang.Long size) throws ContentAddressableStorageException
Description copied from interface:ContentAddressableStorage
Adds an object representing the data at location containerName/objectName- Specified by:
putObject
in interfaceContentAddressableStorage
- Parameters:
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 stream- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageException
- Thrown when put action failed due some other failureContentAddressableStorageAlreadyExistException
- Thrown when object creating exists
-
getObject
public ObjectContent getObject(java.lang.String containerName, java.lang.String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
Description copied from interface:ContentAddressableStorage
Retrieves an object representing the data at location containerName/objectName- Specified by:
getObject
in interfaceContentAddressableStorage
- Parameters:
containerName
- container where this exists.objectName
- fully qualified name relative to the container.- Returns:
- the object you intended to receive
- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
-
createReadOrderRequest
public java.lang.String createReadOrderRequest(java.lang.String containerName, java.util.List<java.lang.String> objectsIds) throws ContentAddressableStorageServerException, ContentAddressableStorageNotFoundException
Description copied from interface:ContentAddressableStorage
Create read order (asynchronous read from tape to local FS) for the given objects representing the data at location containerName/objectId. Return read order entity- Specified by:
createReadOrderRequest
in interfaceContentAddressableStorage
- Parameters:
containerName
- container where this exists.objectsIds
- list of the fully qualified name relative to the container.- Returns:
- read order request id
- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
-
removeReadOrderRequest
public void removeReadOrderRequest(java.lang.String readRequestID) throws ContentAddressableStorageServerException
Description copied from interface:ContentAddressableStorage
Purge all read request id to cleanup local FS- Specified by:
removeReadOrderRequest
in interfaceContentAddressableStorage
- Parameters:
readRequestID
- the read request ID.- Throws:
ContentAddressableStorageServerException
-
deleteObject
public void deleteObject(java.lang.String containerName, java.lang.String objectName) throws ContentAddressableStorageServerException, ContentAddressableStorageNotFoundException
Description copied from interface:ContentAddressableStorage
Deletes a object representing the data at location containerName/objectName- Specified by:
deleteObject
in interfaceContentAddressableStorage
- Parameters:
containerName
- container where this exists.objectName
- fully qualified name relative to the container.- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located or the blob cannot be located in the container.ContentAddressableStorageServerException
-
isExistingObject
public boolean isExistingObject(java.lang.String containerName, java.lang.String objectName) throws ContentAddressableStorageServerException
Description copied from interface:ContentAddressableStorage
Determines if an object exists- Specified by:
isExistingObject
in interfaceContentAddressableStorage
- Parameters:
containerName
- container where the object residesobjectName
- fully qualified name relative to the container.- Returns:
- boolean type
- Throws:
ContentAddressableStorageServerException
- Thrown when internal server error happens
-
getObjectDigest
public java.lang.String getObjectDigest(java.lang.String containerName, java.lang.String objectName, DigestType algo, boolean noCache) throws ContentAddressableStorageException
Description copied from interface:ContentAddressableStorage
compute Object Digest using a defined algorithm- Specified by:
getObjectDigest
in interfaceContentAddressableStorage
- Parameters:
containerName
- container where this exists.objectName
- fully qualified name relative to the container.algo
- Digest algonoCache
- forces full digest computation- Returns:
- the digest object as String
- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container or the object cannot be locatedContentAddressableStorageServerException
- Thrown when internal server error happensContentAddressableStorageException
- Thrown when put action failed due some other failure
-
getContainerInformation
public ContainerInformation getContainerInformation(java.lang.String containerName)
Description copied from interface:ContentAddressableStorage
Get container information like capacity- Specified by:
getContainerInformation
in interfaceContentAddressableStorage
- Parameters:
containerName
- the container name- Returns:
- container information like usableSpace
-
getObjectMetadata
public MetadatasObject getObjectMetadata(java.lang.String containerName, java.lang.String objectName, boolean noCache) throws ContentAddressableStorageException
Description copied from interface:ContentAddressableStorage
get metadata of the object- Specified by:
getObjectMetadata
in interfaceContentAddressableStorage
- Parameters:
containerName
- the container nameobjectName
- the objectId to check- Returns:
- MetadatasObjectResult
- Throws:
ContentAddressableStorageException
- Thrown when get action failed due some other failure
-
listContainer
public void listContainer(java.lang.String containerName, ObjectListingListener objectListingListener) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException, java.io.IOException
Description copied from interface:ContentAddressableStorage
List container objects- Specified by:
listContainer
in interfaceContentAddressableStorage
- Parameters:
containerName
- the container name- Throws:
ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
- Thrown when internal server error happensjava.io.IOException
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-
-