public class StorageDistributionImpl extends Object implements StorageDistribution
| Modifier and Type | Field and Description |
|---|---|
static String |
CATEGORY_IS_MANDATORY |
| Constructor and Description |
|---|
StorageDistributionImpl(StorageConfiguration configuration,
StorageLogService storageLogService)
Constructs the service with a given configuration
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkObjectExisting(String strategyId,
String objectId,
List<String> offerIds)
Verify if object exists
|
void |
close() |
com.fasterxml.jackson.databind.JsonNode |
createContainer(String strategyId)
Create a container Architects are aware of this.
|
void |
deleteContainer(String strategyId)
Delete a container
|
void |
deleteLogbook(String strategyId,
String logbookId)
Delete a logbook
|
void |
deleteObject(String strategyId,
String objectId,
String digest,
DigestType digestAlgorithm)
Delete an object
|
void |
deleteObjectGroup(String strategyId,
String objectGroupId)
Delete an ObjectGroup
|
void |
deleteUnit(String strategyId,
String unitId)
Delete an unit
|
javax.ws.rs.core.Response |
getContainerByCategory(String strategyId,
String objectId,
DataCategory category)
Get a specific Object binary data as an input stream
|
com.fasterxml.jackson.databind.JsonNode |
getContainerInformations(String strategyId)
Get Storage Information (availability and capacity) for the requested
tenant + strategy
|
com.fasterxml.jackson.databind.JsonNode |
getContainerInformations(String strategyId,
DataCategory type,
String objectId,
List<String> offerIds)
Get a specific Object information
|
com.fasterxml.jackson.databind.JsonNode |
getContainerLogbook(String strategyId,
String logbookId)
Get a specific Logbook as a JsonNode
|
com.fasterxml.jackson.databind.JsonNode |
getContainerLogbooks(String strategyId)
Retrieve a list of logbook ids associated to a given tenant
|
com.fasterxml.jackson.databind.JsonNode |
getContainerObjectGroup(String strategyId,
String objectGroupId)
Get a specific ObjectGroup as a JsonNode
|
com.fasterxml.jackson.databind.JsonNode |
getContainerObjectGroups(String strategyId)
Get Container ObjectGroups Information
|
com.fasterxml.jackson.databind.JsonNode |
getContainerUnit(String strategyId,
String unitId)
Get a specific Unit as a JsonNode
|
com.fasterxml.jackson.databind.JsonNode |
getContainerUnits(String strategyId)
Get Container Units Information
|
RequestResponse<OfferLog> |
getOfferLogs(String strategyId,
DataCategory category,
Long offset,
int limit,
Order order)
Get offer log from referent
|
InputStream |
getStorageContainer(String strategyId)
Get Storage Container full content as an InputStream
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
listContainerObjects(String strategyId,
DataCategory category,
String cursorId)
List container objects
|
com.fasterxml.jackson.databind.JsonNode |
status()
Get the status from the service
|
StoredInfoResult |
storeData(String strategyId,
String objectId,
ObjectDescription createObjectDescription,
DataCategory category,
String requester)
Store data of any type for given tenant on storage offers associated to
given strategy
|
public static final String CATEGORY_IS_MANDATORY
public StorageDistributionImpl(StorageConfiguration configuration, StorageLogService storageLogService)
configuration - the configuration of the storagestorageLogService - public StoredInfoResult storeData(String strategyId, String objectId, ObjectDescription createObjectDescription, DataCategory category, String requester) throws StorageException
StorageDistributionstoreData in interface StorageDistributionstrategyId - id of the strategyobjectId - the workspace URI of the data to be retrieve (and stored in
offer)createObjectDescription - object additional informationscategory - the category of the data to store (unit, object...)requester - the requester informationStorageNotFoundException - Thrown if the Container does not existStorageTechnicalException - Thrown in case of any technical problemStorageExceptionpublic com.fasterxml.jackson.databind.JsonNode getContainerInformations(String strategyId) throws StorageException
StorageDistributiongetContainerInformations in interface StorageDistributionstrategyId - id of the strategyStorageNotFoundException - Thrown if the Container does not existStorageTechnicalException - Thrown in case of any technical problemStorageExceptionpublic InputStream getStorageContainer(String strategyId) throws StorageNotFoundException, StorageTechnicalException
StorageDistributiongetStorageContainer in interface StorageDistributionstrategyId - id of the strategyStorageNotFoundException - Thrown if the Storage Container does not existStorageTechnicalException - Thrown if a technical exception is encounteredpublic com.fasterxml.jackson.databind.JsonNode createContainer(String strategyId) throws UnsupportedOperationException
StorageDistributioncreateContainer in interface StorageDistributionstrategyId - id of the strategyUnsupportedOperationExceptionpublic void deleteContainer(String strategyId) throws UnsupportedOperationException
StorageDistributionaware of this.
deleteContainer in interface StorageDistributionstrategyId - id of the strategyUnsupportedOperationExceptionpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> listContainerObjects(String strategyId, DataCategory category, String cursorId) throws StorageException
StorageDistributionlistContainerObjects in interface StorageDistributionstrategyId - the strategy id to get offerscategory - the object type to listcursorId - the cursorId if existsStorageException - thrown in case of any technical problempublic RequestResponse<OfferLog> getOfferLogs(String strategyId, DataCategory category, Long offset, int limit, Order order) throws StorageException
StorageDistributiongetOfferLogs in interface StorageDistributionstrategyId - the strategy id to get offerscategory - the object type to listoffset - offset of the excluded objectlimit - the number of result wantedorder - orderStorageException - thrown in case of any technical problempublic javax.ws.rs.core.Response getContainerByCategory(String strategyId, String objectId, DataCategory category) throws StorageException
StorageDistributiongetContainerByCategory in interface StorageDistributionstrategyId - id of the strategyobjectId - id of the objectStorageNotFoundException - Thrown if the Container or the object does not existStorageTechnicalException - thrown if a technical error happenedStorageExceptionpublic com.fasterxml.jackson.databind.JsonNode getContainerInformations(String strategyId, DataCategory type, String objectId, List<String> offerIds) throws StorageException
StorageDistributiongetContainerInformations in interface StorageDistributionstrategyId - id of the strategytype - data categoryobjectId - id of the objectofferIds - list id of offersStorageExceptionpublic boolean checkObjectExisting(String strategyId, String objectId, List<String> offerIds) throws StorageException
StorageDistributioncheckObjectExisting in interface StorageDistributionstrategyId - id of the strategyobjectId - id of the objectofferIds - list id of offersStorageExceptionpublic void deleteObject(String strategyId, String objectId, String digest, DigestType digestAlgorithm) throws StorageException
StorageDistributiondeleteObject in interface StorageDistributionstrategyId - id of the strategyobjectId - id of the object to be deleteddigest - the digest to be compared withdigestAlgorithm - the digest AlgorithmStorageNotFoundException - Thrown if the Container or the object does not existStorageTechnicalException - thrown if a technical error happenedStorageExceptionpublic com.fasterxml.jackson.databind.JsonNode getContainerLogbooks(String strategyId) throws UnsupportedOperationException
StorageDistributiongetContainerLogbooks in interface StorageDistributionstrategyId - id of the strategyUnsupportedOperationExceptionpublic com.fasterxml.jackson.databind.JsonNode getContainerLogbook(String strategyId, String logbookId) throws UnsupportedOperationException
StorageDistributiongetContainerLogbook in interface StorageDistributionstrategyId - id of the strategylogbookId - id of the logbookUnsupportedOperationExceptionpublic void deleteLogbook(String strategyId, String logbookId) throws UnsupportedOperationException
StorageDistributiondeleteLogbook in interface StorageDistributionstrategyId - id of the strategylogbookId - id of the logbook to be deletedUnsupportedOperationException - method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode getContainerUnits(String strategyId) throws UnsupportedOperationException
StorageDistributiongetContainerUnits in interface StorageDistributionstrategyId - id of the strategyUnsupportedOperationException - method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode getContainerUnit(String strategyId, String unitId) throws UnsupportedOperationException
StorageDistributiongetContainerUnit in interface StorageDistributionstrategyId - id of the strategyunitId - id of the unitUnsupportedOperationException - method not implemented yetpublic void deleteUnit(String strategyId, String unitId) throws UnsupportedOperationException
StorageDistributiondeleteUnit in interface StorageDistributionstrategyId - id of the strategyunitId - id of the Unit to be deletedUnsupportedOperationException - method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode getContainerObjectGroups(String strategyId) throws UnsupportedOperationException
StorageDistributiongetContainerObjectGroups in interface StorageDistributionstrategyId - id of the strategyUnsupportedOperationException - method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode getContainerObjectGroup(String strategyId, String objectGroupId) throws UnsupportedOperationException
StorageDistributiongetContainerObjectGroup in interface StorageDistributionstrategyId - id of the strategyobjectGroupId - id of the ObjectGroupUnsupportedOperationException - method not implemented yetpublic void deleteObjectGroup(String strategyId, String objectGroupId) throws UnsupportedOperationException
StorageDistributiondeleteObjectGroup in interface StorageDistributionstrategyId - id of the strategyobjectGroupId - id of the ObjectGroup to be deletedUnsupportedOperationException - method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode status()
StorageDistributionstatus in interface StorageDistributionpublic void close()
close in interface VitamAutoCloseableclose in interface AutoCloseableCopyright © 2018 Vitam. All rights reserved.