Class MockNotificationDAO

    • Constructor Detail

      • MockNotificationDAO

        public MockNotificationDAO()
    • Method Detail

      • loadByDemand

        public java.util.List<Notification> loadByDemand​(java.lang.String strDemandId,
                                                         java.lang.String strDemandTypeId,
                                                         java.lang.String strCustomerID)
        Finds notifications associated to the specified demand id and demand type id. The notifications must be sorted by date descending
        Specified by:
        loadByDemand in interface INotificationDAO
        Parameters:
        strDemandId - the demand id
        strDemandTypeId - the demand type id
        Returns:
        the notifications. An empty list is returned if no notification has been found.
      • loadByFilter

        public java.util.List<Notification> loadByFilter​(NotificationFilter notificationFilter)
        Finds and populate notification according to the filter
        Specified by:
        loadByFilter in interface INotificationDAO
        Parameters:
        notificationFilter - the filter
        Returns:
        the notifications. An empty list is returned if no notification has been found.
      • insert

        public Notification insert​(Notification notification)
        Inserts a notification
        Specified by:
        insert in interface INotificationDAO
        Parameters:
        notification - the notification to insert
        Returns:
        the inserted notification
      • deleteByDemand

        public void deleteByDemand​(java.lang.String strDemandId,
                                   java.lang.String strDemandTypeId,
                                   java.lang.String strCustomerID)
        Deletes notifications associated to the specified demand id and demand type id
        Specified by:
        deleteByDemand in interface INotificationDAO
        Parameters:
        strDemandId - the demand id
        strDemandTypeId - the demand type id
      • loadIdsByFilter

        public java.util.List<java.lang.Integer> loadIdsByFilter​(NotificationFilter notificationFilter)
        Load the ids of the notification by filter
        Specified by:
        loadIdsByFilter in interface INotificationDAO
        Parameters:
        notificationFilter - The notification filter
        Returns:
        The list of notifications ids
      • loadById

        public java.util.Optional<Notification> loadById​(int nId)
        Finds notifications associated to the id
        Specified by:
        loadById in interface INotificationDAO
        Returns:
        the notification coresponding to given id.
      • loadByDemandAndDate

        public java.util.List<Notification> loadByDemandAndDate​(java.lang.String strDemandId,
                                                                java.lang.String strDemandTypeId,
                                                                long lDate)
        Description copied from interface: INotificationDAO
        Get notification by demand ids and notification date
        Specified by:
        loadByDemandAndDate in interface INotificationDAO
        Returns:
        the notification
      • loadByDemandIdTypeIdCustomerId

        public java.util.List<Notification> loadByDemandIdTypeIdCustomerId​(java.lang.String strDemandId,
                                                                           java.lang.String strDemandTypeId,
                                                                           java.lang.String strCustomerId,
                                                                           NotificationFilter filter)
        Description copied from interface: INotificationDAO
        Finds and populate notification by demand id, type id, customer id
        Specified by:
        loadByDemandIdTypeIdCustomerId in interface INotificationDAO
        Returns:
        the notifications. An empty list is returned if no notification has been found.
      • existsNotificationWithDemandTypeId

        public boolean existsNotificationWithDemandTypeId​(int nDemandTypeId)
        Description copied from interface: INotificationDAO
        test if a notification exists for the specified demand_type_id
        Specified by:
        existsNotificationWithDemandTypeId in interface INotificationDAO
        Returns:
        true id exists
      • reassignNotifications

        public void reassignNotifications​(java.lang.String strOldCustomerId,
                                          java.lang.String strNewCustomerId)
        Description copied from interface: INotificationDAO
        Reassign notifications
        Specified by:
        reassignNotifications in interface INotificationDAO