Interface IDemandServiceProvider
-
public interface IDemandServiceProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Demandcreate(Demand demand)Creates a demandNotificationcreate(Notification notification)Creates a notificationNotificationEventcreate(NotificationEvent notificationEvent)Creates a notification eventvoiddeleteAllDemandByCustomerId(String strCustomerId)Deletion of the demand and data related to the demand.Collection<Demand>findByCustomerId(String strCustomerId)Finds demands for the specified customer idDemandfindByPrimaryKey(String strDemandId, String strDemandTypeId, String strCustomerId)Finds a demand for the specified id and type idCollection<Demand>findByReference(String strReference)Finds demands for the specified referenceList<NotificationEvent>findEventsByDateAndDemandTypeIdAndStatus(long dStart, long dEnd, String strDemandTypeId, String strStatus)Finds events by date and demand_type_id and statusOptional<DemandType>getDemandType(String type_id)get demand type by type_idList<DemandType>getDemandTypesList()get demand types listList<Integer>getIdsByCustomerIdAndDemandTypeId(String strCustomerId, String strNotificationType, String strIdDemandType)get demand Ids by customer Id and demand TypeOptional<TemporaryStatus>getStatusByLabel(String strStatusLabel)get status by like '%strStatus%'voidremove(String strDemandId, String strDemandTypeId, String strCustomerId)Removes a demand with the specified id and type idvoidsetDemandDao(IDemandDAO dao)init DAOvoidsetNotificationDao(INotificationDAO dao)init DAOvoidsetNotificationEventDao(INotificationEventDAO dao)init DAOvoidsetStatusDao(ITemporaryStatusDAO dao)init DAODemandupdate(Demand demand)Updates a demandvoidupdateDemandsStatusId(int nNewStatusId, int nTemporaryStatusId)Update status demand
-
-
-
Method Detail
-
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 idstrDemandTypeId- the demand type id- Returns:
- the demand if found,
nullotherwise
-
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 idnTemporaryStatusId- 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 idstrDemandTypeId- 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-
-
-