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
DefaultOfferService
getObjectDigest
in interface DefaultOfferService
containerName
- the container with the objectobjectId
- the object name / iddigestAlgorithm
- the digest algorithmContentAddressableStorageException
- thrown on storage errorpublic ObjectContent getObject(String containerName, String objectId) throws ContentAddressableStorageException
DefaultOfferService
getObject
in interface DefaultOfferService
containerName
- 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
DefaultOfferService
createReadOrderRequest
in interface DefaultOfferService
containerName
- 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 DefaultOfferService
ContentAddressableStorageException
public void removeReadOrderRequest(String readRequestID) throws ContentAddressableStorageException
removeReadOrderRequest
in interface DefaultOfferService
ContentAddressableStorageException
public String createObject(String containerName, String objectId, InputStream objectPart, DataCategory type, Long size, DigestType digestType) throws ContentAddressableStorageException
DefaultOfferService
createObject
in interface DefaultOfferService
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 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 DefaultOfferService
ContentAddressableStorageException
IOException
public boolean isObjectExist(String containerName, String objectId) throws ContentAddressableStorageServerException
DefaultOfferService
isObjectExist
in interface DefaultOfferService
containerName
- the container suppose to contain the objectobjectId
- the objectId to checkContentAddressableStorageServerException
public ContainerInformation getCapacity(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
DefaultOfferService
getCapacity
in interface DefaultOfferService
containerName
- the container nameContentAddressableStorageNotFoundException
- thrown if the container does not existContentAddressableStorageServerException
public void deleteObject(String containerName, String objectId, DataCategory type) throws ContentAddressableStorageException
DefaultOfferService
deleteObject
in interface DefaultOfferService
containerName
- 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
DefaultOfferService
getMetadata
in interface DefaultOfferService
ContentAddressableStorageException
IOException
public String createCursor(String containerName) throws ContentAddressableStorageServerException
DefaultOfferService
createCursor
in interface DefaultOfferService
containerName
- the container nameContentAddressableStorageServerException
- thrown when delete action failed due some other failurepublic boolean hasNext(String containerName, String cursorId)
DefaultOfferService
hasNext
in interface DefaultOfferService
containerName
- the container namecursorId
- the cursor IDpublic List<com.fasterxml.jackson.databind.JsonNode> next(String containerName, String cursorId) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
DefaultOfferService
next
in interface DefaultOfferService
containerName
- the container namecursorId
- the cursor IDContentAddressableStorageNotFoundException
- thrown when the container cannot be locatedContentAddressableStorageServerException
public void finalizeCursor(String containerName, String cursorId)
DefaultOfferService
finalizeCursor
in interface DefaultOfferService
containerName
- the container namecursorId
- the cursor IDpublic List<OfferLog> getOfferLogs(String containerName, Long offset, int limit, Order order) throws ContentAddressableStorageDatabaseException, ContentAddressableStorageServerException
DefaultOfferService
getOfferLogs
in interface DefaultOfferService
containerName
- 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.