Class ConnectionImpl
java.lang.Object
fr.gouv.vitam.common.client.DefaultClient
fr.gouv.vitam.storage.driver.AbstractConnection
fr.gouv.vitam.storage.offers.workspace.driver.ConnectionImpl
- All Implemented Interfaces:
- BasicClient,- MockOrRestClient,- VitamAutoCloseable,- Connection,- AutoCloseable
Workspace Connection Implementation
- 
Field SummaryFields inherited from interface fr.gouv.vitam.common.client.BasicClientSTATUS_URL
- 
Method SummaryModifier and TypeMethodDescriptionbulkPutObjects(StorageBulkPutRequest request) Bulk put object files into the storage offer.checkAccessRequestStatuses(List<String> accessRequestIds, int tenant, boolean adminCrossTenantAccessRequestAllowed) Check access request statuses of asynchronous offer.booleanCheck immediate availability of objects from asynchronous storage offer.voidCheck the status from the servicevoidcheckStatus(javax.ws.rs.core.MultivaluedHashMap<String, Object> headers) Check the status from the service used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificatevoidclose()Close the underneath http clientfinal voidconsumeAnyEntityAndClose(javax.ws.rs.core.Response response) Helper when an error occurs on client usage side to consume response howeverCreate an access request for retrieving objects from asynchronous storage offer.Bulk get metadata of objectsjavax.ws.rs.client.Clientjavax.ws.rs.client.ClientgetMetadatas(StorageGetMetadataRequest request) Get metadata of objectgetObject(StorageObjectRequest request) Retrieve an object from the storage offer based on criterias defined in request argument.getOfferLogs(StorageOfferLogRequest storageGetOfferLogRequest) Get a listing of offer logs on a container typeGet the resource path of the server.Get the service URLgetStorageCapacity(Integer tenantId) Retrieve the remaining storage capacity available on the distant offer.javax.ws.rs.core.ResponselaunchOfferLogCompaction(VitamContext vitamContext) launch Offer Log CompactionlistObjects(StorageListRequest request) List object on a container typejavax.ws.rs.core.Responsemake(VitamRequestBuilder request) javax.ws.rs.core.ResponsemakeSpecifyingUrl(VitamRequestBuilder request) booleanobjectExistsInOffer(StorageObjectRequest request) Check if an object is present in the offerputObject(StoragePutRequest request) Put the object file into the storage offer based on criteria defined in request argument and underlying connection parameters.voidremoveAccessRequest(String accessRequestId, int tenant, boolean adminCrossTenantAccessRequestAllowed) Removes (cancel / delete) and access request for an asynchronous offer.removeObject(StorageRemoveRequest request) Delete an object on the distant storage offer.static voidstaticConsumeAnyEntityAndClose(javax.ws.rs.core.Response response) This method consume everything (in particular InputStream) and close the response.toString()Methods inherited from class fr.gouv.vitam.storage.driver.AbstractConnectiongetDriverNameMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface fr.gouv.vitam.storage.driver.Connectionclose
- 
Method Details- 
getStorageCapacityDescription copied from interface:ConnectionRetrieve the remaining storage capacity available on the distant offer. Return values MUST in bytes- Parameters:
- tenantId- the tenant id needed to get storage capacity
- Returns:
- the usable and used space in bytes and a remind of the given tenantId
- Throws:
- StorageDriverPreconditionFailedException- if a bad request is encountered
- StorageDriverNotFoundException- if container is not found
- StorageDriverException- if any problem occurs during request
 
- 
getObjectDescription copied from interface:ConnectionRetrieve an object from the storage offer based on criterias defined in request argument.- Parameters:
- request- the request to send. It contains informations needed to retrieve a given object.
- Returns:
- a result that may contains metadatas as well as the binary file
- Throws:
- StorageDriverException- if any problem occurs during request
 
- 
createAccessRequestpublic String createAccessRequest(StorageAccessRequestCreationRequest request) throws StorageDriverException Description copied from interface:ConnectionCreate an access request for retrieving objects from asynchronous storage offer.- Parameters:
- request- the request to send. It contains information needed to prepare a given object.
- Returns:
- an AccessRequestId that can be used to check the status of the AccessRequest, and to remove it
- Throws:
- StorageDriverException- if any problem occurs during request
 
- 
checkAccessRequestStatusespublic Map<String,AccessRequestStatus> checkAccessRequestStatuses(List<String> accessRequestIds, int tenant, boolean adminCrossTenantAccessRequestAllowed) throws StorageDriverException Description copied from interface:ConnectionCheck access request statuses of asynchronous offer.- Parameters:
- accessRequestIds- the accessRequestIds whose status is to be checked
- tenant- the tenant Id
- adminCrossTenantAccessRequestAllowed- when- true, access to access requests of other tenants is allowed from Admin tenant
- Returns:
- a Map of AccessRequestStatusby access request Id
- Throws:
- StorageDriverException- if any problem occurs during request
 
- 
removeAccessRequestpublic void removeAccessRequest(String accessRequestId, int tenant, boolean adminCrossTenantAccessRequestAllowed) throws StorageDriverException Description copied from interface:ConnectionRemoves (cancel / delete) and access request for an asynchronous offer. Does nothing is access request id does not exist (idempotency)- Parameters:
- accessRequestId- the accessRequestId to remove
- tenant- the tenant Id
- adminCrossTenantAccessRequestAllowed- when- true, removing access requests of other tenants is allowed from Admin tenant
- Throws:
- StorageDriverException- if any problem occurs during request
 
- 
checkObjectAvailabilitypublic boolean checkObjectAvailability(StorageCheckObjectAvailabilityRequest request) throws StorageDriverException Description copied from interface:ConnectionCheck immediate availability of objects from asynchronous storage offer.- Parameters:
- request- the request to send. It contains information needed to check object availability.
- Returns:
- trueif ALL objects are available, otherwise- false.
- Throws:
- StorageDriverException- if any problem occurs during request
 
- 
putObjectDescription copied from interface:ConnectionPut the object file into the storage offer based on criteria defined in request argument and underlying connection parameters.- Parameters:
- request- the request to send. It may contain information needed to store the file.
- Returns:
- a result that may contain metadata or statistics about the object put operation.
- Throws:
- StorageDriverException- if any problem occurs during request
 
- 
bulkPutObjectspublic StorageBulkPutResult bulkPutObjects(StorageBulkPutRequest request) throws StorageDriverException Description copied from interface:ConnectionBulk put object files into the storage offer.- Throws:
- StorageDriverException- if any problem occurs during request
 
- 
removeObjectDescription copied from interface:ConnectionDelete an object on the distant storage offer.- Parameters:
- request- the request to send, it contains information needed to delete an object on the distant store
- Returns:
- a result that may contains metadatas or statistics about the object removal operation.
- Throws:
- StorageDriverException- if any problem occurs during request
 
- 
objectExistsInOfferDescription copied from interface:ConnectionCheck if an object is present in the offer- Parameters:
- request- the request to send. It contains informations needed to retrieve a given object.
- Returns:
- true if exists, else false
- Throws:
- StorageDriverException- if any problem occurs during request
 
- 
getMetadataspublic StorageMetadataResult getMetadatas(StorageGetMetadataRequest request) throws StorageDriverException Description copied from interface:ConnectionGet metadata of object- Returns:
- a result that may contain information about the storage metadata
- Throws:
- StorageDriverException
 
- 
getBulkMetadatapublic StorageBulkMetadataResult getBulkMetadata(StorageGetBulkMetadataRequest request) throws StorageDriverException, InvalidParseOperationException Description copied from interface:ConnectionBulk get metadata of objects- Returns:
- a result that may contain information about the storage metadata
- Throws:
- StorageDriverException
- InvalidParseOperationException
 
- 
listObjectspublic CloseableIterator<ObjectEntry> listObjects(StorageListRequest request) throws StorageDriverException Description copied from interface:ConnectionList object on a container type- Parameters:
- request- the request contains data needed to list container type
- Returns:
- an iterator with each object metadata
- Throws:
- StorageDriverException
 
- 
getOfferLogspublic RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest storageGetOfferLogRequest) throws StorageDriverException Description copied from interface:ConnectionGet a listing of offer logs on a container type- Parameters:
- storageGetOfferLogRequest- the request contains data needed to retrieve the listing of the container
- Returns:
- the listing of last objects save according to the request
- Throws:
- StorageDriverException- to be thrown in case of any driver exception
 
- 
launchOfferLogCompactionpublic javax.ws.rs.core.Response launchOfferLogCompaction(VitamContext vitamContext) throws StorageDriverException Description copied from interface:Connectionlaunch Offer Log Compaction- Returns:
- RequestResponse
- Throws:
- StorageDriverException- to be thrown in case of any driver exception
 
- 
staticConsumeAnyEntityAndClosepublic static void staticConsumeAnyEntityAndClose(javax.ws.rs.core.Response response) This method consume everything (in particular InputStream) and close the response.- Parameters:
- response-
 
- 
consumeAnyEntityAndClosepublic final void consumeAnyEntityAndClose(javax.ws.rs.core.Response response) Description copied from interface:MockOrRestClientHelper when an error occurs on client usage side to consume response however- Specified by:
- consumeAnyEntityAndClosein interface- MockOrRestClient
 
- 
checkStatusDescription copied from interface:MockOrRestClientCheck the status from the service- Specified by:
- checkStatusin interface- MockOrRestClient
- Throws:
- VitamApplicationServerException- if the Server is unavailable
 
- 
checkStatuspublic void checkStatus(javax.ws.rs.core.MultivaluedHashMap<String, Object> headers) throws VitamApplicationServerExceptionDescription copied from interface:MockOrRestClientCheck the status from the service used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificate- Specified by:
- checkStatusin interface- MockOrRestClient
- Throws:
- VitamApplicationServerException- if the Server is unavailable
 
- 
getResourcePathDescription copied from interface:MockOrRestClientGet the resource path of the server.- Specified by:
- getResourcePathin interface- MockOrRestClient
- Returns:
- the resource path as string
 
- 
getServiceUrlDescription copied from interface:MockOrRestClientGet the service URL- Specified by:
- getServiceUrlin interface- MockOrRestClient
- Returns:
- the service URL
 
- 
closepublic void close()Description copied from interface:MockOrRestClientClose the underneath http client- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- MockOrRestClient
- Specified by:
- closein interface- VitamAutoCloseable
 
- 
toString
- 
makeSpecifyingUrlpublic javax.ws.rs.core.Response makeSpecifyingUrl(VitamRequestBuilder request) throws VitamClientInternalException - Throws:
- VitamClientInternalException
 
- 
makepublic javax.ws.rs.core.Response make(VitamRequestBuilder request) throws VitamClientInternalException - Throws:
- VitamClientInternalException
 
- 
getClientFactory
- 
getClientpublic javax.ws.rs.client.Client getClient()
- 
getChunkedClientpublic javax.ws.rs.client.Client getChunkedClient()
 
-