public class StorageClientMock extends AbstractMockClient implements StorageClient
AbstractMockClient.FakeInboundResponse
INTERNAL_SERVER_ERROR
STATUS_URL
Constructor and Description |
---|
StorageClientMock() |
Modifier and Type | Method and Description |
---|---|
BulkObjectStoreResponse |
bulkStoreFilesFromWorkspace(String strategyId,
BulkObjectStoreRequest bulkObjectStoreRequest)
Store objects available in workspace into offers
|
RequestResponseOK |
copyObjectToOneOfferAnother(String objectId,
DataCategory category,
String source,
String destination,
String strategyId) |
RequestResponseOK |
create(String strategyId,
String objectId,
DataCategory category,
InputStream inputStream,
Long inputStreamSize,
List<String> offerIds) |
boolean |
delete(String strategyId,
DataCategory type,
String guid)
Delete an object of given type in the storage offer strategy
|
boolean |
delete(String strategyId,
DataCategory type,
String guid,
List<String> offerIds)
Delete an object of given type in the storage offer strategy
|
Map<String,Boolean> |
exists(String strategyId,
DataCategory type,
String guid,
List<String> offerIds)
Check the existence of an object in storage by its id and type
DataCategory . |
boolean |
existsContainer(String strategyId)
Check the existance of a tenant container in storage by its id
|
RequestResponse<BatchObjectInformationResponse> |
getBatchObjectInformation(String strategyId,
DataCategory type,
Collection<String> offerIds,
Collection<String> objectIds)
Get object information from objects in storage
|
javax.ws.rs.core.Response |
getContainerAsync(String strategyId,
String guid,
DataCategory type,
AccessLogInfoModel logInfo)
Retrieves a binary object knowing its guid as an inputStream for a specific tenant/strategy
|
com.fasterxml.jackson.databind.JsonNode |
getInformation(String strategyId,
DataCategory type,
String guid,
List<String> offerIds,
boolean noCache)
Get object information from objects in storage
|
RequestResponse<OfferLog> |
getOfferLogs(String strategyId,
DataCategory type,
Long offset,
int limit,
Order order)
Get offer log .
|
List<String> |
getOffers(String strategyId)
get List of offers for a strategy
|
com.fasterxml.jackson.databind.JsonNode |
getStorageInformation(String strategyId)
Check if the storage of objects could be done, knowing a required size
|
RequestResponse<StorageStrategy> |
getStorageStrategies()
Get strategies.
|
VitamRequestIterator<com.fasterxml.jackson.databind.JsonNode> |
listContainer(String strategyId,
DataCategory type)
List object type in container
|
RequestResponseOK |
storageAccessLogBackup()
Call storage accesslog backup operation.
|
RequestResponseOK |
storageLogBackup()
Call storage log backup operation.
|
RequestResponseOK |
storageLogTraceability()
Call storage log traceability operation.
|
StoredInfoResult |
storeFileFromWorkspace(String strategyId,
DataCategory type,
String guid,
ObjectDescription description)
Store an object available in workspace by its vitam guid
|
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
public com.fasterxml.jackson.databind.JsonNode getStorageInformation(String strategyId) throws StorageServerClientException
StorageClient
getStorageInformation
in interface StorageClient
strategyId
- the storage strategy idStorageServerClientException
- if the Server got an internal errorpublic List<String> getOffers(String strategyId) throws StorageNotFoundClientException, StorageServerClientException
StorageClient
getOffers
in interface StorageClient
strategyId
- strategyIdStorageNotFoundClientException
StorageServerClientException
public StoredInfoResult storeFileFromWorkspace(String strategyId, DataCategory type, String guid, ObjectDescription description) throws StorageAlreadyExistsClientException, StorageNotFoundClientException, StorageServerClientException
StorageClient
storeFileFromWorkspace
in interface StorageClient
strategyId
- the storage strategy idtype
- the type of object collectionguid
- vitam guiddescription
- object descriptionStorageAlreadyExistsClientException
- if the Server got a CONFLICT status resultStorageNotFoundClientException
- if the Server got a NotFound resultStorageServerClientException
- if the Server got an internal errorpublic boolean delete(String strategyId, DataCategory type, String guid) throws StorageServerClientException
StorageClient
delete
in interface StorageClient
strategyId
- the storage strategy idtype
- the type of object collectionguid
- vitam guidStorageServerClientException
- if the Server got an internal errorpublic boolean delete(String strategyId, DataCategory type, String guid, List<String> offerIds) throws StorageServerClientException
StorageClient
delete
in interface StorageClient
strategyId
- the storage strategy idtype
- the type of object collectionguid
- vitam guidofferIds
- offers ids to deleteStorageServerClientException
public boolean existsContainer(String strategyId) throws StorageServerClientException
StorageClient
existsContainer
in interface StorageClient
strategyId
- the storage strategy idStorageServerClientException
- if the Server got an internal errorpublic Map<String,Boolean> exists(String strategyId, DataCategory type, String guid, List<String> offerIds) throws StorageServerClientException
StorageClient
DataCategory
.exists
in interface StorageClient
strategyId
- the storage strategy idtype
- the type of object collectionguid
- vitam guidStorageServerClientException
- if the Server got an internal errorpublic BulkObjectStoreResponse bulkStoreFilesFromWorkspace(String strategyId, BulkObjectStoreRequest bulkObjectStoreRequest)
StorageClient
bulkStoreFilesFromWorkspace
in interface StorageClient
strategyId
- the storage strategy idbulkObjectStoreRequest
- requestpublic javax.ws.rs.core.Response getContainerAsync(String strategyId, String guid, DataCategory type, AccessLogInfoModel logInfo) throws StorageServerClientException, StorageNotFoundException
StorageClient
getContainerAsync
in interface StorageClient
strategyId
- the storage strategy idguid
- vitam guid of the object to be returnedtype
- the object type to listlogInfo
- additional information for accessLogStorageServerClientException
- if the Server got an internal errorStorageNotFoundException
- if the Server got a NotFound result, if the container or the object does not
existpublic VitamRequestIterator<com.fasterxml.jackson.databind.JsonNode> listContainer(String strategyId, DataCategory type)
StorageClient
listContainer
in interface StorageClient
strategyId
- the strategy IDtype
- the object type to listpublic RequestResponseOK storageAccessLogBackup() throws StorageServerClientException, InvalidParseOperationException
StorageClient
storageAccessLogBackup
in interface StorageClient
StorageServerClientException
InvalidParseOperationException
public RequestResponseOK storageLogBackup() throws StorageServerClientException, InvalidParseOperationException
StorageClient
storageLogBackup
in interface StorageClient
StorageServerClientException
- StorageServerClientExceptionInvalidParseOperationException
- InvalidParseOperationExceptionpublic RequestResponseOK storageLogTraceability() throws StorageServerClientException, InvalidParseOperationException
StorageClient
storageLogTraceability
in interface StorageClient
StorageServerClientException
- StorageServerClientExceptionInvalidParseOperationException
- InvalidParseOperationExceptionpublic com.fasterxml.jackson.databind.JsonNode getInformation(String strategyId, DataCategory type, String guid, List<String> offerIds, boolean noCache) throws StorageServerClientException, StorageNotFoundClientException
StorageClient
getInformation
in interface StorageClient
strategyId
- the storage strategy idtype
- the object type to listguid
- vitam guidofferIds
- offers ids to deletenoCache
- noCache forces digest computation.StorageServerClientException
- StorageServerClientExceptionStorageNotFoundClientException
- StorageNotFoundClientExceptionpublic RequestResponse<BatchObjectInformationResponse> getBatchObjectInformation(String strategyId, DataCategory type, Collection<String> offerIds, Collection<String> objectIds)
StorageClient
getBatchObjectInformation
in interface StorageClient
strategyId
- the storage strategy idtype
- the object type to listofferIds
- offers idsobjectIds
- list of object idspublic RequestResponseOK copyObjectToOneOfferAnother(String objectId, DataCategory category, String source, String destination, String strategyId) throws StorageServerClientException, InvalidParseOperationException
copyObjectToOneOfferAnother
in interface StorageClient
objectId
- objectIdcategory
- categorysource
- sourcedestination
- destinationstrategyId
- strategyIdStorageServerClientException
- StorageServerClientExceptionInvalidParseOperationException
- StorageServerClientExceptionpublic RequestResponseOK create(String strategyId, String objectId, DataCategory category, InputStream inputStream, Long inputStreamSize, List<String> offerIds) throws StorageServerClientException, InvalidParseOperationException
create
in interface StorageClient
strategyId
- strategyIdobjectId
- objectIdcategory
- categoryinputStream
- inputStreaminputStreamSize
- inputStreamSizeofferIds
- offers idsStorageServerClientException
- StorageServerClientExceptionInvalidParseOperationException
- InvalidParseOperationExceptionpublic RequestResponse<OfferLog> getOfferLogs(String strategyId, DataCategory type, Long offset, int limit, Order order) throws StorageServerClientException
StorageClient
getOfferLogs
in interface StorageClient
strategyId
- the strategy to get offerstype
- the object type to listoffset
- offset of the last object beforelimit
- the number of result wantedorder
- the order orderStorageServerClientException
public RequestResponse<StorageStrategy> getStorageStrategies() throws StorageServerClientException
StorageClient
getStorageStrategies
in interface StorageClient
StorageServerClientException
Copyright © 2019 Vitam. All rights reserved.