Package fr.gouv.vitam.storage.engine.server.spi.mapper

# Interface DriverMapper

All Known Implementing Classes:
  `FileDriverMapper`

public interface DriverMapper
Interface use to implement DriverMapper. This object is use to persist informations about drivers and offers associations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `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)
  `List<String>`
  `getOffersFor(String driverName)`
  Get persisted offers list for a driver
  `void`
  `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

  - ### getOffersFor

    List<String> getOffersFor(String driverName) throws StorageDriverMapperException
    Get persisted offers list for a driver
    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

    void addOfferTo(String offerId, String driverName) throws StorageDriverMapperException
    Add one offer to a driver's offers persisted list (and persists it)
    Parameters:
      `offerId` - the offer ID to append and persist
      `driverName` - the driver name
    Throws:
      `StorageDriverMapperException` - if application cannot have information (writing error for example)

  - ### addOffersTo

    void addOffersTo(List<String> offersIdsToAdd, String driverName) throws StorageDriverMapperException
    Add list of offers to a driver's offers persisted list (and persists it)
    Parameters:
      `offersIdsToAdd` - the offers IDs list to append and persist
      `driverName` - the driver name
    Throws:
      `StorageDriverMapperException` - if application cannot have information (writing error for example)

  - ### removeOfferTo

    void removeOfferTo(String offerId, String driverName) throws StorageDriverMapperException
    Remove one offer to a driver's offers persisted list (and persists it)
    Parameters:
      `offerId` - the offer ID to remove and persist
      `driverName` - the driver name
    Throws:
      `StorageDriverMapperException` - if application cannot have information (writing error for example)

  - ### removeOffersTo

    void removeOffersTo(List<String> offersIdsToRemove, String driverName) throws StorageDriverMapperException
    Remove list of offers to a driver's offers persisted list (and persist it)
    Parameters:
      `offersIdsToRemove` - the offers IDs list to remove and persist
      `driverName` - the driver name
    Throws:
      `StorageDriverMapperException` - if application cannot have information (writing error for example)