Class MockDemandDAO

  • All Implemented Interfaces:
    IDemandDAO

    public class MockDemandDAO
    extends java.lang.Object
    implements IDemandDAO
    This class is a mock implementation of IDemandDAO
    • Constructor Summary

      Constructors 
      Constructor Description
      MockDemandDAO()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.String strCustomerID)
      Deletes a demand with the specified id and type id
      void deleteByUid​(int nUid)
      Deletes a demand with the specified uid
      Demand insert​(Demand demand)
      Insert a demand
      Demand load​(int nId)
      Finds a demand with the specified id and type id
      java.util.List<java.lang.String> loadAllIds()
      Load the ids of the demands
      java.util.Collection<Demand> loadByCustomerId​(java.lang.String strCustomerId)
      Finds the demands associated to the specified customer id
      Demand loadByDemandId​(java.lang.String strId)
      Finds demands associated to the demand id
      Demand loadByDemandIdAndTypeIdAndCustomerId​(java.lang.String strDemandId, java.lang.String strDemandTypeId, java.lang.String strCustomerID)
      Finds demands associated to the demand id and type id
      java.util.Collection<Demand> loadByFilter​(NotificationFilter filter)
      Search demands by filter
      java.util.List<Demand> loadByIds​(java.util.List<java.lang.Integer> listIds)
      load demands corresponding to the id list
      java.util.Collection<Demand> loadByReference​(java.lang.String strReference)
      Finds the demands associated to the specified reference
      java.util.List<java.lang.Integer> loadIdsByCustomerIdAndIdDemandType​(java.lang.String strCustomerId, java.lang.String strNotificationType, java.lang.String strIdDemandType)
      Load demand ids ordered by date notification
      java.util.List<java.lang.Integer> loadIdsByCustomerIdAndIdDemandType​(java.lang.String strCustomerId, java.lang.String strNotificationType, java.lang.String strIdDemandType, java.lang.String strDirectionDateOrderBy)
      Load demand ids ordered by date notification
      java.util.List<java.lang.Integer> loadIdsByFilter​(NotificationFilter filter)
      Search demands by filter
      java.util.List<java.lang.Integer> loadIdsByStatus​(java.lang.String strCustomerId, java.util.List<java.lang.String> listStatus, java.lang.String strNotificationType, java.lang.String strIdDemandType)
      Load demand ids by status
      void reassignDemands​(java.lang.String strOldCustomerId, java.lang.String strNewCustomerId)
      Reassign demands
      Demand store​(Demand demand)
      Stores a demand
      void updateDemandsStatusId​(int nStatusId, int nTemporaryStatusId)
      Update demands status id
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MockDemandDAO

        public MockDemandDAO()
    • Method Detail

      • loadByCustomerId

        public java.util.Collection<Demand> loadByCustomerId​(java.lang.String strCustomerId)
        Finds the demands associated to the specified customer id
        Specified by:
        loadByCustomerId in interface IDemandDAO
        Parameters:
        strCustomerId - the customer id
        Returns:
        the demands. An empty collection is returned if no demands has been found.
      • loadByReference

        public java.util.Collection<Demand> loadByReference​(java.lang.String strReference)
        Finds the demands associated to the specified reference
        Specified by:
        loadByReference in interface IDemandDAO
        Parameters:
        strReference - the reference
        Returns:
        the demands. An empty collection is returned if no demands has been found.
      • load

        public Demand load​(int nId)
        Finds a demand with the specified id and type id
        Specified by:
        load in interface IDemandDAO
        Returns:
        the demand if found, null otherwise
      • loadByDemandIdAndTypeIdAndCustomerId

        public Demand loadByDemandIdAndTypeIdAndCustomerId​(java.lang.String strDemandId,
                                                           java.lang.String strDemandTypeId,
                                                           java.lang.String strCustomerID)
        Finds demands associated to the demand id and type id
        Specified by:
        loadByDemandIdAndTypeIdAndCustomerId in interface IDemandDAO
        Returns:
        the demand coresponding to given demand id.
      • insert

        public Demand insert​(Demand demand)
        Insert a demand
        Specified by:
        insert in interface IDemandDAO
        Parameters:
        demand - the demand to insert
        Returns:
        the inserted demand
      • store

        public Demand store​(Demand demand)
        Stores a demand
        Specified by:
        store in interface IDemandDAO
        Parameters:
        demand - the demand to store
        Returns:
        the stored demand
      • delete

        public void delete​(java.lang.String strDemandId,
                           java.lang.String strDemandTypeId,
                           java.lang.String strCustomerID)
        Deletes a demand with the specified id and type id
        Specified by:
        delete in interface IDemandDAO
        Parameters:
        strDemandId - the demand id
        strDemandTypeId - the demand type id
      • loadAllIds

        public java.util.List<java.lang.String> loadAllIds()
        Load the ids of the demands
        Specified by:
        loadAllIds in interface IDemandDAO
        Returns:
        The list of demand ids
      • loadByDemandId

        public Demand loadByDemandId​(java.lang.String strId)
        Finds demands associated to the demand id
        Specified by:
        loadByDemandId in interface IDemandDAO
        Returns:
        the demand coresponding to given demand id.
      • loadByIds

        public java.util.List<Demand> loadByIds​(java.util.List<java.lang.Integer> listIds)
        Description copied from interface: IDemandDAO
        load demands corresponding to the id list
        Specified by:
        loadByIds in interface IDemandDAO
        Returns:
        the demands
      • loadIdsByCustomerIdAndIdDemandType

        public java.util.List<java.lang.Integer> loadIdsByCustomerIdAndIdDemandType​(java.lang.String strCustomerId,
                                                                                    java.lang.String strNotificationType,
                                                                                    java.lang.String strIdDemandType)
        Description copied from interface: IDemandDAO
        Load demand ids ordered by date notification
        Specified by:
        loadIdsByCustomerIdAndIdDemandType in interface IDemandDAO
        strIdDemandType - (Optional can be null)
        Returns:
        The list of demand ids
      • loadIdsByCustomerIdAndIdDemandType

        public java.util.List<java.lang.Integer> loadIdsByCustomerIdAndIdDemandType​(java.lang.String strCustomerId,
                                                                                    java.lang.String strNotificationType,
                                                                                    java.lang.String strIdDemandType,
                                                                                    java.lang.String strDirectionDateOrderBy)
        Description copied from interface: IDemandDAO
        Load demand ids ordered by date notification
        Specified by:
        loadIdsByCustomerIdAndIdDemandType in interface IDemandDAO
        strIdDemandType - (Optional can be null)
        strDirectionDateOrderBy - (Optional can be null)
        Returns:
        The list of demand ids
      • loadIdsByStatus

        public java.util.List<java.lang.Integer> loadIdsByStatus​(java.lang.String strCustomerId,
                                                                 java.util.List<java.lang.String> listStatus,
                                                                 java.lang.String strNotificationType,
                                                                 java.lang.String strIdDemandType)
        Description copied from interface: IDemandDAO
        Load demand ids by status
        Specified by:
        loadIdsByStatus in interface IDemandDAO
        strIdDemandType - (Optional can be null)
        Returns:
        The list of demand ids
      • deleteByUid

        public void deleteByUid​(int nUid)
        Description copied from interface: IDemandDAO
        Deletes a demand with the specified uid
        Specified by:
        deleteByUid in interface IDemandDAO
        Parameters:
        nUid - the uid
      • updateDemandsStatusId

        public void updateDemandsStatusId​(int nStatusId,
                                          int nTemporaryStatusId)
        Description copied from interface: IDemandDAO
        Update demands status id
        Specified by:
        updateDemandsStatusId in interface IDemandDAO
        Parameters:
        nStatusId - the new status id
        nTemporaryStatusId - To find Demands that are linked to notifications that have the temporary status in parameter
      • reassignDemands

        public void reassignDemands​(java.lang.String strOldCustomerId,
                                    java.lang.String strNewCustomerId)
        Description copied from interface: IDemandDAO
        Reassign demands
        Specified by:
        reassignDemands in interface IDemandDAO