com.ibm.commerce.promotion.uniquecode.loader

Class PromoCodeLoader

  • java.lang.Object
    • com.ibm.commerce.promotion.uniquecode.loader.PromoCodeLoader


  • public class PromoCodeLoader
    extends java.lang.Object
    Code Loader to get codes from upload file for specific promotion.
    • Constructor Detail

      • PromoCodeLoader

        public PromoCodeLoader()
    • 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 -
      • getFinishedSize

        public java.lang.Long getFinishedSize()
        Get the finished size of the codes
        Returns:
        the finished size
      • setFinishedSize

        public void setFinishedSize(java.lang.Long localFinishedSize)
        Set the finished size of the codes
        Parameters:
        localFinishedSize -
      • getFileUploadId

        public java.lang.String getFileUploadId()
        Get file upload id
        Returns:
        A String representing the id of file upload record
      • setFileUploadId

        public void setFileUploadId(java.lang.String newFileUploadId)
        set file upload id
        Parameters:
        newFileUploadId -
      • getProcessFileId

        public java.lang.String getProcessFileId()
        get process file id
        Returns:
        A String representing the id of process file record
      • setProcessFileId

        public void setProcessFileId(java.lang.String newProcessFileId)
        set process file id
        Parameters:
        newProcessFileId -
      • getCodeLoaderForPromotion

        public static PromoCodeLoader 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,
                                                     PromoCodeLoader 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.