Class DemandService
java.lang.Object
fr.paris.lutece.portal.service.cache.AbstractCacheableService
fr.paris.lutece.plugins.notificationstore.service.DemandService
- All Implemented Interfaces:
fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider,fr.paris.lutece.portal.service.cache.CacheableService,fr.paris.lutece.portal.service.util.LuteceService,Cloneable,net.sf.ehcache.event.CacheEventListener
public class DemandService
extends fr.paris.lutece.portal.service.cache.AbstractCacheableService
implements fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
This class manages demands
-
Constructor Summary
ConstructorsConstructorDescriptionConstructorDemandService(fr.paris.lutece.plugins.grubusiness.business.demand.IDemandDAO _demandDao, fr.paris.lutece.plugins.grubusiness.business.notification.INotificationDAO _notificationDao, fr.paris.lutece.plugins.grubusiness.business.notification.INotificationEventDAO _notificationEventDao, fr.paris.lutece.plugins.grubusiness.business.demand.ITemporaryStatusDAO _statusDao) Constructor -
Method Summary
Modifier and TypeMethodDescriptionfr.paris.lutece.plugins.grubusiness.business.demand.Demandcreate(fr.paris.lutece.plugins.grubusiness.business.demand.Demand demand) Creates a demandfr.paris.lutece.plugins.grubusiness.business.notification.Notificationcreate(fr.paris.lutece.plugins.grubusiness.business.notification.Notification notification) Creates a notificationfr.paris.lutece.plugins.grubusiness.business.notification.NotificationEventcreate(fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent notificationEvent) Creates a notification eventvoiddeleteAllDemandByCustomerId(String strCustomerId) Collection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand>findByCustomerId(String strCustomerId) Finds demands for the specified customer idfr.paris.lutece.plugins.grubusiness.business.demand.DemandfindByPrimaryKey(String strDemandId, String strDemandTypeId, String strCustomerId) Finds a demand for the specified id and type idCollection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand>findByReference(String strReference) Finds demands for the specified referenceList<fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent>findEventsByDateAndDemandTypeIdAndStatus(long dStart, long dEnd, String strDemandTypeId, String strStatus) Finds events by date and demand_type_id and statusList<fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent>findEventsByDateAndDemandTypeIdAndStatusAndType(long dStart, long dEnd, String strDemandTypeId, String strStatus, List<fr.paris.lutece.plugins.grubusiness.business.notification.EnumNotificationType> lTypes) Finds events by date and demand_type_id and statusOptional<fr.paris.lutece.plugins.grubusiness.business.demand.DemandType>getDemandType(String type_id) get demand Type listList<fr.paris.lutece.plugins.grubusiness.business.demand.DemandType>get demand Type listgetIdsByCustomerIdAndDemandTypeId(String strCustomerId, String strNotificationType, String strIdDemandType) get demand Ids by CustomerId and DemandTypeIdgetName()Optional<fr.paris.lutece.plugins.grubusiness.business.demand.TemporaryStatus>getStatusByLabel(String strStatusLabel) voidRemoves a demand with the specified id and type idvoidsetDemandDao(fr.paris.lutece.plugins.grubusiness.business.demand.IDemandDAO dao) voidsetNotificationDao(fr.paris.lutece.plugins.grubusiness.business.notification.INotificationDAO dao) voidsetNotificationEventDao(fr.paris.lutece.plugins.grubusiness.business.notification.INotificationEventDAO dao) voidsetStatusDao(fr.paris.lutece.plugins.grubusiness.business.demand.ITemporaryStatusDAO dao) fr.paris.lutece.plugins.grubusiness.business.demand.Demandupdate(fr.paris.lutece.plugins.grubusiness.business.demand.Demand demand) Updates a demandvoidupdateDemandsStatusId(int nNewStatusId, int nTemporaryStatusId) Update status demandMethods inherited from class fr.paris.lutece.portal.service.cache.AbstractCacheableService
clone, dispose, enableCache, getCache, getCacheSize, getFromCache, getInfos, getKeys, getMaxElements, getMemorySize, getStatistics, getTimeToLive, initCache, initCache, isCacheEnable, notifyElementEvicted, notifyElementExpired, notifyElementPut, notifyElementRemoved, notifyElementUpdated, notifyRemoveAll, putInCache, removeKey, resetCache
-
Constructor Details
-
DemandService
public DemandService()Constructor -
DemandService
public DemandService(fr.paris.lutece.plugins.grubusiness.business.demand.IDemandDAO _demandDao, fr.paris.lutece.plugins.grubusiness.business.notification.INotificationDAO _notificationDao, fr.paris.lutece.plugins.grubusiness.business.notification.INotificationEventDAO _notificationEventDao, fr.paris.lutece.plugins.grubusiness.business.demand.ITemporaryStatusDAO _statusDao) Constructor- Parameters:
_demandDao-_notificationDao-_notificationEventDao-_statusDao-
-
-
Method Details
-
findByCustomerId
public Collection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand> findByCustomerId(String strCustomerId) Finds demands for the specified customer id- Specified by:
findByCustomerIdin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Parameters:
strCustomerId- the customer id- Returns:
- the demands. An empty collection is returned if no demand has been found
-
findByReference
public Collection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand> findByReference(String strReference) Finds demands for the specified reference- Specified by:
findByReferencein interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Parameters:
strReference- the reference- Returns:
- the demands. An empty collection is returned if no demand has been found
-
findByPrimaryKey
public fr.paris.lutece.plugins.grubusiness.business.demand.Demand findByPrimaryKey(String strDemandId, String strDemandTypeId, String strCustomerId) Finds a demand for the specified id and type id- Specified by:
findByPrimaryKeyin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Parameters:
strDemandId- the demand idstrDemandTypeId- the demand type id- Returns:
- the demand if found,
nullotherwise
-
create
public fr.paris.lutece.plugins.grubusiness.business.demand.Demand create(fr.paris.lutece.plugins.grubusiness.business.demand.Demand demand) Creates a demand- Specified by:
createin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Parameters:
demand- the demand to create- Returns:
- the created demand
-
create
public fr.paris.lutece.plugins.grubusiness.business.notification.Notification create(fr.paris.lutece.plugins.grubusiness.business.notification.Notification notification) Creates a notification- Specified by:
createin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Parameters:
notification- the notification to create- Returns:
- the created notification
-
create
public fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent create(fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent notificationEvent) Creates a notification event- Specified by:
createin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Parameters:
notificationEvent-- Returns:
- the created notification event
-
update
public fr.paris.lutece.plugins.grubusiness.business.demand.Demand update(fr.paris.lutece.plugins.grubusiness.business.demand.Demand demand) Updates a demand- Specified by:
updatein interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Parameters:
demand- the demand to update- Returns:
- the updated demand
-
updateDemandsStatusId
public void updateDemandsStatusId(int nNewStatusId, int nTemporaryStatusId) Update status demand- Specified by:
updateDemandsStatusIdin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- 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- Specified by:
removein interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Parameters:
strDemandId- the demand idstrDemandTypeId- the demand type id
-
findEventsByDateAndDemandTypeIdAndStatus
public List<fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent> findEventsByDateAndDemandTypeIdAndStatus(long dStart, long dEnd, String strDemandTypeId, String strStatus) Finds events by date and demand_type_id and status- Specified by:
findEventsByDateAndDemandTypeIdAndStatusin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Parameters:
dStart-dEnd-strDemandTypeId-strStatus-- Returns:
- the demands. An empty list is returned if no event has been found
-
findEventsByDateAndDemandTypeIdAndStatusAndType
public List<fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent> findEventsByDateAndDemandTypeIdAndStatusAndType(long dStart, long dEnd, String strDemandTypeId, String strStatus, List<fr.paris.lutece.plugins.grubusiness.business.notification.EnumNotificationType> lTypes) 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
get demand Type list- Specified by:
getDemandTypesListin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Returns:
- the demand type list
-
getDemandType
public Optional<fr.paris.lutece.plugins.grubusiness.business.demand.DemandType> getDemandType(String type_id) get demand Type list- Specified by:
getDemandTypein interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Returns:
- the demand type list
-
getIdsByCustomerIdAndDemandTypeId
public List<Integer> getIdsByCustomerIdAndDemandTypeId(String strCustomerId, String strNotificationType, String strIdDemandType) get demand Ids by CustomerId and DemandTypeId- Specified by:
getIdsByCustomerIdAndDemandTypeIdin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider- Returns:
- the demand id list
-
setDemandDao
public void setDemandDao(fr.paris.lutece.plugins.grubusiness.business.demand.IDemandDAO dao) - Specified by:
setDemandDaoin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
-
setNotificationEventDao
public void setNotificationEventDao(fr.paris.lutece.plugins.grubusiness.business.notification.INotificationEventDAO dao) - Specified by:
setNotificationEventDaoin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
-
setNotificationDao
public void setNotificationDao(fr.paris.lutece.plugins.grubusiness.business.notification.INotificationDAO dao) - Specified by:
setNotificationDaoin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
-
setStatusDao
public void setStatusDao(fr.paris.lutece.plugins.grubusiness.business.demand.ITemporaryStatusDAO dao) - Specified by:
setStatusDaoin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
-
getStatusByLabel
public Optional<fr.paris.lutece.plugins.grubusiness.business.demand.TemporaryStatus> getStatusByLabel(String strStatusLabel) - Specified by:
getStatusByLabelin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
-
deleteAllDemandByCustomerId
- Specified by:
deleteAllDemandByCustomerIdin interfacefr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
-
getName
- Specified by:
getNamein interfacefr.paris.lutece.portal.service.util.LuteceService
-