Interface StorageDistribution
- All Superinterfaces:
AutoCloseable
,VitamAutoCloseable
- All Known Implementing Classes:
ReadOnlyShieldStorageDistribution
,StorageDistributionImpl
Interface Storage Distribution for Storage Operations
-
Method Summary
Modifier and TypeMethodDescriptionbulkCreateFromWorkspace
(String strategyId, BulkObjectStoreRequest bulkObjectStoreRequest, String requester) checkAccessRequestStatuses
(String strategyId, String offerId, List<String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed) boolean
checkObjectAvailability
(String strategyId, String offerId, DataCategory dataCategory, List<String> objectsNames) checkObjectExisting
(String strategyId, String objectId, DataCategory category, List<String> offerIds) Verify if object exists.copyObjectFromOfferToOffer
(DataContext context, String sourceOffer, String destinationOffer) copy object from on offer to an anothercreateAccessRequestIfRequired
(String strategyId, String offerId, DataCategory dataCategory, List<String> objectsNames) void
deleteObjectInAllOffers
(String strategyId, DataContext context) Delete an objectvoid
deleteObjectInOffers
(String strategyId, DataContext context, List<String> offers) Delete an object in offersgetBatchObjectInformation
(String strategyId, DataCategory type, List<String> objectIds, List<String> offerIds) javax.ws.rs.core.Response
getContainerByCategory
(String strategyId, String origin, String objectId, DataCategory category, AccessLogInfoModel logInformation) Get a specific Object binary data as an input streamjavax.ws.rs.core.Response
getContainerByCategory
(String strategyId, String origin, String objectId, DataCategory category, String offerId) Get a specific Object binary data as an input streamcom.fasterxml.jackson.databind.JsonNode
getContainerInformation
(String strategyId) Get Storage Information (availability and capacity) for the requested tenant + strategycom.fasterxml.jackson.databind.JsonNode
getContainerInformation
(String strategyId, DataCategory type, String objectId, List<String> offerIds, boolean noCache) Get a specific Object informationgetOfferIds
(String strategyId) get offer ids listgetOfferLogs
(String strategyId, DataCategory category, Long offset, int limit, Order order) Get offer log from referentgetOfferLogsByOfferId
(String strategyId, String offerId, DataCategory category, Long offset, int limit, Order order) Get offer log from the given offergetReferentOffer
(String strategyId) Retrieve all the available storage strategiesjavax.ws.rs.core.Response
launchOfferLogCompaction
(String offerReferenceId, Integer tenantId) listContainerObjects
(String strategyId, DataCategory category) List container objectslistContainerObjectsForOffer
(DataCategory category, String offerId, boolean includeDisabled) void
removeAccessRequest
(String strategyId, String offerId, String accessRequestId, boolean adminCrossTenantAccessRequestAllowed) 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 strategystoreDataInOffers
(String strategyId, String origin, StreamAndInfo streamAndInfo, String objectId, DataCategory category, String requester, List<String> offerIds) storeDataInOffers
(String strategyId, String origin, 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.Methods inherited from interface fr.gouv.vitam.common.model.VitamAutoCloseable
close
-
Method Details
-
copyObjectFromOfferToOffer
StoredInfoResult copyObjectFromOfferToOffer(DataContext context, String sourceOffer, String destinationOffer) throws StorageException copy object from on offer to an another- Parameters:
context
- the contextdestinationOffer
- destination OffersourceOffer
- source offer- Returns:
- StoredInfoResult Object
- Throws:
StorageException
- StorageException
-
storeDataInAllOffers
StoredInfoResult storeDataInAllOffers(String strategyId, String objectId, ObjectDescription createObjectDescription, DataCategory category, String requester) throws StorageException Store data of any type for given tenant on storage offers associated to given strategy- Parameters:
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 information- Returns:
- a StoredInfoResult containing informations about the created Data
- Throws:
StorageException
- StorageException
-
storeDataInOffers
StoredInfoResult storeDataInOffers(String strategyId, String origin, String objectId, DataCategory category, String requester, List<String> offerIds, javax.ws.rs.core.Response response) throws StorageException Store data of any type for given tenant on the given storage offer.- Parameters:
strategyId
- id of the strategyorigin
- origin of the transaction (normal, bulk, offer_sync)objectId
- 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 identifiersresponse
- the response- Returns:
- a StoredInfoResult containing information about the created Data
- Throws:
StorageException
- StorageException
-
storeDataInOffers
StoredInfoResult storeDataInOffers(String strategyId, String origin, StreamAndInfo streamAndInfo, String objectId, DataCategory category, String requester, List<String> offerIds) throws StorageException - Parameters:
strategyId
- id of the strategyorigin
- origin of the transaction (normal, bulk, offer_sync)streamAndInfo
- streamAndInfoobjectId
- id of the objectcategory
- the object type to listrequester
- the requester informationofferIds
- offer identfiers- Returns:
- StoredInfoResult
- Throws:
StorageException
- StorageException
-
getOfferIds
get offer ids list- Parameters:
strategyId
- strategy id- Returns:
- offers ids list
- Throws:
StorageException
-
getContainerInformation
com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId) throws StorageException Get Storage Information (availability and capacity) for the requested tenant + strategy- Parameters:
strategyId
- id of the strategy- Returns:
- a JsonNode containing informations about the storage
- Throws:
StorageNotFoundException
- Thrown if the Container does not existStorageTechnicalException
- Thrown in case of any technical problemStorageException
-
listContainerObjects
CloseableIterator<ObjectEntry> listContainerObjects(String strategyId, DataCategory category) throws StorageException List container objects- Parameters:
strategyId
- the strategy id to get offerscategory
- the object type to list- Returns:
- a response with object listing
- Throws:
StorageException
- thrown in case of any technical problem
-
listContainerObjectsForOffer
CloseableIterator<ObjectEntry> listContainerObjectsForOffer(DataCategory category, String offerId, boolean includeDisabled) throws StorageException - Throws:
StorageException
-
getOfferLogs
RequestResponse<OfferLog> getOfferLogs(String strategyId, DataCategory category, Long offset, int limit, Order order) throws StorageException Get offer log from referent- Parameters:
strategyId
- the strategy id to get offerscategory
- the object type to listoffset
- offset of the excluded objectlimit
- the number of result wantedorder
- order- Returns:
- list of offer log
- Throws:
StorageException
- thrown in case of any technical problem
-
getOfferLogsByOfferId
RequestResponse<OfferLog> getOfferLogsByOfferId(String strategyId, String offerId, DataCategory category, Long offset, int limit, Order order) throws StorageException Get offer log from the given offer- Parameters:
strategyId
- the strategy id to get offersofferId
-category
- the object type to listoffset
- offset of the excluded objectlimit
- the number of result wantedorder
- order- Returns:
- list of offer log
- Throws:
StorageException
- thrown in case of any technical problem
-
getContainerByCategory
javax.ws.rs.core.Response getContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, AccessLogInfoModel logInformation) throws StorageException Get a specific Object binary data as an input stream- Parameters:
strategyId
- id of the strategyorigin
- originobjectId
- id of the objectcategory
- category of the objectlogInformation
- information for accessLog- Returns:
- an object as a Response with an InputStream
- Throws:
StorageNotFoundException
- Thrown if the Container or the object does not existStorageTechnicalException
- thrown if a technical error happenedStorageException
-
getContainerByCategory
javax.ws.rs.core.Response getContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, String offerId) throws StorageException Get a specific Object binary data as an input stream- Parameters:
strategyId
- id of the strategyorigin
- originobjectId
- id of the objectcategory
- categoryofferId
- offer identfier- Returns:
- an object as a Response with an InputStream
- Throws:
StorageNotFoundException
- Thrown if the Container or the object does not existStorageTechnicalException
- thrown if a technical error happenedStorageException
-
getContainerInformation
com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId, DataCategory type, String objectId, List<String> offerIds, boolean noCache) throws StorageException Get a specific Object information- Parameters:
strategyId
- id of the strategytype
- data categoryobjectId
- id of the objectofferIds
- list id of offers- Returns:
- JsonNode containing informations about the requested object
- Throws:
StorageException
-
checkObjectExisting
Map<String,Boolean> checkObjectExisting(String strategyId, String objectId, DataCategory category, List<String> offerIds) throws StorageException Verify if object exists. If an offer is not in hot offers in strategy, it is considered as not existing.- Parameters:
strategyId
- id of the strategyobjectId
- id of the objectcategory
- categoryofferIds
- list id of offers- Returns:
- list of result existence by offerId
- Throws:
StorageException
- StorageException
-
deleteObjectInAllOffers
Delete an object- Parameters:
strategyId
- id of the strategy- Throws:
StorageNotFoundException
- Thrown if the Container or the object does not existStorageTechnicalException
- thrown if a technical error happenedStorageException
-
deleteObjectInOffers
void deleteObjectInOffers(String strategyId, DataContext context, List<String> offers) throws StorageException Delete an object in offers- Parameters:
strategyId
- id of the strategycontext
- contextoffers
- offers- Throws:
StorageNotFoundException
- Thrown if the Container or the object does not existStorageTechnicalException
- thrown if a technical error happenedStorageException
-
getBatchObjectInformation
List<BatchObjectInformationResponse> getBatchObjectInformation(String strategyId, DataCategory type, List<String> objectIds, List<String> offerIds) throws StorageException - Throws:
StorageException
-
bulkCreateFromWorkspace
BulkObjectStoreResponse bulkCreateFromWorkspace(String strategyId, BulkObjectStoreRequest bulkObjectStoreRequest, String requester) throws StorageException - Throws:
StorageException
-
getStrategies
Retrieve all the available storage strategies- Returns:
- all storage strategies by id
- Throws:
StorageException
- if any unwanted technical issue happens
-
createAccessRequestIfRequired
Optional<String> createAccessRequestIfRequired(String strategyId, String offerId, DataCategory dataCategory, List<String> objectsNames) throws StorageException - Throws:
StorageException
-
checkAccessRequestStatuses
Map<String,AccessRequestStatus> checkAccessRequestStatuses(String strategyId, String offerId, List<String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed) throws StorageException - Throws:
StorageException
-
removeAccessRequest
void removeAccessRequest(String strategyId, String offerId, String accessRequestId, boolean adminCrossTenantAccessRequestAllowed) throws StorageException - Throws:
StorageException
-
checkObjectAvailability
boolean checkObjectAvailability(String strategyId, String offerId, DataCategory dataCategory, List<String> objectsNames) throws StorageException - Throws:
StorageException
-
getReferentOffer
String getReferentOffer(String strategyId) throws StorageTechnicalException, StorageNotFoundException -
launchOfferLogCompaction
javax.ws.rs.core.Response launchOfferLogCompaction(String offerReferenceId, Integer tenantId) throws StorageException - Throws:
StorageException
-