Interface StorageClient
-
- All Superinterfaces:
java.lang.AutoCloseable,BasicClient,MockOrRestClient,VitamAutoCloseable
- All Known Implementing Classes:
StorageClientMock
public interface StorageClient extends BasicClient
Storage Client interface
-
-
Field Summary
-
Fields inherited from interface fr.gouv.vitam.common.client.BasicClient
STATUS_URL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BulkObjectStoreResponsebulkStoreFilesFromWorkspace(java.lang.String strategyId, BulkObjectStoreRequest bulkObjectStoreRequest)Store objects available in workspace into offersRequestResponseOKcopyObjectToOneOfferAnother(java.lang.String objectId, DataCategory category, java.lang.String source, java.lang.String destination, java.lang.String strategyId)RequestResponseOKcreate(java.lang.String strategyId, java.lang.String objectId, DataCategory category, java.io.InputStream inputStream, java.lang.Long inputStreamSize, java.util.List<java.lang.String> offerIds)booleandelete(java.lang.String strategyId, DataCategory type, java.lang.String guid)Delete an object of given type in the storage offer strategybooleandelete(java.lang.String strategyId, DataCategory type, java.lang.String guid, java.util.List<java.lang.String> offerIds)Delete an object of given type in the storage offer strategyjava.util.Map<java.lang.String,java.lang.Boolean>exists(java.lang.String strategyId, DataCategory type, java.lang.String guid, java.util.List<java.lang.String> offerIds)Check the existence of an object in storage by its id and typeDataCategory.booleanexistsContainer(java.lang.String strategyId)Check the existance of a tenant container in storage by its idRequestResponse<BatchObjectInformationResponse>getBatchObjectInformation(java.lang.String strategyId, DataCategory type, java.util.Collection<java.lang.String> offerIds, java.util.Collection<java.lang.String> objectIds)Get object information from objects in storagejavax.ws.rs.core.ResponsegetContainerAsync(java.lang.String strategyId, java.lang.String guid, DataCategory type, AccessLogInfoModel logInfo)Retrieves a binary object knowing its guid as an inputStream for a specific tenant/strategyjavax.ws.rs.core.ResponsegetContainerAsync(java.lang.String strategyId, java.lang.String offerId, java.lang.String objectName, DataCategory type, AccessLogInfoModel logInfo)com.fasterxml.jackson.databind.JsonNodegetInformation(java.lang.String strategyId, DataCategory type, java.lang.String guid, java.util.List<java.lang.String> offerIds, boolean noCache)Get object information from objects in storageRequestResponse<OfferLog>getOfferLogs(java.lang.String strategyId, DataCategory type, java.lang.Long offset, int limit, Order order)Get offer log .java.util.List<java.lang.String>getOffers(java.lang.String strategyId)get List of offers for a strategycom.fasterxml.jackson.databind.JsonNodegetStorageInformation(java.lang.String strategyId)Check if the storage of objects could be done, knowing a required sizeRequestResponse<StorageStrategy>getStorageStrategies()Get strategies.CloseableIterator<ObjectEntry>listContainer(java.lang.String strategyId, DataCategory type)List object type in containerRequestResponseOK<StorageLogBackupResult>storageAccessLogBackup(java.util.List<java.lang.Integer> tenants)Call storage accesslog backup operation.RequestResponseOK<StorageLogBackupResult>storageLogBackup(java.util.List<java.lang.Integer> tenants)Call storage log backup operation.RequestResponseOK<StorageLogTraceabilityResult>storageLogTraceability(java.util.List<java.lang.Integer> tenants)Call storage log traceability operation.StoredInfoResultstoreFileFromWorkspace(java.lang.String strategyId, DataCategory type, java.lang.String guid, ObjectDescription description)Store an object available in workspace by its vitam guid-
Methods inherited from interface fr.gouv.vitam.common.client.MockOrRestClient
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
-
-
-
-
Method Detail
-
getStorageInformation
com.fasterxml.jackson.databind.JsonNode getStorageInformation(java.lang.String strategyId) throws StorageNotFoundClientException, StorageServerClientExceptionCheck if the storage of objects could be done, knowing a required size- Parameters:
strategyId- the storage strategy id- Returns:
- the capacity of the storage
- Throws:
StorageNotFoundClientException- if the Server got a NotFound resultStorageServerClientException- if the Server got an internal error
-
getOffers
java.util.List<java.lang.String> getOffers(java.lang.String strategyId) throws StorageNotFoundClientException, StorageServerClientExceptionget List of offers for a strategy- Parameters:
strategyId- strategyId- Returns:
- list id of offers
- Throws:
StorageNotFoundClientExceptionStorageServerClientException
-
storeFileFromWorkspace
StoredInfoResult storeFileFromWorkspace(java.lang.String strategyId, DataCategory type, java.lang.String guid, ObjectDescription description) throws StorageAlreadyExistsClientException, StorageNotFoundClientException, StorageServerClientException
Store an object available in workspace by its vitam guid- Parameters:
strategyId- the storage strategy idtype- the type of object collectionguid- vitam guiddescription- object description- Returns:
- the result status of object creation
- Throws:
StorageAlreadyExistsClientException- if the Server got a CONFLICT status resultStorageNotFoundClientException- if the Server got a NotFound resultStorageServerClientException- if the Server got an internal error
-
bulkStoreFilesFromWorkspace
BulkObjectStoreResponse bulkStoreFilesFromWorkspace(java.lang.String strategyId, BulkObjectStoreRequest bulkObjectStoreRequest) throws StorageAlreadyExistsClientException, StorageNotFoundClientException, StorageServerClientException
Store objects available in workspace into offers- Parameters:
strategyId- the storage strategy idbulkObjectStoreRequest- request- Returns:
- the result status of object creation
- Throws:
StorageAlreadyExistsClientException- if the Server got a CONFLICT status resultStorageNotFoundClientException- if the Server got a NotFound resultStorageServerClientException- if the Server got an internal error
-
existsContainer
boolean existsContainer(java.lang.String strategyId) throws StorageServerClientExceptionCheck the existance of a tenant container in storage by its id- Parameters:
strategyId- the storage strategy id- Returns:
- true if exist
- Throws:
StorageServerClientException- if the Server got an internal error
-
exists
java.util.Map<java.lang.String,java.lang.Boolean> exists(java.lang.String strategyId, DataCategory type, java.lang.String guid, java.util.List<java.lang.String> offerIds) throws StorageServerClientExceptionCheck the existence of an object in storage by its id and typeDataCategory.- Parameters:
strategyId- the storage strategy idtype- the type of object collectionguid- vitam guid- Returns:
- true/false for each offer
- Throws:
StorageServerClientException- if the Server got an internal error
-
delete
boolean delete(java.lang.String strategyId, DataCategory type, java.lang.String guid) throws StorageServerClientExceptionDelete an object of given type in the storage offer strategy- Parameters:
strategyId- the storage strategy idtype- the type of object collectionguid- vitam guid- Returns:
- true if deleted
- Throws:
StorageServerClientException- if the Server got an internal error
-
delete
boolean delete(java.lang.String strategyId, DataCategory type, java.lang.String guid, java.util.List<java.lang.String> offerIds) throws StorageServerClientExceptionDelete an object of given type in the storage offer strategy- Parameters:
strategyId- the storage strategy idtype- the type of object collectionguid- vitam guidofferIds- offers ids to delete- Returns:
- true if deleted
- Throws:
StorageServerClientException
-
getContainerAsync
javax.ws.rs.core.Response getContainerAsync(java.lang.String strategyId, java.lang.String guid, DataCategory type, AccessLogInfoModel logInfo) throws StorageServerClientException, StorageNotFoundExceptionRetrieves a binary object knowing its guid as an inputStream for a specific tenant/strategy- Parameters:
strategyId- the storage strategy idguid- vitam guid of the object to be returnedtype- the object type to listlogInfo- additional information for accessLog- Returns:
- the object requested
- Throws:
StorageServerClientException- if the Server got an internal errorStorageNotFoundException- if the Server got a NotFound result, if the container or the object does not exist
-
getContainerAsync
javax.ws.rs.core.Response getContainerAsync(java.lang.String strategyId, java.lang.String offerId, java.lang.String objectName, DataCategory type, AccessLogInfoModel logInfo) throws StorageServerClientException, StorageNotFoundException
-
listContainer
CloseableIterator<ObjectEntry> listContainer(java.lang.String strategyId, DataCategory type) throws StorageServerClientException, StorageNotFoundClientException
List object type in container- Parameters:
strategyId- the strategy IDtype- the object type to list- Returns:
- an iterator with object list
- Throws:
StorageServerClientException- thrown if the server got an internal errorStorageNotFoundClientException
-
storageAccessLogBackup
RequestResponseOK<StorageLogBackupResult> storageAccessLogBackup(java.util.List<java.lang.Integer> tenants) throws StorageServerClientException, InvalidParseOperationException
Call storage accesslog backup operation.- Parameters:
tenants- tenants list to backup- Returns:
- Storage logbook backup response
- Throws:
StorageServerClientExceptionInvalidParseOperationException
-
storageLogBackup
RequestResponseOK<StorageLogBackupResult> storageLogBackup(java.util.List<java.lang.Integer> tenants) throws StorageServerClientException, InvalidParseOperationException
Call storage log backup operation.- Parameters:
tenants- tenants list to backup- Returns:
- Storage logbook backup response
- Throws:
StorageServerClientException- StorageServerClientExceptionInvalidParseOperationException- InvalidParseOperationException
-
storageLogTraceability
RequestResponseOK<StorageLogTraceabilityResult> storageLogTraceability(java.util.List<java.lang.Integer> tenants) throws StorageServerClientException, InvalidParseOperationException
Call storage log traceability operation.- Parameters:
tenants-- Returns:
- storage log traceability response
- Throws:
StorageServerClientException- StorageServerClientExceptionInvalidParseOperationException- InvalidParseOperationException
-
getInformation
com.fasterxml.jackson.databind.JsonNode getInformation(java.lang.String strategyId, DataCategory type, java.lang.String guid, java.util.List<java.lang.String> offerIds, boolean noCache) throws StorageServerClientException, StorageNotFoundClientExceptionGet object information from objects in storage- Parameters:
strategyId- the storage strategy idtype- the object type to listguid- vitam guidofferIds- offers ids to deletenoCache- noCache forces digest computation.- Returns:
- informations
- Throws:
StorageServerClientException- StorageServerClientExceptionStorageNotFoundClientException- StorageNotFoundClientException
-
getBatchObjectInformation
RequestResponse<BatchObjectInformationResponse> getBatchObjectInformation(java.lang.String strategyId, DataCategory type, java.util.Collection<java.lang.String> offerIds, java.util.Collection<java.lang.String> objectIds) throws StorageServerClientException
Get object information from objects in storage- Parameters:
strategyId- the storage strategy idtype- the object type to listofferIds- offers idsobjectIds- list of object ids- Returns:
- informations
- Throws:
StorageServerClientException- StorageServerClientException
-
copyObjectToOneOfferAnother
RequestResponseOK copyObjectToOneOfferAnother(java.lang.String objectId, DataCategory category, java.lang.String source, java.lang.String destination, java.lang.String strategyId) throws StorageServerClientException, InvalidParseOperationException
- Parameters:
objectId- objectIdcategory- categorysource- sourcedestination- destinationstrategyId- strategyId- Returns:
- RequestResponseOK
- Throws:
StorageServerClientException- StorageServerClientExceptionInvalidParseOperationException- StorageServerClientException
-
create
RequestResponseOK create(java.lang.String strategyId, java.lang.String objectId, DataCategory category, java.io.InputStream inputStream, java.lang.Long inputStreamSize, java.util.List<java.lang.String> offerIds) throws StorageServerClientException, InvalidParseOperationException
- Parameters:
strategyId- strategyIdobjectId- objectIdcategory- categoryinputStream- inputStreaminputStreamSize- inputStreamSizeofferIds- offers ids- Returns:
- RequestResponseOK
- Throws:
StorageServerClientException- StorageServerClientExceptionInvalidParseOperationException- InvalidParseOperationException
-
getOfferLogs
RequestResponse<OfferLog> getOfferLogs(java.lang.String strategyId, DataCategory type, java.lang.Long offset, int limit, Order order) throws StorageServerClientException
Get offer log .- Parameters:
strategyId- the strategy to get offerstype- the object type to listoffset- offset of the last object beforelimit- the number of result wantedorder- the order order- Returns:
- list of offer log
- Throws:
StorageServerClientException
-
getStorageStrategies
RequestResponse<StorageStrategy> getStorageStrategies() throws StorageServerClientException
Get strategies.- Returns:
- strategies available for storage
- Throws:
StorageServerClientException
-
-