public class DefaultOfferServiceImpl extends Object implements DefaultOfferService
STORAGE_CONF_FILE_NAME| Constructor and Description |
|---|
DefaultOfferServiceImpl(OfferLogDatabaseService offerDatabaseService,
MongoDbAccess mongoDBAccess) |
| Modifier and Type | Method and Description |
|---|---|
StorageBulkPutResult |
bulkPutObjects(String containerName,
List<String> objectIds,
MultiplexedStreamReader multiplexedStreamReader,
DataCategory type,
DigestType digestType) |
String |
createCursor(String containerName)
Create a new cursor for listing container operation
|
String |
createObject(String containerName,
String objectId,
InputStream objectPart,
DataCategory type,
Long size,
DigestType digestType)
Create object on container with objectId Receive object part of object.
|
Optional<TapeReadRequestReferentialEntity> |
createReadOrderRequest(String containerName,
List<String> objectsIds)
create read order (asynchronous read from tape to local FS) for the given @containerName and objects list.
|
void |
deleteObject(String containerName,
String objectId,
DataCategory type)
Deletes a object representing the data at location containerName/objectName
|
void |
finalizeCursor(String containerName,
String cursorId)
Close the cursor
|
ContainerInformation |
getCapacity(String containerName)
Get container capacity
|
StorageMetadataResult |
getMetadata(String containerName,
String objectId,
boolean noCache)
Get Metadata
|
ObjectContent |
getObject(String containerName,
String objectId)
Get object on offer as an inputStream
|
String |
getObjectDigest(String containerName,
String objectId,
DigestType digestAlgorithm)
Get offer storage digest of object
|
List<OfferLog> |
getOfferLogs(String containerName,
Long offset,
int limit,
Order order)
Get the offer log of objects created in offer container
|
Optional<TapeReadRequestReferentialEntity> |
getReadOrderRequest(String readRequestID) |
boolean |
hasNext(String containerName,
String cursorId)
Check if iterator have a next value
|
boolean |
isObjectExist(String containerName,
String objectId)
Check if object exists
|
List<com.fasterxml.jackson.databind.JsonNode> |
next(String containerName,
String cursorId)
Get next values
|
void |
removeReadOrderRequest(String readRequestID) |
public DefaultOfferServiceImpl(OfferLogDatabaseService offerDatabaseService, MongoDbAccess mongoDBAccess) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, KeyManagementException
public String getObjectDigest(String containerName, String objectId, DigestType digestAlgorithm) throws ContentAddressableStorageException
DefaultOfferServicegetObjectDigest in interface DefaultOfferServicecontainerName - the container with the objectobjectId - the object name / iddigestAlgorithm - the digest algorithmContentAddressableStorageException - thrown on storage errorpublic ObjectContent getObject(String containerName, String objectId) throws ContentAddressableStorageException
DefaultOfferServicegetObject in interface DefaultOfferServicecontainerName - the container containing the objectobjectId - the object idContentAddressableStorageNotFoundException - thrown when object does not existsContentAddressableStorageException - thrown when a server error occurspublic Optional<TapeReadRequestReferentialEntity> createReadOrderRequest(String containerName, List<String> objectsIds) throws ContentAddressableStorageException
DefaultOfferServicecreateReadOrderRequest in interface DefaultOfferServicecontainerName - the container containing the objectobjectsIds - the objects idsContentAddressableStorageNotFoundException - thrown when object does not existsContentAddressableStorageException - thrown when a server error occurspublic Optional<TapeReadRequestReferentialEntity> getReadOrderRequest(String readRequestID) throws ContentAddressableStorageException
getReadOrderRequest in interface DefaultOfferServiceContentAddressableStorageExceptionpublic void removeReadOrderRequest(String readRequestID) throws ContentAddressableStorageException
removeReadOrderRequest in interface DefaultOfferServiceContentAddressableStorageExceptionpublic String createObject(String containerName, String objectId, InputStream objectPart, DataCategory type, Long size, DigestType digestType) throws ContentAddressableStorageException
DefaultOfferServicecreateObject in interface DefaultOfferServicecontainerName - 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 objectContentAddressableStorageException - if the container does not existpublic StorageBulkPutResult bulkPutObjects(String containerName, List<String> objectIds, MultiplexedStreamReader multiplexedStreamReader, DataCategory type, DigestType digestType) throws ContentAddressableStorageException, IOException
bulkPutObjects in interface DefaultOfferServiceContentAddressableStorageExceptionIOExceptionpublic boolean isObjectExist(String containerName, String objectId) throws ContentAddressableStorageServerException
DefaultOfferServiceisObjectExist in interface DefaultOfferServicecontainerName - the container suppose to contain the objectobjectId - the objectId to checkContentAddressableStorageServerExceptionpublic ContainerInformation getCapacity(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
DefaultOfferServicegetCapacity in interface DefaultOfferServicecontainerName - the container nameContentAddressableStorageNotFoundException - thrown if the container does not existContentAddressableStorageServerExceptionpublic void deleteObject(String containerName, String objectId, DataCategory type) throws ContentAddressableStorageException
DefaultOfferServicedeleteObject in interface DefaultOfferServicecontainerName - container where this exists.objectId - the objectId to deletetype - the object type to deleteContentAddressableStorageNotFoundException - 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 failurepublic StorageMetadataResult getMetadata(String containerName, String objectId, boolean noCache) throws ContentAddressableStorageException, IOException
DefaultOfferServicegetMetadata in interface DefaultOfferServiceContentAddressableStorageExceptionIOExceptionpublic String createCursor(String containerName) throws ContentAddressableStorageServerException
DefaultOfferServicecreateCursor in interface DefaultOfferServicecontainerName - the container nameContentAddressableStorageServerException - thrown when delete action failed due some other failurepublic boolean hasNext(String containerName, String cursorId)
DefaultOfferServicehasNext in interface DefaultOfferServicecontainerName - the container namecursorId - the cursor IDpublic List<com.fasterxml.jackson.databind.JsonNode> next(String containerName, String cursorId) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
DefaultOfferServicenext in interface DefaultOfferServicecontainerName - the container namecursorId - the cursor IDContentAddressableStorageNotFoundException - thrown when the container cannot be locatedContentAddressableStorageServerExceptionpublic void finalizeCursor(String containerName, String cursorId)
DefaultOfferServicefinalizeCursor in interface DefaultOfferServicecontainerName - the container namecursorId - the cursor IDpublic List<OfferLog> getOfferLogs(String containerName, Long offset, int limit, Order order) throws ContentAddressableStorageDatabaseException, ContentAddressableStorageServerException
DefaultOfferServicegetOfferLogs in interface DefaultOfferServicecontainerName - container the container nameoffset - the offset of the object before the wanted listlimit - number of objects wantedorder - order of searchContentAddressableStorageDatabaseException - Database errorContentAddressableStorageServerException - Parsing errorCopyright © 2019 Vitam. All rights reserved.