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

    Constructors
    Constructor
    Description
    Constructor
    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
  • Method Summary

    Modifier and Type
    Method
    Description
    fr.paris.lutece.plugins.grubusiness.business.demand.Demand
    create(fr.paris.lutece.plugins.grubusiness.business.demand.Demand demand)
    Creates a demand
    fr.paris.lutece.plugins.grubusiness.business.notification.Notification
    create(fr.paris.lutece.plugins.grubusiness.business.notification.Notification notification)
    Creates a notification
    fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent
    create(fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent notificationEvent)
    Creates a notification event
    void
     
    Collection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand>
    findByCustomerId(String strCustomerId)
    Finds demands for the specified customer id
    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
    Collection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand>
    findByReference(String strReference)
    Finds demands for the specified reference
    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
    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
    Optional<fr.paris.lutece.plugins.grubusiness.business.demand.DemandType>
    get demand Type list
    List<fr.paris.lutece.plugins.grubusiness.business.demand.DemandType>
    get demand Type list
    getIdsByCustomerIdAndDemandTypeId(String strCustomerId, String strNotificationType, String strIdDemandType)
    get demand Ids by CustomerId and DemandTypeId
     
    Optional<fr.paris.lutece.plugins.grubusiness.business.demand.TemporaryStatus>
    getStatusByLabel(String strStatusLabel)
     
    void
    remove(String strDemandId, String strDemandTypeId, String strCustomerId)
    Removes a demand with the specified id and type id
    void
    setDemandDao(fr.paris.lutece.plugins.grubusiness.business.demand.IDemandDAO dao)
     
    void
    setNotificationDao(fr.paris.lutece.plugins.grubusiness.business.notification.INotificationDAO dao)
     
    void
    setNotificationEventDao(fr.paris.lutece.plugins.grubusiness.business.notification.INotificationEventDAO dao)
     
    void
    setStatusDao(fr.paris.lutece.plugins.grubusiness.business.demand.ITemporaryStatusDAO dao)
     
    fr.paris.lutece.plugins.grubusiness.business.demand.Demand
    update(fr.paris.lutece.plugins.grubusiness.business.demand.Demand demand)
    Updates a demand
    void
    updateDemandsStatusId(int nNewStatusId, int nTemporaryStatusId)
    Update status demand

    Methods 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

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      findByCustomerId in interface fr.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:
      findByReference in interface fr.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:
      findByPrimaryKey in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
      Parameters:
      strDemandId - the demand id
      strDemandTypeId - the demand type id
      Returns:
      the demand if found, null otherwise
    • 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:
      create in interface fr.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:
      create in interface fr.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:
      create in interface fr.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:
      update in interface fr.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:
      updateDemandsStatusId in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
      Parameters:
      nNewStatusId - the new status id
      nTemporaryStatusId - To find Demands that are linked to notifications that have the temporary status in parameter
    • remove

      public void remove(String strDemandId, String strDemandTypeId, String strCustomerId)
      Removes a demand with the specified id and type id
      Specified by:
      remove in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
      Parameters:
      strDemandId - the demand id
      strDemandTypeId - 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:
      findEventsByDateAndDemandTypeIdAndStatus in interface fr.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

      public List<fr.paris.lutece.plugins.grubusiness.business.demand.DemandType> getDemandTypesList()
      get demand Type list
      Specified by:
      getDemandTypesList in interface fr.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:
      getDemandType in interface fr.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:
      getIdsByCustomerIdAndDemandTypeId in interface fr.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:
      setDemandDao in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
    • setNotificationEventDao

      public void setNotificationEventDao(fr.paris.lutece.plugins.grubusiness.business.notification.INotificationEventDAO dao)
      Specified by:
      setNotificationEventDao in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
    • setNotificationDao

      public void setNotificationDao(fr.paris.lutece.plugins.grubusiness.business.notification.INotificationDAO dao)
      Specified by:
      setNotificationDao in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
    • setStatusDao

      public void setStatusDao(fr.paris.lutece.plugins.grubusiness.business.demand.ITemporaryStatusDAO dao)
      Specified by:
      setStatusDao in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
    • getStatusByLabel

      public Optional<fr.paris.lutece.plugins.grubusiness.business.demand.TemporaryStatus> getStatusByLabel(String strStatusLabel)
      Specified by:
      getStatusByLabel in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
    • deleteAllDemandByCustomerId

      public void deleteAllDemandByCustomerId(String strCustomerId)
      Specified by:
      deleteAllDemandByCustomerId in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
    • getName

      public String getName()
      Specified by:
      getName in interface fr.paris.lutece.portal.service.util.LuteceService