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
StorageDistribution
copyObjectFromOfferToOffer
in interface StorageDistribution
context
- 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
StorageDistribution
storeDataInOffers
in interface StorageDistribution
strategyId
- 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 StorageDistribution
strategyId
- 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
StorageDistribution
storeDataInAllOffers
in interface StorageDistribution
strategyId
- 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
StorageDistribution
getOfferIds
in interface StorageDistribution
strategyId
- strategy idStorageException
public com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId) throws StorageException
StorageDistribution
getContainerInformation
in interface StorageDistribution
strategyId
- id of the strategyStorageNotFoundException
- Thrown if the Container does not existStorageTechnicalException
- Thrown in case of any technical problemStorageException
public com.fasterxml.jackson.databind.JsonNode createContainer(String strategyId) throws UnsupportedOperationException
StorageDistribution
createContainer
in interface StorageDistribution
strategyId
- id of the strategyUnsupportedOperationException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> listContainerObjects(String strategyId, DataCategory category, String cursorId) throws StorageException
StorageDistribution
listContainerObjects
in interface StorageDistribution
strategyId
- 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
StorageDistribution
getOfferLogs
in interface StorageDistribution
strategyId
- 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 StorageDistribution
strategyId
- 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
StorageDistribution
getContainerByCategory
in interface StorageDistribution
strategyId
- 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 happenedStorageException
public javax.ws.rs.core.Response getContainerByCategory(String strategyId, String objectId, DataCategory category, String offerId) throws StorageException
StorageDistribution
getContainerByCategory
in interface StorageDistribution
strategyId
- 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 happenedStorageException
public com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId, DataCategory type, String objectId, List<String> offerIds) throws StorageException
StorageDistribution
getContainerInformation
in interface StorageDistribution
strategyId
- id of the strategytype
- data categoryobjectId
- id of the objectofferIds
- list id of offersStorageException
public boolean checkObjectExisting(String strategyId, String objectId, DataCategory category, List<String> offerIds) throws StorageException
checkObjectExisting
in interface StorageDistribution
strategyId
- id of the strategyobjectId
- id of the objectcategory
- categoryofferIds
- list id of offers @returnStorageException
- StorageExceptionpublic void deleteObjectInAllOffers(String strategyId, DataContext context) throws StorageException
StorageDistribution
deleteObjectInAllOffers
in interface StorageDistribution
strategyId
- id of the strategyStorageNotFoundException
- Thrown if the Container or the object does not existStorageTechnicalException
- thrown if a technical error happenedStorageException
public void deleteObjectInOffers(String strategyId, DataContext context, List<String> offers) throws StorageException
StorageDistribution
deleteObjectInOffers
in interface StorageDistribution
strategyId
- id of the strategycontext
- contextoffers
- offersStorageNotFoundException
- Thrown if the Container or the object does not existStorageTechnicalException
- thrown if a technical error happenedStorageException
public com.fasterxml.jackson.databind.JsonNode status()
StorageDistribution
status
in interface StorageDistribution
public void close()
close
in interface VitamAutoCloseable
close
in interface AutoCloseable
Copyright © 2018 Vitam. All rights reserved.