Class 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, java.lang.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
      DemandService()
      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

      All Methods Instance Methods Concrete Methods 
      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 deleteAllDemandByCustomerId​(java.lang.String strCustomerId)  
      java.util.Collection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand> findByCustomerId​(java.lang.String strCustomerId)
      Finds demands for the specified customer id
      fr.paris.lutece.plugins.grubusiness.business.demand.Demand findByPrimaryKey​(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.String strCustomerId)
      Finds a demand for the specified id and type id
      java.util.Collection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand> findByReference​(java.lang.String strReference)
      Finds demands for the specified reference
      java.util.List<fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent> findEventsByDateAndDemandTypeIdAndStatus​(long dStart, long dEnd, java.lang.String strDemandTypeId, java.lang.String strStatus)
      Finds events by date and demand_type_id and status
      java.util.List<fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent> findEventsByDateAndDemandTypeIdAndStatusAndType​(long dStart, long dEnd, java.lang.String strDemandTypeId, java.lang.String strStatus, java.util.List<fr.paris.lutece.plugins.grubusiness.business.notification.EnumNotificationType> lTypes)
      Finds events by date and demand_type_id and status
      java.util.Optional<fr.paris.lutece.plugins.grubusiness.business.demand.DemandType> getDemandType​(java.lang.String type_id)
      get demand Type list
      java.util.List<fr.paris.lutece.plugins.grubusiness.business.demand.DemandType> getDemandTypesList()
      get demand Type list
      java.util.List<java.lang.Integer> getIdsByCustomerIdAndDemandTypeId​(java.lang.String strCustomerId, java.lang.String strNotificationType, java.lang.String strIdDemandType)
      get demand Ids by CustomerId and DemandTypeId
      java.lang.String getName()  
      java.util.Optional<fr.paris.lutece.plugins.grubusiness.business.demand.TemporaryStatus> getStatusByLabel​(java.lang.String strStatusLabel)  
      void remove​(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.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 Detail

      • 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 Detail

      • findByCustomerId

        public java.util.Collection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand> findByCustomerId​(java.lang.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 java.util.Collection<fr.paris.lutece.plugins.grubusiness.business.demand.Demand> findByReference​(java.lang.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​(java.lang.String strDemandId,
                                                                                           java.lang.String strDemandTypeId,
                                                                                           java.lang.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​(java.lang.String strDemandId,
                           java.lang.String strDemandTypeId,
                           java.lang.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 java.util.List<fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent> findEventsByDateAndDemandTypeIdAndStatus​(long dStart,
                                                                                                                                                    long dEnd,
                                                                                                                                                    java.lang.String strDemandTypeId,
                                                                                                                                                    java.lang.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 java.util.List<fr.paris.lutece.plugins.grubusiness.business.notification.NotificationEvent> findEventsByDateAndDemandTypeIdAndStatusAndType​(long dStart,
                                                                                                                                                           long dEnd,
                                                                                                                                                           java.lang.String strDemandTypeId,
                                                                                                                                                           java.lang.String strStatus,
                                                                                                                                                           java.util.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 java.util.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 java.util.Optional<fr.paris.lutece.plugins.grubusiness.business.demand.DemandType> getDemandType​(java.lang.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 java.util.List<java.lang.Integer> getIdsByCustomerIdAndDemandTypeId​(java.lang.String strCustomerId,
                                                                                   java.lang.String strNotificationType,
                                                                                   java.lang.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 java.util.Optional<fr.paris.lutece.plugins.grubusiness.business.demand.TemporaryStatus> getStatusByLabel​(java.lang.String strStatusLabel)
        Specified by:
        getStatusByLabel in interface fr.paris.lutece.plugins.grubusiness.business.demand.IDemandServiceProvider
      • deleteAllDemandByCustomerId

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

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