com.ibm.commerce.promotion.facade.server.services.dataaccess.bom.mediator

Class ChangePromotionMediator

    • Constructor Detail

      • ChangePromotionMediator

        public ChangePromotionMediator()
    • Method Detail

      • create

        public void create(java.lang.Object aNoun)
                    throws AbstractApplicationException
        Creates the physical entity corresponding to the logical noun
        Parameters:
        aNoun - The logical business object for which the physical entity needs to be created
        Throws:
        AbstractApplicationException - When error happens.
      • validationForActivePromotionsWithSameCode

        public void validationForActivePromotionsWithSameCode(Px_promotion promotion)
                                                       throws AbstractApplicationException
        This method is used to check that for the passed promotion parameter, its public promotion codes (manually entered by the business user) are not currently being used in any other active promotions in the store path. If the store is an asset store, then the check is also performed on the child stores. If an active promotion using the same public promotion code is found in the store, an exception is thrown with a message indicating the promotion code being re-used and the administrative name of the active promotion using it at the time.
        Parameters:
        promotion - The promotion whose codes are to be checked for re-use in active promotions.
        Throws:
        AbstractApplicationException - This exception is thrown when an error is encountered on returning the promotion objects that have the same promotion code.
      • validationForActivePromotionsWithSamePriority

        public void validationForActivePromotionsWithSamePriority(Px_promotion promotion)
                                                           throws AbstractApplicationException
        This method is used to check that for the passed promotion parameter, its priority is not currently being used in any other active promotions in the store path belonging to the same promotion group. If the store is an asset store, then the check is also performed on the child stores. If an active promotion of the same group using the same priority is found in the store, an exception is thrown with a message indicating the priority being re-used and the administrative name of the active promotion using it at the time.
        Parameters:
        promotion - The promotion whose priority is to be checked for re-use in active promotions.
        Throws:
        AbstractApplicationException - This exception is thrown when an error is encountered on returning the promotion objects that have the same promotion priority.
      • delete

        public void delete(java.lang.Object aNoun)
                    throws AbstractApplicationException
        Deletes the logical noun. Deletion of the promotion noun results update of physical entity in the form of mark for delete in physical data store.
        Parameters:
        aNoun - The logical noun that should be deleted
        Throws:
        AbstractApplicationException - When error happens
      • findPhysicalEntityWithSameAdminName

        public java.lang.Object findPhysicalEntityWithSameAdminName(java.lang.Object aNoun)
                                                             throws DataMediatorException
        Find a physical entity in the physical data container which has the same administrative name as the passed logical noun.
        Parameters:
        aNoun - The logical SDO.
        Returns:
        This method returns the Promotion object if it is found, otherwise it returns null.
        Throws:
        DataMediatorException - when an error is encountered during the process.
      • findPhysicalEntity

        public java.lang.Object findPhysicalEntity(java.lang.Object aNoun)
                                            throws DataMediatorException
        Find physical entity in the physical data container
        Parameters:
        aNoun - The logical SDO.
        Returns:
        This method returns the Promotion object if it is found, otherwise it returns null.
        Throws:
        DataMediatorException - When error happens.
      • validateChange

        public java.util.List validateChange(java.lang.Object aNoun)
                                      throws DataMediatorException
        Checks if the object to be changed is present in the physical data container. If the entity is not present then a validation error will be added to the return list
        Parameters:
        aNoun - The noun that is being requested to be changed
        Returns:
        List of errors; null if there are no errors
        Throws:
        DataMediatorException - When error happens.
        See Also:
        ChangeBusinessObjectMediator.validateChange(java.lang.Object)
      • validateDelete

        public java.util.List validateDelete(java.lang.Object aNoun)
                                      throws DataMediatorException
        Checks if the object to be removed is present in the physical data container. If the entity is not present then a validation error will be added to the return list.
        Parameters:
        aNoun - The noun that is being requested to be deleted
        Returns:
        List of errors; null if there are no errors
        Throws:
        DataMediatorException - When error happens.
        See Also:
        ChangeBusinessObjectMediator.validateDelete(java.lang.Object)