Interface IDemandServiceProvider


  • public interface IDemandServiceProvider
    • Method Detail

      • setDemandDao

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

        void setDemandTypeDao​(IDemandTypeDAO 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​(IDemandStatusDAO 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)
        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
      • remove

        void remove​(String strDemandId,
                    String strDemandTypeId)
        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​(int id)
        get demand type
        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<DemandStatus> getStatusByLabel​(String strStatusLabel)
        get status
        Parameters:
        strStatusLabel -
        Returns:
        the status