Class DefaultOfferServiceImpl
java.lang.Object
fr.gouv.vitam.storage.offers.core.DefaultOfferServiceImpl
- All Implemented Interfaces:
DefaultOfferService
-
Field Summary
Fields inherited from interface fr.gouv.vitam.storage.offers.core.DefaultOfferService
STORAGE_CONF_FILE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionDefaultOfferServiceImpl(ContentAddressableStorage defaultStorage, OfferLogCompactionDatabaseService offerLogCompactionDatabaseService, OfferLogDatabaseService offerDatabaseService, OfferSequenceDatabaseService offerSequenceDatabaseService, StorageConfiguration configuration, OfferLogCompactionConfiguration offerLogCompactionConfig, OfferLogAndCompactedOfferLogService offerLogAndCompactedOfferLogService, int maxBatchThreadPoolSize, int batchMetadataComputationTimeout, boolean cleanupObjectsOnWriteError) -
Method Summary
Modifier and TypeMethodDescriptionbulkPutObjects(String containerName, List<String> objectIds, MultiplexedStreamReader multiplexedStreamReader, DataCategory type, DigestType digestType) checkAccessRequestStatuses(List<String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed) booleancheckObjectAvailability(String containerName, List<String> objectNames) voidcreateAccessRequest(String containerName, List<String> objectNames) Create access request (asynchronous read from tape to local FS) for the given @containerName and objects list.createObject(String containerName, String objectId, InputStream objectPart, DataCategory type, long size, DigestType digestType) Create object on container with objectId Receive object part of object.voiddeleteObject(String containerName, String objectId, DataCategory type) Deletes a object representing the data at location containerName/objectNamegetBulkMetadata(String containerName, List<String> objectIds, Boolean noCache) getCapacity(String containerName) Get container capacitygetMetadata(String containerName, String objectId, boolean noCache) Get MetadataGet object on offer as an inputStreamgetObjectDigest(String containerName, String objectId, DigestType digestAlgorithm) Get offer storage digest of objectgetOfferLogs(String containerName, Long offset, int limit, Order order) Get the offer log of objects created in offer containerbooleanisObjectExist(String containerName, String objectId) Check if object existsvoidlistObjects(String containerName, ObjectListingListener objectListingListener) List container objectsvoidvoidremoveAccessRequest(String accessRequestId, boolean adminCrossTenantAccessRequestAllowed)
-
Constructor Details
-
DefaultOfferServiceImpl
public DefaultOfferServiceImpl(ContentAddressableStorage defaultStorage, OfferLogCompactionDatabaseService offerLogCompactionDatabaseService, OfferLogDatabaseService offerDatabaseService, OfferSequenceDatabaseService offerSequenceDatabaseService, StorageConfiguration configuration, OfferLogCompactionConfiguration offerLogCompactionConfig, OfferLogAndCompactedOfferLogService offerLogAndCompactedOfferLogService, int maxBatchThreadPoolSize, int batchMetadataComputationTimeout, boolean cleanupObjectsOnWriteError)
-
-
Method Details
-
getObjectDigest
public String getObjectDigest(String containerName, String objectId, DigestType digestAlgorithm) throws ContentAddressableStorageException Description copied from interface:DefaultOfferServiceGet offer storage digest of object- Specified by:
getObjectDigestin interfaceDefaultOfferService- Parameters:
containerName- the container with the objectobjectId- the object name / iddigestAlgorithm- the digest algorithm- Returns:
- the offer computed digest
- Throws:
ContentAddressableStorageException- thrown on storage error
-
getObject
public ObjectContent getObject(String containerName, String objectId) throws ContentAddressableStorageException Description copied from interface:DefaultOfferServiceGet object on offer as an inputStream- Specified by:
getObjectin interfaceDefaultOfferService- Parameters:
containerName- the container containing the objectobjectId- the object id- Returns:
- the object included in a response
- Throws:
ContentAddressableStorageNotFoundException- thrown when object does not existsContentAddressableStorageException- thrown when a server error occurs
-
createAccessRequest
public String createAccessRequest(String containerName, List<String> objectNames) throws ContentAddressableStorageException Description copied from interface:DefaultOfferServiceCreate access request (asynchronous read from tape to local FS) for the given @containerName and objects list. Return access request id- Specified by:
createAccessRequestin interfaceDefaultOfferService- Parameters:
containerName- the container containing the objectobjectNames- the objects ids- Returns:
- acess request id
- Throws:
ContentAddressableStorageNotFoundException- thrown when object does not existsContentAddressableStorageException- thrown when a server error occurs
-
checkAccessRequestStatuses
public Map<String,AccessRequestStatus> checkAccessRequestStatuses(List<String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed) throws ContentAddressableStorageException - Specified by:
checkAccessRequestStatusesin interfaceDefaultOfferService- Throws:
ContentAddressableStorageException
-
removeAccessRequest
public void removeAccessRequest(String accessRequestId, boolean adminCrossTenantAccessRequestAllowed) throws ContentAddressableStorageException - Specified by:
removeAccessRequestin interfaceDefaultOfferService- Throws:
ContentAddressableStorageException
-
checkObjectAvailability
public boolean checkObjectAvailability(String containerName, List<String> objectNames) throws ContentAddressableStorageException - Specified by:
checkObjectAvailabilityin interfaceDefaultOfferService- Throws:
ContentAddressableStorageException
-
createObject
public String createObject(String containerName, String objectId, InputStream objectPart, DataCategory type, long size, DigestType digestType) throws ContentAddressableStorageException Description copied from interface:DefaultOfferServiceCreate object on container with objectId Receive object part of object. Actually these parts HAVE TO be send in the great order.- Specified by:
createObjectin interfaceDefaultOfferService- Parameters:
containerName- the container nameobjectId- the offer objectId to createobjectPart- the part of the object to create (chunk style)type- the object type to createsize- inputstream sizedigestType- digest of object- Returns:
- the digest of the complete file or the digest of the chunk
- Throws:
ContentAddressableStorageException- if the container does not exist
-
bulkPutObjects
public StorageBulkPutResult bulkPutObjects(String containerName, List<String> objectIds, MultiplexedStreamReader multiplexedStreamReader, DataCategory type, DigestType digestType) throws ContentAddressableStorageException, IOException - Specified by:
bulkPutObjectsin interfaceDefaultOfferService- Throws:
ContentAddressableStorageExceptionIOException
-
isObjectExist
public boolean isObjectExist(String containerName, String objectId) throws ContentAddressableStorageException Description copied from interface:DefaultOfferServiceCheck if object exists- Specified by:
isObjectExistin interfaceDefaultOfferService- Parameters:
containerName- the container suppose to contain the objectobjectId- the objectId to check- Returns:
- true if object exists, false otherwise
- Throws:
ContentAddressableStorageServerExceptionContentAddressableStorageException
-
getCapacity
public ContainerInformation getCapacity(String containerName) throws ContentAddressableStorageException Description copied from interface:DefaultOfferServiceGet container capacity- Specified by:
getCapacityin interfaceDefaultOfferService- Parameters:
containerName- the container name- Returns:
- Json with usableSpace information
- Throws:
ContentAddressableStorageNotFoundException- thrown if the container does not existContentAddressableStorageServerExceptionContentAddressableStorageException
-
deleteObject
public void deleteObject(String containerName, String objectId, DataCategory type) throws ContentAddressableStorageException Description copied from interface:DefaultOfferServiceDeletes a object representing the data at location containerName/objectName- Specified by:
deleteObjectin interfaceDefaultOfferService- Parameters:
containerName- container where this exists.objectId- the objectId to deletetype- the object type to delete- Throws:
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 failure
-
getMetadata
public StorageMetadataResult getMetadata(String containerName, String objectId, boolean noCache) throws ContentAddressableStorageException Description copied from interface:DefaultOfferServiceGet Metadata- Specified by:
getMetadatain interfaceDefaultOfferService- Returns:
- StorageMetadataResult
- Throws:
ContentAddressableStorageException
-
getBulkMetadata
public StorageBulkMetadataResult getBulkMetadata(String containerName, List<String> objectIds, Boolean noCache) throws ContentAddressableStorageException - Specified by:
getBulkMetadatain interfaceDefaultOfferService- Throws:
ContentAddressableStorageException
-
listObjects
public void listObjects(String containerName, ObjectListingListener objectListingListener) throws IOException, ContentAddressableStorageException Description copied from interface:DefaultOfferServiceList container objects- Specified by:
listObjectsin interfaceDefaultOfferService- Parameters:
containerName- the container nameobjectListingListener- a listener to which are reported found object entries- Throws:
IOExceptionContentAddressableStorageException
-
getOfferLogs
public List<OfferLog> getOfferLogs(String containerName, Long offset, int limit, Order order) throws ContentAddressableStorageDatabaseException Description copied from interface:DefaultOfferServiceGet the offer log of objects created in offer container- Specified by:
getOfferLogsin interfaceDefaultOfferService- Parameters:
containerName- container the container nameoffset- the offset of the object before the wanted listlimit- number of objects wantedorder- order of search- Returns:
- list of object informations
- Throws:
ContentAddressableStorageDatabaseException- Database error
-
compactOfferLogs
- Specified by:
compactOfferLogsin interfaceDefaultOfferService- Throws:
Exception
-
log
-