com.ibm.commerce.promotion.publiccode.loader

Class PublicPromoCodeLoader

  • java.lang.Object
    • com.ibm.commerce.promotion.publiccode.loader.PublicPromoCodeLoader


  • public class PublicPromoCodeLoader
    extends java.lang.Object
    Public promotion code loader to get public codes for specific promotion.
    • Constructor Detail

      • PublicPromoCodeLoader

        public PublicPromoCodeLoader()
    • Method Detail

      • setPromotionCodes

        public void setPromotionCodes(java.lang.String[] newPromotionCodes)
        This method is used to set promotion codes.
        Parameters:
        newPromotionCodes - A String array representing the promotion codes array to be set.
      • setTargetTotal

        public void setTargetTotal(java.lang.Long target)
        Set the total number of generate codes
        Parameters:
        target - the total number
      • getTargetTotal

        public java.lang.Long getTargetTotal()
        Get the total number of the generated codes
        Returns:
        the total number
      • setbatchSize

        public void setbatchSize(int localbatchSize)
        Set batch size
        Parameters:
        localbatchSize -
      • getCodeLoaderForPromotion

        public static PublicPromoCodeLoader getCodeLoaderForPromotion(java.lang.String promotionId)
        Get the promotionId related code loader
        Parameters:
        promotionId - the target promotionId
        Returns:
        the code generator related to the promotionId
      • setCodeLoaderForPromotion

        public static void setCodeLoaderForPromotion(java.lang.String promotionId,
                                                     PublicPromoCodeLoader cl)
        Put the code loader to cache
        Parameters:
        promotionId - the target promotionId
        cl - the related code loader
      • cleanCodeLoaderForPromotion

        public static void cleanCodeLoaderForPromotion(java.lang.String promotionId)
        Clean the related code loader free for GC
        Parameters:
        promotionId - the target promotionId
      • getNextbatchCodes

        public java.lang.String[] getNextbatchCodes()
        This method will get a batch of the codes and the return String array size will be the Minimum of targetTotal and batchSize
        Returns:
        the codes String array.