Class StorageDistributionImpl
java.lang.Object
fr.gouv.vitam.storage.engine.server.distribution.impl.StorageDistributionImpl
- All Implemented Interfaces:
VitamAutoCloseable,StorageDistribution,AutoCloseable
StorageDistribution service Implementation process continue if needed)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbulkCreateFromWorkspace(String strategyId, BulkObjectStoreRequest bulkObjectStoreRequest, String requester) checkAccessRequestStatuses(String strategyId, String optionalOfferId, List<String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed) booleancheckObjectAvailability(String strategyId, String optionalOfferId, DataCategory dataCategory, List<String> objectsNames) checkObjectExisting(String strategyId, String objectId, DataCategory category, List<String> offerIds) Verify if object existsvoidclose()copyObjectFromOfferToOffer(DataContext context, String sourceOffer, String destinationOffer) copy object from on offer to an anothercreateAccessRequestIfRequired(String strategyId, String optionalOfferId, DataCategory dataCategory, List<String> objectsNames) voiddeleteObjectInAllOffers(String strategyId, DataContext context) Delete an objectvoiddeleteObjectInOffers(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.ResponsegetContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, AccessLogInfoModel logInformation) Get a specific Object binary data as an input streamjavax.ws.rs.core.ResponsegetContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, String offerId) Get a specific Object binary data as an input streamcom.fasterxml.jackson.databind.JsonNodegetContainerInformation(String strategyId) Get Storage Information (availability and capacity) for the requested tenant + strategycom.fasterxml.jackson.databind.JsonNodegetContainerInformation(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 strategiesprotected StorageStrategyProviderjavax.ws.rs.core.ResponselaunchOfferLogCompaction(String offerReferenceId, Integer tenantId) listContainerObjects(String strategyId, DataCategory category) List container objectslistContainerObjectsForOffer(DataCategory category, String offerId, boolean includeDisabled) voidremoveAccessRequest(String strategyId, String optionalOfferId, 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.
-
Field Details
-
NORMAL_ORIGIN
- See Also:
-
COPY_OBJECT_ORIGIN
- See Also:
-
DIGEST
- See Also:
-
-
Method Details
-
copyObjectFromOfferToOffer
public StoredInfoResult copyObjectFromOfferToOffer(DataContext context, String sourceOffer, String destinationOffer) throws StorageException Description copied from interface:StorageDistributioncopy object from on offer to an another- Specified by:
copyObjectFromOfferToOfferin interfaceStorageDistribution- Parameters:
context- the contextsourceOffer- source offerdestinationOffer- destination Offer- Returns:
- StoredInfoResult Object
- Throws:
StorageException- StorageException
-
storeDataInOffers
public StoredInfoResult storeDataInOffers(String strategyId, String origin, String objectId, DataCategory category, String requester, List<String> offerIds, javax.ws.rs.core.Response response) throws StorageException Description copied from interface:StorageDistributionStore data of any type for given tenant on the given storage offer.- Specified by:
storeDataInOffersin interfaceStorageDistribution- 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
public StoredInfoResult storeDataInOffers(String strategyId, String origin, StreamAndInfo streamAndInfo, String objectId, DataCategory category, String requester, List<String> offerIds) throws StorageException - Specified by:
storeDataInOffersin interfaceStorageDistribution- 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
-
storeDataInAllOffers
public StoredInfoResult storeDataInAllOffers(String strategyId, String objectId, ObjectDescription createObjectDescription, DataCategory category, String requester) throws StorageException Description copied from interface:StorageDistributionStore data of any type for given tenant on storage offers associated to given strategy- Specified by:
storeDataInAllOffersin interfaceStorageDistribution- 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
-
bulkCreateFromWorkspace
public BulkObjectStoreResponse bulkCreateFromWorkspace(String strategyId, BulkObjectStoreRequest bulkObjectStoreRequest, String requester) throws StorageException - Specified by:
bulkCreateFromWorkspacein interfaceStorageDistribution- Throws:
StorageException
-
getOfferIds
Description copied from interface:StorageDistributionget offer ids list- Specified by:
getOfferIdsin interfaceStorageDistribution- Parameters:
strategyId- strategy id- Returns:
- offers ids list
- Throws:
StorageException
-
getStrategies
Description copied from interface:StorageDistributionRetrieve all the available storage strategies- Specified by:
getStrategiesin interfaceStorageDistribution- Returns:
- all storage strategies by id
- Throws:
StorageException- if any unwanted technical issue happens
-
createAccessRequestIfRequired
public Optional<String> createAccessRequestIfRequired(String strategyId, String optionalOfferId, DataCategory dataCategory, List<String> objectsNames) throws StorageException - Specified by:
createAccessRequestIfRequiredin interfaceStorageDistribution- Throws:
StorageException
-
checkAccessRequestStatuses
public Map<String,AccessRequestStatus> checkAccessRequestStatuses(String strategyId, String optionalOfferId, List<String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed) throws StorageException - Specified by:
checkAccessRequestStatusesin interfaceStorageDistribution- Throws:
StorageException
-
removeAccessRequest
public void removeAccessRequest(String strategyId, String optionalOfferId, String accessRequestId, boolean adminCrossTenantAccessRequestAllowed) throws StorageException - Specified by:
removeAccessRequestin interfaceStorageDistribution- Throws:
StorageException
-
checkObjectAvailability
public boolean checkObjectAvailability(String strategyId, String optionalOfferId, DataCategory dataCategory, List<String> objectsNames) throws StorageException - Specified by:
checkObjectAvailabilityin interfaceStorageDistribution- Throws:
StorageException
-
getReferentOffer
public String getReferentOffer(String strategyId) throws StorageTechnicalException, StorageNotFoundException - Specified by:
getReferentOfferin interfaceStorageDistribution- Throws:
StorageTechnicalExceptionStorageNotFoundException
-
launchOfferLogCompaction
public javax.ws.rs.core.Response launchOfferLogCompaction(String offerReferenceId, Integer tenantId) throws StorageException - Specified by:
launchOfferLogCompactionin interfaceStorageDistribution- Throws:
StorageException
-
getContainerInformation
public com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId) throws StorageException Description copied from interface:StorageDistributionGet Storage Information (availability and capacity) for the requested tenant + strategy- Specified by:
getContainerInformationin interfaceStorageDistribution- 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
public CloseableIterator<ObjectEntry> listContainerObjects(String strategyId, DataCategory category) throws StorageException Description copied from interface:StorageDistributionList container objects- Specified by:
listContainerObjectsin interfaceStorageDistribution- 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
public CloseableIterator<ObjectEntry> listContainerObjectsForOffer(DataCategory category, String offerId, boolean includeDisabled) throws StorageException - Specified by:
listContainerObjectsForOfferin interfaceStorageDistribution- Throws:
StorageException
-
getOfferLogs
public RequestResponse<OfferLog> getOfferLogs(String strategyId, DataCategory category, Long offset, int limit, Order order) throws StorageException Description copied from interface:StorageDistributionGet offer log from referent- Specified by:
getOfferLogsin interfaceStorageDistribution- 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
public RequestResponse<OfferLog> getOfferLogsByOfferId(String strategyId, String offerId, DataCategory category, Long offset, int limit, Order order) throws StorageException Get offer log from the given offer- Specified by:
getOfferLogsByOfferIdin interfaceStorageDistribution- Parameters:
strategyId- the strategy id to get offersofferId- offerIdcategory- 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
public javax.ws.rs.core.Response getContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, AccessLogInfoModel logInformation) throws StorageException Description copied from interface:StorageDistributionGet a specific Object binary data as an input stream- Specified by:
getContainerByCategoryin interfaceStorageDistribution- 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
public javax.ws.rs.core.Response getContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, String offerId) throws StorageException Description copied from interface:StorageDistributionGet a specific Object binary data as an input stream- Specified by:
getContainerByCategoryin interfaceStorageDistribution- 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
public com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId, DataCategory type, String objectId, List<String> offerIds, boolean noCache) throws StorageException Description copied from interface:StorageDistributionGet a specific Object information- Specified by:
getContainerInformationin interfaceStorageDistribution- 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
public Map<String,Boolean> checkObjectExisting(String strategyId, String objectId, DataCategory category, List<String> offerIds) throws StorageException Verify if object exists- Specified by:
checkObjectExistingin interfaceStorageDistribution- Parameters:
strategyId- id of the strategyobjectId- id of the objectcategory- categoryofferIds- list id of offers @return- Returns:
- list of result existence by offerId
- Throws:
StorageException- StorageException
-
deleteObjectInAllOffers
Description copied from interface:StorageDistributionDelete an object- Specified by:
deleteObjectInAllOffersin interfaceStorageDistribution- 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
public void deleteObjectInOffers(String strategyId, DataContext context, List<String> offers) throws StorageException Description copied from interface:StorageDistributionDelete an object in offers- Specified by:
deleteObjectInOffersin interfaceStorageDistribution- 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
public List<BatchObjectInformationResponse> getBatchObjectInformation(String strategyId, DataCategory type, List<String> objectIds, List<String> offerIds) throws StorageException - Specified by:
getBatchObjectInformationin interfaceStorageDistribution- Throws:
StorageException
-
getStrategyProvider
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceVitamAutoCloseable
-