com.ibm.commerce.marketing.promotion

Interface PromotionPersistenceManager

  • All Superinterfaces:
    KeyResolver, java.io.Serializable, XMLizable


    public interface PromotionPersistenceManager
    extends XMLizable, KeyResolver
    This interface represents the Promotion Persistence Manager and its implementation class should be specified in promotion engine configuration file.
    At runtime the caller can call PersistenceManagerRegistry.getInstance().getPromotionPersistenceManager() to get the object of the PromotionPersistenceManager implementation class.
    • Method Detail

      • findPromotionsInAGroupByStatus

        PromotionKey[] findPromotionsInAGroupByStatus(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey key,
                                                      int status)
                                               throws PersistenceObjectReadException
        Finds all the promotions in a promotion group by status.
        Parameters:
        key - is the key of promotion group.
        status - is promotion status.
        Returns:
        an array of promotion keys of the matching promotions.
        Throws:
        PersistenceObjectReadException - when reading objects in the database fails.
      • nextNumericKey

        java.lang.Number nextNumericKey()
        Returns the next available numeric key value for promotions.
        Returns:
        Next numeric key value for promotions.
      • reload

        void reload(PromotionKey key)
        Reload any cache for the promotion identified by its key.
        Parameters:
        key - representing promotion whose cache needs to be reloaded.
      • reloadAll

        void reloadAll()
        Reloads the entire promotion cache.
      • findActivePromotionByCodeAndStoreID

        PromotionKey findActivePromotionByCodeAndStoreID(java.lang.String code,
                                                         java.lang.Integer storeID)
        Finds all promotions by their code (visualCue) and storeID.
        Parameters:
        code - visual cue of the promotion to be found.
        storeID - is the ID of the store.
        Returns:
        the key of the promotion.
      • findActivePromotionByNameAndStoreID

        PromotionKey findActivePromotionByNameAndStoreID(java.lang.String name,
                                                         java.lang.Integer storeID)
        Finds all active promotions by their Name and storeID.
        Parameters:
        name - is the name of the promotion to be found.
        storeID - is the ID of the store.
        Returns:
        the key of the promotion.
      • findCurrentPromotionByNameVersionAndStoreID

        PromotionKey findCurrentPromotionByNameVersionAndStoreID(java.lang.String name,
                                                                 java.lang.Integer version,
                                                                 java.lang.Integer storeID)
                                                          throws PersistenceObjectNotFoundException,
                                                                 PersistenceObjectReadException
        Finds all promotions that are either active, inactive or suspended, but not deleted or obsolete by their Name, version and storeID.
        Parameters:
        name - is the name of the promotion to be found.
        version - is the version of the promotion to be found.
        storeID - is the store ID of the store.
        Returns:
        the key of the promotion.
        Throws:
        PersistenceObjectNotFoundException - when no current object is found.
        PersistenceObjectReadException - when reading of the object fails.
      • findPromotionByStatusAndStoreID

        PromotionKey[] findPromotionByStatusAndStoreID(int status,
                                                       java.lang.Integer storeID)
        Finds all promotions by status and storeID.
        Parameters:
        status - is the status of the promotion to be found.
        storeID - ID of the store.
        Returns:
        an array of keys of matched promotions.
      • findCurrentPromotionByStoreID

        PromotionKey[] findCurrentPromotionByStoreID(java.lang.Integer storeID)
        Finds current promotions by storeID. The definition of a current promotion is defined as a promotion that is in one of the following status: active, inactive, suspended. Deleted and Obsolete promotions are not counted towards "current" promotions.
        Parameters:
        storeID - is the ID of the store.
        Returns:
        an array of keys of matched promotions.
      • findPromotionByStoreID

        PromotionKey[] findPromotionByStoreID(java.lang.Integer storeID)
        Finds all promotions by storeID.
        Parameters:
        storeID - is the ID of the store.
        Returns:
        an array of keys of matched promotions.
      • findActivePromotionByCodePatternAndStoreID

        PromotionKey[] findActivePromotionByCodePatternAndStoreID(java.lang.String code,
                                                                  java.lang.Integer storeID)
        Finds all promotions by their code (visualCue) and storeID.
        Parameters:
        code - is the visual cue of the promotion to be found.
        storeID - is the ID of the store.
        Returns:
        the key of the promotion.
      • findActivePromotionsInAGroupByDate

        PromotionKey[] findActivePromotionsInAGroupByDate(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey aGroupKey,
                                                          java.sql.Timestamp aStartDate,
                                                          java.sql.Timestamp aEndDate)
                                                   throws PersistenceObjectReadException
        Finds all active promotions in a promotion group that has its start date is before the specified date and its end date is after the specified date.
        Parameters:
        aGroupKey - The key of a promotion group.
        aStartDate - The date to check against the promotion start date. If the date is null, then all active promotion will be returned regardless its start date.
        aEndDate - The date to check against the promotion end date. If the date is null, then all active promotion will be returned regardless its end date.
        Returns:
        an array of promotion keys of the matching promotions.
        Throws:
        PersistenceObjectReadException - when reading objects in the database fails.
      • findActivePromotionByStoreIDAndDate

        PromotionKey[] findActivePromotionByStoreIDAndDate(java.lang.Integer storeID,
                                                           java.sql.Timestamp aStartDate,
                                                           java.sql.Timestamp aEndDate)
        Finds all active promotions of a store that has its start date is before the specified date and its end date is after the specified date.
        Parameters:
        storeID - ID of the store.
        aStartDate - The date to check against the promotion start date. If the date is null, then all active promotion will be returned regardless its start date.
        aEndDate - The date to check against the promotion end date. If the date is null, then all active promotion will be returned regardless its end date.
        Returns:
        an array of keys of matched promotions.