Class MockNotificationDAO
- java.lang.Object
-
- fr.paris.lutece.plugins.grubusiness.business.mock.MockNotificationDAO
-
- All Implemented Interfaces:
INotificationDAO
public class MockNotificationDAO extends java.lang.Object implements INotificationDAO
This class is a mock implementation ofINotificationDAO
-
-
Constructor Summary
Constructors Constructor Description MockNotificationDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(int id)delete notificationvoiddeleteByDemand(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.String strCustomerID)Deletes notifications associated to the specified demand id and demand type idbooleanexistsNotificationWithDemandTypeId(int nDemandTypeId)test if a notification exists for the specified demand_type_idNotificationinsert(Notification notification)Inserts a notificationjava.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.java.util.List<Notification>loadByDemandAndDate(java.lang.String strDemandId, java.lang.String strDemandTypeId, long lDate)Get notification by demand ids and notification datejava.util.List<Notification>loadByDemandIdTypeIdCustomerId(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.String strCustomerId, NotificationFilter filter)Finds and populate notification by demand id, type id, customer idjava.util.List<Notification>loadByFilter(NotificationFilter notificationFilter)Finds and populate notification according to the filterjava.util.Optional<Notification>loadById(int nId)Finds notifications associated to the idjava.util.List<Notification>loadByIds(java.util.List<java.lang.Integer> listIds)Loads list by Idsjava.util.List<java.lang.String>loadDistinctDemandTypeIds()load distinct demand type idsjava.util.List<java.lang.Integer>loadIdsByFilter(NotificationFilter notificationFilter)Load the ids of the notification by filterNotificationloadLastNotifByDemandIdAndDemandTypeId(java.lang.String strDemandId, java.lang.String strDemandTypeId)Find last notification by demand id and demand type idvoidreassignNotifications(java.lang.String strOldCustomerId, java.lang.String strNewCustomerId)Reassign notifications
-
-
-
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:
loadByDemandin interfaceINotificationDAO- Parameters:
strDemandId- the demand idstrDemandTypeId- 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:
loadByFilterin interfaceINotificationDAO- 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:
insertin interfaceINotificationDAO- 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:
deleteByDemandin interfaceINotificationDAO- Parameters:
strDemandId- the demand idstrDemandTypeId- 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:
loadIdsByFilterin interfaceINotificationDAO- 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:
loadByIdin interfaceINotificationDAO- 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:INotificationDAOGet notification by demand ids and notification date- Specified by:
loadByDemandAndDatein interfaceINotificationDAO- Returns:
- the notification
-
loadDistinctDemandTypeIds
public java.util.List<java.lang.String> loadDistinctDemandTypeIds()
Description copied from interface:INotificationDAOload distinct demand type ids- Specified by:
loadDistinctDemandTypeIdsin interfaceINotificationDAO- Returns:
- the id list
-
loadByIds
public java.util.List<Notification> loadByIds(java.util.List<java.lang.Integer> listIds)
Description copied from interface:INotificationDAOLoads list by Ids- Specified by:
loadByIdsin interfaceINotificationDAO- Returns:
- list of Notification
-
delete
public void delete(int id)
Description copied from interface:INotificationDAOdelete notification- Specified by:
deletein interfaceINotificationDAO
-
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:INotificationDAOFinds and populate notification by demand id, type id, customer id- Specified by:
loadByDemandIdTypeIdCustomerIdin interfaceINotificationDAO- Returns:
- the notifications. An empty list is returned if no notification has been found.
-
loadLastNotifByDemandIdAndDemandTypeId
public Notification loadLastNotifByDemandIdAndDemandTypeId(java.lang.String strDemandId, java.lang.String strDemandTypeId)
Description copied from interface:INotificationDAOFind last notification by demand id and demand type id- Specified by:
loadLastNotifByDemandIdAndDemandTypeIdin interfaceINotificationDAO- Returns:
- last notification
-
existsNotificationWithDemandTypeId
public boolean existsNotificationWithDemandTypeId(int nDemandTypeId)
Description copied from interface:INotificationDAOtest if a notification exists for the specified demand_type_id- Specified by:
existsNotificationWithDemandTypeIdin interfaceINotificationDAO- Returns:
- true id exists
-
reassignNotifications
public void reassignNotifications(java.lang.String strOldCustomerId, java.lang.String strNewCustomerId)Description copied from interface:INotificationDAOReassign notifications- Specified by:
reassignNotificationsin interfaceINotificationDAO
-
-