Class FileDriverMapper
java.lang.Object
fr.gouv.vitam.storage.engine.server.spi.mapper.FileDriverMapper
- All Implemented Interfaces:
DriverMapper
The driver mapper implementation
Using file to persist driver / offer association. One file by driver (the
filename is the driver name). In the file, offers are isolated by delimiter.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddOffersTo(List<String> offersIdsToAdd, String driverName) Add list of offers to a driver's offers persisted list (and persists it)voidaddOfferTo(String offerId, String driverName) Add one offer to a driver's offers persisted list (and persists it)static FileDriverMapperGet the driver mapper instancegetOffersFor(String driverName) Get persisted offers list for a drivervoidremoveOffersTo(List<String> offersIdsToRemove, String driverName) Remove list of offers to a driver's offers persisted list (and persist it)voidremoveOfferTo(String offerId, String driverName) Remove one offer to a driver's offers persisted list (and persists it)
-
Method Details
-
getInstance
Get the driver mapper instance- Returns:
- the FileDriverMapper instance
- Throws:
StorageDriverMapperException- if cannot initialize FileDriverMapper (error with the configuration file)
-
getOffersFor
Description copied from interface:DriverMapperGet persisted offers list for a driver- Specified by:
getOffersForin interfaceDriverMapper- Parameters:
driverName- the driver name- Returns:
- offers IDs list for driverName or empty list if there is actually no association
- Throws:
StorageDriverMapperException- if application cannot have information (reading error for example)
-
addOfferTo
Description copied from interface:DriverMapperAdd one offer to a driver's offers persisted list (and persists it)- Specified by:
addOfferToin interfaceDriverMapper- Parameters:
offerId- the offer ID to append and persistdriverName- the driver name- Throws:
StorageDriverMapperException- if application cannot have information (writing error for example)
-
addOffersTo
public void addOffersTo(List<String> offersIdsToAdd, String driverName) throws StorageDriverMapperException Description copied from interface:DriverMapperAdd list of offers to a driver's offers persisted list (and persists it)- Specified by:
addOffersToin interfaceDriverMapper- Parameters:
offersIdsToAdd- the offers IDs list to append and persistdriverName- the driver name- Throws:
StorageDriverMapperException- if application cannot have information (writing error for example)
-
removeOfferTo
Description copied from interface:DriverMapperRemove one offer to a driver's offers persisted list (and persists it)- Specified by:
removeOfferToin interfaceDriverMapper- Parameters:
offerId- the offer ID to remove and persistdriverName- the driver name- Throws:
StorageDriverMapperException- if application cannot have information (writing error for example)
-
removeOffersTo
public void removeOffersTo(List<String> offersIdsToRemove, String driverName) throws StorageDriverMapperException Description copied from interface:DriverMapperRemove list of offers to a driver's offers persisted list (and persist it)- Specified by:
removeOffersToin interfaceDriverMapper- Parameters:
offersIdsToRemove- the offers IDs list to remove and persistdriverName- the driver name- Throws:
StorageDriverMapperException- if application cannot have information (writing error for example)
-