public class ConnectionMockImpl extends AbstractMockClient implements Connection
AbstractMockClient.FakeInboundResponse
INTERNAL_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, getServiceUrl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public 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
Connection
getStorageCapacity
in interface Connection
tenantId
- 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
Connection
countObjects
in interface Connection
request
- the request to send. It contains informations of the container.StorageDriverException
- if any problem occurs during requestpublic StorageGetResult getObject(StorageObjectRequest request) throws StorageDriverException
Connection
getObject
in interface Connection
request
- 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
Connection
putObject
in interface Connection
request
- 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
Connection
removeObject
in interface Connection
request
- 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
Connection
objectExistsInOffer
in interface Connection
request
- 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
Connection
checkObject
in interface Connection
request
- 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
Connection
getMetadatas
in interface Connection
StorageDriverException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> listObjects(StorageListRequest request) throws StorageDriverException
Connection
listObjects
in interface Connection
request
- the request contains data needed to list container typeStorageDriverException
public RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest request)
Connection
getOfferLogs
in interface Connection
request
- the request contains data needed to retrieve the listing of the containerpublic void deleteAll()
Copyright © 2018 Vitam. All rights reserved.