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(java.lang.String strCustomerId)Deletion of the demand and data related to the demand.java.util.Collection<Demand>findByCustomerId(java.lang.String strCustomerId)Finds demands for the specified customer idDemandfindByPrimaryKey(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.String strCustomerId)Finds a demand for the specified id and type idjava.util.Collection<Demand>findByReference(java.lang.String strReference)Finds demands for the specified referencejava.util.List<NotificationEvent>findEventsByDateAndDemandTypeIdAndStatus(long dStart, long dEnd, java.lang.String strDemandTypeId, java.lang.String strStatus)Finds events by date and demand_type_id and statusjava.util.Optional<DemandType>getDemandType(java.lang.String type_id)get demand type by type_idjava.util.List<DemandType>getDemandTypesList()get demand types listjava.util.List<java.lang.Integer>getIdsByCustomerIdAndDemandTypeId(java.lang.String strCustomerId, java.lang.String strNotificationType, java.lang.String strIdDemandType)get demand Ids by customer Id and demand Typejava.util.Optional<TemporaryStatus>getStatusByLabel(java.lang.String strStatusLabel)get status by like '%strStatus%'voidremove(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.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
java.util.Collection<Demand> findByCustomerId(java.lang.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
java.util.Collection<Demand> findByReference(java.lang.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(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.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(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.String strCustomerId)Removes a demand with the specified id and type id- Parameters:
strDemandId- the demand idstrDemandTypeId- the demand type id
-
findEventsByDateAndDemandTypeIdAndStatus
java.util.List<NotificationEvent> findEventsByDateAndDemandTypeIdAndStatus(long dStart, long dEnd, java.lang.String strDemandTypeId, java.lang.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
java.util.List<DemandType> getDemandTypesList()
get demand types list- Returns:
- the list
-
getDemandType
java.util.Optional<DemandType> getDemandType(java.lang.String type_id)
get demand type by type_id- Parameters:
id-- Returns:
- the demand type as optional
-
getIdsByCustomerIdAndDemandTypeId
java.util.List<java.lang.Integer> getIdsByCustomerIdAndDemandTypeId(java.lang.String strCustomerId, java.lang.String strNotificationType, java.lang.String strIdDemandType)get demand Ids by customer Id and demand Type- Parameters:
strCustomerId-strNotificationType-strIdDemandType-- Returns:
- the demand Id list
-
getStatusByLabel
java.util.Optional<TemporaryStatus> getStatusByLabel(java.lang.String strStatusLabel)
get status by like '%strStatus%'- Parameters:
strStatus-- Returns:
- Only the first status found returned
-
deleteAllDemandByCustomerId
void deleteAllDemandByCustomerId(java.lang.String strCustomerId)
Deletion of the demand and data related to the demand.- Parameters:
strCustomerId-
-
-