public class DefaultOfferServiceImpl extends Object implements DefaultOfferService
| Constructor and Description |
|---|
DefaultOfferServiceImpl(OfferLogDatabaseService offerDatabaseService) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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
|
com.fasterxml.jackson.databind.JsonNode |
getCapacity(String containerName)
Get container capacity
|
StorageMetadataResult |
getMetadatas(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
|
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
|
public DefaultOfferServiceImpl(OfferLogDatabaseService offerDatabaseService) 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 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 boolean isObjectExist(String containerName, String objectId) throws ContentAddressableStorageServerException
DefaultOfferServiceisObjectExist in interface DefaultOfferServicecontainerName - the container suppose to contain the objectobjectId - the objectId to checkContentAddressableStorageServerExceptionpublic com.fasterxml.jackson.databind.JsonNode 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 getMetadatas(String containerName, String objectId, boolean noCache) throws ContentAddressableStorageException, IOException
DefaultOfferServicegetMetadatas 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 © 2020 Vitam. All rights reserved.