public class StorageDistributionImpl extends Object implements StorageDistribution
| Constructor and Description |
|---|
StorageDistributionImpl(StorageConfiguration configuration,
StorageLog storageLogService)
Constructs the service with a given configuration
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkObjectExisting(String strategyId,
String objectId,
DataCategory category,
List<String> offerIds)
Verify if object exists
|
void |
close() |
StoredInfoResult |
copyObjectFromOfferToOffer(DataContext context,
String sourceOffer,
String destinationOffer)
copy object from on offer to an another
|
com.fasterxml.jackson.databind.JsonNode |
createContainer(String strategyId)
Create a container Architects are aware of this.
|
void |
deleteObjectInAllOffers(String strategyId,
DataContext context)
Delete an object
|
void |
deleteObjectInOffers(String strategyId,
DataContext context,
List<String> offers)
Delete an object in offers
|
javax.ws.rs.core.Response |
getContainerByCategory(String strategyId,
String objectId,
DataCategory category,
AccessLogInfoModel logInformation)
Get a specific Object binary data as an input stream
|
javax.ws.rs.core.Response |
getContainerByCategory(String strategyId,
String objectId,
DataCategory category,
String offerId)
Get a specific Object binary data as an input stream
|
com.fasterxml.jackson.databind.JsonNode |
getContainerInformation(String strategyId)
Get Storage Information (availability and capacity) for the requested
tenant + strategy
|
com.fasterxml.jackson.databind.JsonNode |
getContainerInformation(String strategyId,
DataCategory type,
String objectId,
List<String> offerIds)
Get a specific Object information
|
List<String> |
getOfferIds(String strategyId)
get offer ids list
|
RequestResponse<OfferLog> |
getOfferLogs(String strategyId,
DataCategory category,
Long offset,
int limit,
Order order)
Get offer log from referent
|
RequestResponse<OfferLog> |
getOfferLogsByOfferId(String strategyId,
String offerId,
DataCategory category,
Long offset,
int limit,
Order order)
Get offer log from the given offer
|
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 |
storeDataInAllOffers(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
|
StoredInfoResult |
storeDataInOffers(String strategyId,
StreamAndInfo streamAndInfo,
String objectId,
DataCategory category,
String requester,
List<String> offerIds) |
StoredInfoResult |
storeDataInOffers(String strategyId,
String objectId,
DataCategory category,
String requester,
List<String> offerIds,
javax.ws.rs.core.Response response)
Store data of any type for given tenant on the given storage offer.
|
public static final String DIGEST
public StorageDistributionImpl(StorageConfiguration configuration, StorageLog storageLogService)
configuration - the configuration of the storagestorageLogService - service that allow write and access logpublic StoredInfoResult copyObjectFromOfferToOffer(DataContext context, String sourceOffer, String destinationOffer) throws StorageException
StorageDistributioncopyObjectFromOfferToOffer in interface StorageDistributioncontext - the contextsourceOffer - source offerdestinationOffer - destination OfferStorageException - StorageExceptionpublic StoredInfoResult storeDataInOffers(String strategyId, String objectId, DataCategory category, String requester, List<String> offerIds, javax.ws.rs.core.Response response) throws StorageException
StorageDistributionstoreDataInOffers in interface StorageDistributionstrategyId - id of the strategyobjectId - the workspace URI of the data to be retrieve (and stored incategory - the category of the data to store (unit, object...)requester - the requester informationofferIds - offer identfierresponse - the responseStorageException - StorageExceptionpublic StoredInfoResult storeDataInOffers(String strategyId, StreamAndInfo streamAndInfo, String objectId, DataCategory category, String requester, List<String> offerIds) throws StorageException
storeDataInOffers in interface StorageDistributionstrategyId - id of the strategystreamAndInfo - streamAndInfoobjectId - id of the objectcategory - the object type to listrequester - the requester informationofferIds - offer identfiersStorageException - StorageExceptionpublic StoredInfoResult storeDataInAllOffers(String strategyId, String objectId, ObjectDescription createObjectDescription, DataCategory category, String requester) throws StorageException
StorageDistributionstoreDataInAllOffers 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 informationStorageException - StorageExceptionpublic List<String> getOfferIds(String strategyId) throws StorageException
StorageDistributiongetOfferIds in interface StorageDistributionstrategyId - strategy idStorageExceptionpublic com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId) throws StorageException
StorageDistributiongetContainerInformation in interface StorageDistributionstrategyId - id of the strategyStorageNotFoundException - Thrown if the Container does not existStorageTechnicalException - Thrown in case of any technical problemStorageExceptionpublic com.fasterxml.jackson.databind.JsonNode createContainer(String strategyId) throws UnsupportedOperationException
StorageDistributioncreateContainer 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 RequestResponse<OfferLog> getOfferLogsByOfferId(String strategyId, String offerId, DataCategory category, Long offset, int limit, Order order) throws StorageException
getOfferLogsByOfferId in interface StorageDistributionstrategyId - the strategy id to get offersofferId - offerIdcategory - 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, AccessLogInfoModel logInformation) throws StorageException
StorageDistributiongetContainerByCategory in interface StorageDistributionstrategyId - id of the strategyobjectId - id of the objectcategory - category of the objectlogInformation - information for accessLogStorageNotFoundException - Thrown if the Container or the object does not existStorageTechnicalException - thrown if a technical error happenedStorageExceptionpublic javax.ws.rs.core.Response getContainerByCategory(String strategyId, String objectId, DataCategory category, String offerId) throws StorageException
StorageDistributiongetContainerByCategory in interface StorageDistributionstrategyId - id of the strategyobjectId - id of the objectcategory - categoryofferId - offer identfierStorageNotFoundException - Thrown if the Container or the object does not existStorageTechnicalException - thrown if a technical error happenedStorageExceptionpublic com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId, DataCategory type, String objectId, List<String> offerIds) throws StorageException
StorageDistributiongetContainerInformation in interface StorageDistributionstrategyId - id of the strategytype - data categoryobjectId - id of the objectofferIds - list id of offersStorageExceptionpublic boolean checkObjectExisting(String strategyId, String objectId, DataCategory category, List<String> offerIds) throws StorageException
checkObjectExisting in interface StorageDistributionstrategyId - id of the strategyobjectId - id of the objectcategory - categoryofferIds - list id of offers @returnStorageException - StorageExceptionpublic void deleteObjectInAllOffers(String strategyId, DataContext context) throws StorageException
StorageDistributiondeleteObjectInAllOffers in interface StorageDistributionstrategyId - id of the strategyStorageNotFoundException - Thrown if the Container or the object does not existStorageTechnicalException - thrown if a technical error happenedStorageExceptionpublic void deleteObjectInOffers(String strategyId, DataContext context, List<String> offers) throws StorageException
StorageDistributiondeleteObjectInOffers in interface StorageDistributionstrategyId - id of the strategycontext - contextoffers - offersStorageNotFoundException - Thrown if the Container or the object does not existStorageTechnicalException - thrown if a technical error happenedStorageExceptionpublic com.fasterxml.jackson.databind.JsonNode status()
StorageDistributionstatus in interface StorageDistributionpublic void close()
close in interface VitamAutoCloseableclose in interface AutoCloseableCopyright © 2018 Vitam. All rights reserved.