Class FileDriverMapper
- java.lang.Object
-
- fr.gouv.vitam.storage.engine.server.spi.mapper.FileDriverMapper
-
- All Implemented Interfaces:
DriverMapper
public class FileDriverMapper extends java.lang.Object implements 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOffersTo(java.util.List<java.lang.String> offersIdsToAdd, java.lang.String driverName)Add list of offers to a driver's offers persisted list (and persists it)voidaddOfferTo(java.lang.String offerId, java.lang.String driverName)Add one offer to a driver's offers persisted list (and persists it)static FileDriverMappergetInstance()Get the driver mapper instancejava.util.List<java.lang.String>getOffersFor(java.lang.String driverName)Get persisted offers list for a drivervoidremoveOffersTo(java.util.List<java.lang.String> offersIdsToRemove, java.lang.String driverName)Remove list of offers to a driver's offers persisted list (and persist it)voidremoveOfferTo(java.lang.String offerId, java.lang.String driverName)Remove one offer to a driver's offers persisted list (and persists it)
-
-
-
Method Detail
-
getInstance
public static FileDriverMapper getInstance() throws StorageDriverMapperException
Get the driver mapper instance- Returns:
- the FileDriverMapper instance
- Throws:
StorageDriverMapperException- if cannot initialize FileDriverMapper (error with the configuration file)
-
getOffersFor
public java.util.List<java.lang.String> getOffersFor(java.lang.String driverName) throws StorageDriverMapperExceptionDescription 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
public void addOfferTo(java.lang.String offerId, java.lang.String driverName) throws StorageDriverMapperExceptionDescription 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(java.util.List<java.lang.String> offersIdsToAdd, java.lang.String driverName) throws StorageDriverMapperExceptionDescription 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
public void removeOfferTo(java.lang.String offerId, java.lang.String driverName) throws StorageDriverMapperExceptionDescription 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(java.util.List<java.lang.String> offersIdsToRemove, java.lang.String driverName) throws StorageDriverMapperExceptionDescription 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)
-
-