Interface IDemandServiceProvider


public interface IDemandServiceProvider
  • Method Details

    • setDemandDao

      void setDemandDao(IDemandDAO dao)
      init DAO
      Parameters:
      dao -
    • setNotificationDao

      void setNotificationDao(INotificationDAO dao)
      init DAO
      Parameters:
      dao -
    • setNotificationEventDao

      void setNotificationEventDao(INotificationEventDAO dao)
      init DAO
      Parameters:
      dao -
    • setStatusDao

      void setStatusDao(ITemporaryStatusDAO dao)
      init DAO
      Parameters:
      dao -
    • findByCustomerId

      Collection<Demand> findByCustomerId(String strCustomerId)
      Finds demands for the specified customer id
      Parameters:
      strCustomerId - the customer id
      Returns:
      the demands. An empty collection is returned if no demand has been found
    • findByReference

      Collection<Demand> findByReference(String strReference)
      Finds demands for the specified reference
      Parameters:
      strReference - the reference
      Returns:
      the demands. An empty collection is returned if no demand has been found
    • findByPrimaryKey

      Demand findByPrimaryKey(String strDemandId, String strDemandTypeId, String strCustomerId)
      Finds a demand for the specified id and type id
      Parameters:
      strDemandId - the demand id
      strDemandTypeId - the demand type id
      Returns:
      the demand if found, null otherwise
    • create

      Demand create(Demand demand)
      Creates a demand
      Parameters:
      demand - the demand to create
      Returns:
      the created demand
    • create

      Notification create(Notification notification)
      Creates a notification
      Parameters:
      notification - the notification to create
      Returns:
      the created notification
    • create

      NotificationEvent create(NotificationEvent notificationEvent)
      Creates a notification event
      Parameters:
      notificationEvent -
      Returns:
      the created notification event
    • update

      Demand update(Demand demand)
      Updates a demand
      Parameters:
      demand - the demand to update
      Returns:
      the updated demand
    • updateDemandsStatusId

      void updateDemandsStatusId(int nNewStatusId, int nTemporaryStatusId)
      Update status demand
      Parameters:
      nNewStatusId - the new status id
      nTemporaryStatusId - To find Demands that are linked to notifications that have the temporary status in parameter
    • remove

      void remove(String strDemandId, String strDemandTypeId, String strCustomerId)
      Removes a demand with the specified id and type id
      Parameters:
      strDemandId - the demand id
      strDemandTypeId - the demand type id
    • findEventsByDateAndDemandTypeIdAndStatus

      List<NotificationEvent> findEventsByDateAndDemandTypeIdAndStatus(long dStart, long dEnd, String strDemandTypeId, String strStatus)
      Finds events by date and demand_type_id and status
      Parameters:
      dStart -
      dEnd -
      strDemandTypeId -
      strStatus -
      Returns:
      the demands. An empty list is returned if no event has been found
    • getDemandTypesList

      List<DemandType> getDemandTypesList()
      get demand types list
      Returns:
      the list
    • getDemandType

      Optional<DemandType> getDemandType(String type_id)
      get demand type by type_id
      Parameters:
      id -
      Returns:
      the demand type as optional
    • getIdsByCustomerIdAndDemandTypeId

      List<Integer> getIdsByCustomerIdAndDemandTypeId(String strCustomerId, String strNotificationType, String strIdDemandType)
      get demand Ids by customer Id and demand Type
      Parameters:
      strCustomerId -
      strNotificationType -
      strIdDemandType -
      Returns:
      the demand Id list
    • getStatusByLabel

      Optional<TemporaryStatus> getStatusByLabel(String strStatusLabel)
      get status by like '%strStatus%'
      Parameters:
      strStatus -
      Returns:
      Only the first status found returned
    • deleteAllDemandByCustomerId

      void deleteAllDemandByCustomerId(String strCustomerId)
      Deletion of the demand and data related to the demand.
      Parameters:
      strCustomerId -