public class ConnectionMockImpl extends AbstractMockClient implements Connection
AbstractMockClient.FakeInboundResponseINTERNAL_SERVER_ERROR| Constructor and Description |
|---|
ConnectionMockImpl(String driverName,
fr.gouv.vitam.driver.mock.MockDriverImpl.MockClientFactory factory,
Properties parameters)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
StorageCheckResult |
checkObject(StorageCheckRequest request)
Check an object in order to validate its transfer
|
StorageCountResult |
countObjects(StorageRequest request)
Count the number of binary objects ine the container
|
void |
deleteAll() |
String |
getDriverName() |
StorageMetadatasResult |
getMetadatas(StorageObjectRequest request)
Get metadata of object
|
StorageGetResult |
getObject(StorageObjectRequest request)
Retrieve an object from the storage offer based on criterias defined in request argument.
|
RequestResponse<OfferLog> |
getOfferLogs(StorageOfferLogRequest request)
Get a listing of offer logs on a container type
|
StorageCapacityResult |
getStorageCapacity(Integer tenantId)
Retrieve the remaining storage capacity available on the distant offer.
|
protected <R> R |
handleResponseStatus(javax.ws.rs.core.Response response,
Class<R> responseType)
Common method to handle response status
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
listObjects(StorageListRequest request)
List object on a container type
|
boolean |
objectExistsInOffer(StorageObjectRequest request)
Check if an object is present in the offer
|
StoragePutResult |
putObject(StoragePutRequest request)
Put the object file into the storage offer based on criterias defined in request argument and underlaying
connection parameters.
|
StorageRemoveResult |
removeObject(StorageRemoveRequest request)
Delete an object on the distant storage offer.
|
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrlclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic ConnectionMockImpl(String driverName, fr.gouv.vitam.driver.mock.MockDriverImpl.MockClientFactory factory, Properties parameters)
driverName - factory - parameters - public String getDriverName()
public StorageCapacityResult getStorageCapacity(Integer tenantId) throws StorageDriverPreconditionFailedException, StorageDriverNotFoundException, StorageDriverException
ConnectiongetStorageCapacity in interface ConnectiontenantId - the tenant id needed to get storage capacityStorageDriverPreconditionFailedException - if a bad request is encounteredStorageDriverNotFoundException - if container is not foundStorageDriverException - if any problem occurs during requestpublic StorageCountResult countObjects(StorageRequest request) throws StorageDriverException
ConnectioncountObjects in interface Connectionrequest - the request to send. It contains informations of the container.StorageDriverException - if any problem occurs during requestpublic StorageGetResult getObject(StorageObjectRequest request) throws StorageDriverException
ConnectiongetObject in interface Connectionrequest - the request to send. It contains informations needed to retrieve a given object.StorageDriverException - if any problem occurs during requestpublic StoragePutResult putObject(StoragePutRequest request) throws StorageDriverException
ConnectionputObject in interface Connectionrequest - the request to send. It may contains informations needed to store the file.StorageDriverException - if any problem occurs during requestpublic StorageRemoveResult removeObject(StorageRemoveRequest request) throws StorageDriverException
ConnectionremoveObject in interface Connectionrequest - the request to send, it contains information needed to delete an object on the distant storeStorageDriverException - if any problem occurs during requestpublic boolean objectExistsInOffer(StorageObjectRequest request) throws StorageDriverException
ConnectionobjectExistsInOffer in interface Connectionrequest - the request to send. It contains informations needed to retrieve a given object.StorageDriverException - if any problem occurs during requestprotected <R> R handleResponseStatus(javax.ws.rs.core.Response response,
Class<R> responseType)
throws StorageDriverException
R - the class type to be returnedresponse - the response to be handledresponseType - the type to map the response intoStorageDriverException - if any from the serverpublic StorageCheckResult checkObject(StorageCheckRequest request) throws StorageDriverException
ConnectioncheckObject in interface Connectionrequest - the request to send. It contains informations needed to check the object.StorageDriverException - if any problem occurs during requestpublic StorageMetadatasResult getMetadatas(StorageObjectRequest request) throws StorageDriverException
ConnectiongetMetadatas in interface ConnectionStorageDriverExceptionpublic RequestResponse<com.fasterxml.jackson.databind.JsonNode> listObjects(StorageListRequest request) throws StorageDriverException
ConnectionlistObjects in interface Connectionrequest - the request contains data needed to list container typeStorageDriverExceptionpublic RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest request)
ConnectiongetOfferLogs in interface Connectionrequest - the request contains data needed to retrieve the listing of the containerpublic void deleteAll()
Copyright © 2018 Vitam. All rights reserved.