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 TypeMethodDescriptionvoid
addOffersTo
(List<String> offersIdsToAdd, String driverName) Add list of offers to a driver's offers persisted list (and persists it)void
addOfferTo
(String offerId, String driverName) Add one offer to a driver's offers persisted list (and persists it)static FileDriverMapper
Get the driver mapper instancegetOffersFor
(String driverName) Get persisted offers list for a drivervoid
removeOffersTo
(List<String> offersIdsToRemove, String driverName) Remove list of offers to a driver's offers persisted list (and persist it)void
removeOfferTo
(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:DriverMapper
Get persisted offers list for a driver- Specified by:
getOffersFor
in 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:DriverMapper
Add one offer to a driver's offers persisted list (and persists it)- Specified by:
addOfferTo
in 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:DriverMapper
Add list of offers to a driver's offers persisted list (and persists it)- Specified by:
addOffersTo
in 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:DriverMapper
Remove one offer to a driver's offers persisted list (and persists it)- Specified by:
removeOfferTo
in 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:DriverMapper
Remove list of offers to a driver's offers persisted list (and persist it)- Specified by:
removeOffersTo
in 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)
-