Interface IDemandServiceProvider
public interface IDemandServiceProvider
-
Method Summary
Modifier and TypeMethodDescriptionCreates a demandcreate(Notification notification) Creates a notificationcreate(NotificationEvent notificationEvent) Creates a notification eventvoiddeleteAllDemandByCustomerId(String strCustomerId) Deletion of the demand and data related to the demand.findByCustomerId(String strCustomerId) Finds demands for the specified customer idfindByPrimaryKey(String strDemandId, String strDemandTypeId, String strCustomerId) Finds a demand for the specified id and type idfindByReference(String strReference) Finds demands for the specified referencefindEventsByDateAndDemandTypeIdAndStatus(long dStart, long dEnd, String strDemandTypeId, String strStatus) Finds events by date and demand_type_id and statusgetDemandType(String type_id) get demand type by type_idget demand types listgetIdsByCustomerIdAndDemandTypeId(String strCustomerId, String strNotificationType, String strIdDemandType) get demand Ids by customer Id and demand TypegetStatusByLabel(String strStatusLabel) get status by like '%strStatus%'voidRemoves a demand with the specified id and type idvoidsetDemandDao(IDemandDAO dao) init DAOvoidinit DAOvoidinit DAOvoidinit DAOUpdates a demandvoidupdateDemandsStatusId(int nNewStatusId, int nTemporaryStatusId) Update status demand
-
Method Details
-
setDemandDao
init DAO- Parameters:
dao-
-
setNotificationDao
init DAO- Parameters:
dao-
-
setNotificationEventDao
init DAO- Parameters:
dao-
-
setStatusDao
init DAO- Parameters:
dao-
-
findByCustomerId
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
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
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
Creates a demand- Parameters:
demand- the demand to create- Returns:
- the created demand
-
create
Creates a notification- Parameters:
notification- the notification to create- Returns:
- the created notification
-
create
Creates a notification event- Parameters:
notificationEvent-- Returns:
- the created notification event
-
update
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
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
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
get status by like '%strStatus%'- Parameters:
strStatus-- Returns:
- Only the first status found returned
-
deleteAllDemandByCustomerId
Deletion of the demand and data related to the demand.- Parameters:
strCustomerId-
-