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, AccessRequestManager accessRequestManager, FileBucketTarCreatorManager fileBucketTarCreatorManager, ArchiveCacheStorage archiveCacheStorage, ArchiveCacheEvictionController archiveCacheEvictionController, BucketTopologyHelper bucketTopologyHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,AccessRequestStatus>checkAccessRequestStatuses(java.util.List<java.lang.String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed)Checks status of access requests by id.booleancheckObjectAvailability(java.lang.String containerName, java.util.List<java.lang.String> objectNames)Check object availability for async offers.voidcheckObjectDigestAndStoreDigest(java.lang.String containerName, java.lang.String objectName, java.lang.String objectDigest, DigestType digestType, long size)Checks objet digest & update persist its digest in object metadatavoidclose()java.lang.StringcreateAccessRequest(java.lang.String containerName, java.util.List<java.lang.String> objectsNames)Create an access request for objects (asynchronous read from tape to local FS).voidcreateContainer(java.lang.String containerName)Creates a containervoiddeleteObject(java.lang.String containerName, java.lang.String objectName)Deletes a object representing the data at location containerName/objectNameContainerInformationgetContainerInformation(java.lang.String containerName)Get container information like capacityObjectContentgetObject(java.lang.String containerName, java.lang.String objectName)Retrieves an object representing the data at location containerName/objectNamejava.lang.StringgetObjectDigest(java.lang.String containerName, java.lang.String objectName, DigestType algo, boolean noCache)compute Object Digest using a defined algorithmMetadatasObjectgetObjectMetadata(java.lang.String containerName, java.lang.String objectName, boolean noCache)get metadata of the objectbooleanisExistingContainer(java.lang.String containerName)Determines if a container existsbooleanisExistingObject(java.lang.String containerName, java.lang.String objectName)Determines if an object existsvoidlistContainer(java.lang.String containerName, ObjectListingListener objectListingListener)List container objectsvoidremoveAccessRequest(java.lang.String accessRequestId, boolean adminCrossTenantAccessRequestAllowed)Delete access request.voidwriteObject(java.lang.String containerName, java.lang.String objectName, java.io.InputStream inputStream, DigestType digestType, long size)Adds an object representing the data at location containerName/objectName-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorage
putObject
-
-
-
-
Constructor Detail
-
TapeLibraryContentAddressableStorage
public TapeLibraryContentAddressableStorage(BasicFileStorage basicFileStorage, ObjectReferentialRepository objectReferentialRepository, ArchiveReferentialRepository archiveReferentialRepository, AccessRequestManager accessRequestManager, FileBucketTarCreatorManager fileBucketTarCreatorManager, ArchiveCacheStorage archiveCacheStorage, ArchiveCacheEvictionController archiveCacheEvictionController, BucketTopologyHelper bucketTopologyHelper)
-
-
Method Detail
-
createContainer
public void createContainer(java.lang.String containerName)
Description copied from interface:ContentAddressableStorageCreates a container- Specified by:
createContainerin interfaceContentAddressableStorage- Parameters:
containerName- name of container to create
-
isExistingContainer
public boolean isExistingContainer(java.lang.String containerName)
Description copied from interface:ContentAddressableStorageDetermines if a container exists- Specified by:
isExistingContainerin interfaceContentAddressableStorage- Parameters:
containerName- name of container- Returns:
- boolean type
-
writeObject
public void writeObject(java.lang.String containerName, java.lang.String objectName, java.io.InputStream inputStream, DigestType digestType, long size) throws ContentAddressableStorageExceptionDescription copied from interface:ContentAddressableStorageAdds an object representing the data at location containerName/objectName- Specified by:
writeObjectin interfaceContentAddressableStorage- Parameters:
containerName- container to place the object.objectName- fully qualified object name relative to the container.inputStream- 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
-
checkObjectDigestAndStoreDigest
public void checkObjectDigestAndStoreDigest(java.lang.String containerName, java.lang.String objectName, java.lang.String objectDigest, DigestType digestType, long size)Description copied from interface:ContentAddressableStorageChecks objet digest & update persist its digest in object metadata- Specified by:
checkObjectDigestAndStoreDigestin interfaceContentAddressableStorage- Parameters:
containerName- container to place the object.objectName- fully qualified object name relative to the container.objectDigest- object digest valuedigestType- object digest typesize- size off the input stream
-
getObject
public ObjectContent getObject(java.lang.String containerName, java.lang.String objectName) throws ContentAddressableStorageException
Description copied from interface:ContentAddressableStorageRetrieves an object representing the data at location containerName/objectName- Specified by:
getObjectin 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.ContentAddressableStorageUnavailableDataFromAsyncOfferException- Thrown when object cannot be read due to missing access request on AsyncRead ContentAddressableStorageContentAddressableStorageException- Thrown when get action failed due some other failure
-
createAccessRequest
public java.lang.String createAccessRequest(java.lang.String containerName, java.util.List<java.lang.String> objectsNames) throws ContentAddressableStorageExceptionDescription copied from interface:ContentAddressableStorageCreate an access request for objects (asynchronous read from tape to local FS). Return access request identifier- Specified by:
createAccessRequestin interfaceContentAddressableStorage- Parameters:
containerName- container where this exists.objectsNames- list of objects names for which access is requested- Returns:
- access request identifier
- Throws:
ContentAddressableStorageException
-
checkAccessRequestStatuses
public java.util.Map<java.lang.String,AccessRequestStatus> checkAccessRequestStatuses(java.util.List<java.lang.String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed) throws ContentAddressableStorageException
Description copied from interface:ContentAddressableStorageChecks status of access requests by id.- Specified by:
checkAccessRequestStatusesin interfaceContentAddressableStorage- Parameters:
accessRequestIds- the identifiers of the access requests to checkadminCrossTenantAccessRequestAllowed- whentrue, access to access requests of other tenants is allowed from Admin tenant- Returns:
AccessRequestStatusrepresenting access request status- Throws:
ContentAddressableStorageException
-
removeAccessRequest
public void removeAccessRequest(java.lang.String accessRequestId, boolean adminCrossTenantAccessRequestAllowed) throws ContentAddressableStorageExceptionDescription copied from interface:ContentAddressableStorageDelete access request. Ignored if no access request found (not exists, expired or already canceled).- Specified by:
removeAccessRequestin interfaceContentAddressableStorage- Parameters:
accessRequestId- the identifier of the access request to cancel.adminCrossTenantAccessRequestAllowed- whentrue, removing access requests of other tenants is allowed from Admin tenant- Throws:
ContentAddressableStorageException
-
checkObjectAvailability
public boolean checkObjectAvailability(java.lang.String containerName, java.util.List<java.lang.String> objectNames) throws ContentAddressableStorageExceptionDescription copied from interface:ContentAddressableStorageCheck object availability for async offers.- Specified by:
checkObjectAvailabilityin interfaceContentAddressableStorage- Parameters:
containerName- container where this exists.objectNames- list of objects names for which availability is to be checked.- Returns:
trueif ALL objects are available, otherwisefalse.- Throws:
ContentAddressableStorageException
-
deleteObject
public void deleteObject(java.lang.String containerName, java.lang.String objectName) throws ContentAddressableStorageServerException, ContentAddressableStorageNotFoundExceptionDescription copied from interface:ContentAddressableStorageDeletes a object representing the data at location containerName/objectName- Specified by:
deleteObjectin 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 ContentAddressableStorageServerExceptionDescription copied from interface:ContentAddressableStorageDetermines if an object exists- Specified by:
isExistingObjectin 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 ContentAddressableStorageExceptionDescription copied from interface:ContentAddressableStoragecompute Object Digest using a defined algorithm- Specified by:
getObjectDigestin 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:ContentAddressableStorageGet container information like capacity- Specified by:
getContainerInformationin 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:ContentAddressableStorageget metadata of the object- Specified by:
getObjectMetadatain 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 ContentAddressableStorageServerException, java.io.IOExceptionDescription copied from interface:ContentAddressableStorageList container objects- Specified by:
listContainerin interfaceContentAddressableStorage- Parameters:
containerName- the container name- Throws:
ContentAddressableStorageServerException- Thrown when internal server error happensjava.io.IOException
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceVitamAutoCloseable
-
-