Package fr.gouv.vitam.storage.driver
Interface Connection
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
AbstractConnection,ConnectionImpl
public interface Connection extends java.lang.AutoCloseableRepresents a connection to the distant storage offer service that is provided by the driver when calling the connect method:
The connection implementation is driver dependent but MUST hold enough informations/parameters/configurations to be able to contact the distant offer service without the need to give additional connection related parameters on further request done with this connection. In some cases it may be considered as a "session". Note: Connection extendsmyDriver.connect(serviceUrl, parameters);AutoCloseableso the connection implementation MUST provide a close() method which responsibility is to cleanly close and remove.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StorageBulkPutResultbulkPutObjects(StorageBulkPutRequest request)Bulk put object files into the storage offer.voidclose()Override AutoCloseable implementation to specify the exceptionRequestResponse<TapeReadRequestReferentialEntity>createReadOrderRequest(StorageObjectRequest request)Asynchronous retrieve an object from the storage offer based on criterias defined in request argument.StorageBulkMetadataResultgetBulkMetadata(StorageGetBulkMetadataRequest request)Bulk get metadata of objectsStorageMetadataResultgetMetadatas(StorageGetMetadataRequest request)Get metadata of objectStorageGetResultgetObject(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 typeRequestResponse<TapeReadRequestReferentialEntity>getReadOrderRequest(java.lang.String readOrderRequestId, int tenant)StorageCapacityResultgetStorageCapacity(java.lang.Integer tenantId)Retrieve the remaining storage capacity available on the distant offer.CloseableIterator<ObjectEntry>listObjects(StorageListRequest request)List object on a container typebooleanobjectExistsInOffer(StorageObjectRequest request)Check if an object is present in the offerStoragePutResultputObject(StoragePutRequest request)Put the object file into the storage offer based on criterias defined in request argument and underlaying connection parameters.StorageRemoveResultremoveObject(StorageRemoveRequest request)Delete an object on the distant storage offer.voidremoveReadOrderRequest(java.lang.String readOrderRequestId, int tenant)
-
-
-
Method Detail
-
getStorageCapacity
StorageCapacityResult getStorageCapacity(java.lang.Integer tenantId) throws StorageDriverPreconditionFailedException, StorageDriverNotFoundException, StorageDriverException
Retrieve 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 encounteredStorageDriverNotFoundException- if container is not foundStorageDriverException- if any problem occurs during request
-
getObject
StorageGetResult getObject(StorageObjectRequest request) throws StorageDriverException
Retrieve 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 requestjava.lang.IllegalArgumentException- if request is wrong
-
createReadOrderRequest
RequestResponse<TapeReadRequestReferentialEntity> createReadOrderRequest(StorageObjectRequest request) throws StorageDriverException
Asynchronous retrieve 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 requestjava.lang.IllegalArgumentException- if request is wrong
-
getReadOrderRequest
RequestResponse<TapeReadRequestReferentialEntity> getReadOrderRequest(java.lang.String readOrderRequestId, int tenant) throws StorageDriverException
- Throws:
StorageDriverException
-
removeReadOrderRequest
void removeReadOrderRequest(java.lang.String readOrderRequestId, int tenant) throws StorageDriverException- Throws:
StorageDriverException
-
putObject
StoragePutResult putObject(StoragePutRequest request) throws StorageDriverException
Put the object file into the storage offer based on criterias defined in request argument and underlaying connection parameters.- Parameters:
request- the request to send. It may contains informations needed to store the file.- Returns:
- a result that may contains metadatas or statistics about the object put operation.
- Throws:
StorageDriverException- if any problem occurs during request
-
bulkPutObjects
StorageBulkPutResult bulkPutObjects(StorageBulkPutRequest request) throws StorageDriverException
Bulk put object files into the storage offer.- Throws:
StorageDriverException- if any problem occurs during request
-
removeObject
StorageRemoveResult removeObject(StorageRemoveRequest request) throws StorageDriverException
Delete 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
-
objectExistsInOffer
boolean objectExistsInOffer(StorageObjectRequest request) throws StorageDriverException
Check 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
-
getMetadatas
StorageMetadataResult getMetadatas(StorageGetMetadataRequest request) throws StorageDriverException
Get metadata of object- Parameters:
request-- Returns:
- a result that may contain information about the storage metadata
- Throws:
StorageDriverException
-
getBulkMetadata
StorageBulkMetadataResult getBulkMetadata(StorageGetBulkMetadataRequest request) throws StorageDriverException, InvalidParseOperationException
Bulk get metadata of objects- Parameters:
request-- Returns:
- a result that may contain information about the storage metadata
- Throws:
StorageDriverExceptionInvalidParseOperationException
-
listObjects
CloseableIterator<ObjectEntry> listObjects(StorageListRequest request) throws StorageDriverException, StorageDriverNotFoundException
List object on a container type- Parameters:
request- the request contains data needed to list container type- Returns:
- an iterator with each object metadata
- Throws:
StorageDriverExceptionStorageDriverNotFoundException
-
getOfferLogs
RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest request) throws StorageDriverException
Get a listing of offer logs on a container type- Parameters:
request- 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
-
close
void close() throws StorageDriverExceptionOverride AutoCloseable implementation to specify the exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
StorageDriverException- to be thrown in case of any driver exception
-
-