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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addOffersTo​(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)
      void addOfferTo​(java.lang.String offerId, java.lang.String driverName)
      Add one offer to a driver's offers persisted list (and persists it)
      java.util.List<java.lang.String> getOffersFor​(java.lang.String driverName)
      Get persisted offers list for a driver
      void removeOffersTo​(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)
      void removeOfferTo​(java.lang.String offerId, java.lang.String driverName)
      Remove one offer to a driver's offers persisted list (and persists it)
    • Method Detail

      • getOffersFor

        java.util.List<java.lang.String> getOffersFor​(java.lang.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​(java.lang.String offerId,
                        java.lang.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​(java.util.List<java.lang.String> offersIdsToAdd,
                         java.lang.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​(java.lang.String offerId,
                           java.lang.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​(java.util.List<java.lang.String> offersIdsToRemove,
                            java.lang.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)