public class UniquePromotionCodeUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String | createNewProcessFile(java.lang.String fileUploadId)
Create new process file record with file upload id.
|
static void | deleteCodesByPromotionIdAndUsagetype(java.lang.String promotionId, java.lang.String usageType)
Remove entries from px_cdpool table based on code's px_promotion_id and usagetype (i.e.
|
static void | deletePromotionCodesFromOracleDMLErrorLogByStoreIDInternalIDAndReferenceID(java.lang.String storeID, java.lang.String internalID, java.lang.String referenceID)
Removes all codes from the PX_CDPOOL_ERROR Table based on the STORE_ID, INTERNAL_ID and REFERENCE_ID columns.
|
static PhysicalDataContainer | getActivePxCdPromoByPoolID(java.lang.String aPx_poolID)
Get active Px_cdpromo physical data objects by PX_CDPOOL_ID.
|
static PhysicalDataContainer | getCDUsageByOrderId(java.lang.Long orderId)
Get physical data objects of Px_cdusage by order id.
|
static PhysicalDataContainer | getCDUsageByOrderIdAndPoolId(java.lang.Long orderId, java.lang.Long cdPoolId)
Get physical data object of Px_cdusage by order id and promotion code id.
|
static java.lang.String | getConfigProperties(java.lang.String configKey)
Get the configuration property value from the configuration properties file The configuration group is "UniquePromotionCode" which stores in the wc-admin-component.xml file
|
static PhysicalDataContainer | getEmptyPhysicalDataContainer()
Get an empty Physical Data Container
|
static java.util.List | getExistingCodesByCodeAndStoreID(java.util.List allPromotionCodes, java.lang.String storeID, java.lang.String codeMin, java.lang.String codeMax)
This method is used to determine the promotion codes that already exist in the PX_CDPOOL table from a list of passed promotionCodes belonging to store with ID storeID.
|
static java.util.List | getExistingCodesByCodeStoreIDAndInternalID(java.util.List allPromotionCodes, java.lang.String storeID, java.lang.String codeMin, java.lang.String codeMax, java.lang.String internalID)
This method is used to determine the promotion codes that already exist in the PX_CDPOOL table from a list of passed promotionCodes belonging to store with ID storeID.
|
static java.util.List | getExistingCodesByCodeStoreIDInternalIDAndReferenceIDUsingOracleDMLErrorLog(java.lang.String storeID, java.lang.String internalID, java.lang.String referenceID)
This method is used to determine the promotion codes that already exist in the PX_CDPOOL by using the PX_CDPOOL_ERROR table that is populated with the duplicates by Oracle's DML Error Logging feature and the codes belong to store with ID storeID.
|
static KeyManager | getKeyManager()
Get the key manager for the promotion component
|
static PhysicalDataContainer | getPromotionById(java.lang.String promoId)
Get physical data object of promotion
|
static PhysicalDataContainer | getPromotionByOrderId(java.lang.String orderId)
Get physical data object of Px_promotion by order id.
|
static PhysicalDataContainer | getPromotionByUniqueCodeAndStatus(java.lang.String uniqueCode, java.util.List listPromotionStatus, java.util.List listPxCdPromoStatus, java.util.List listPxCdPoolStatus)
Get physical data object of Px_promotion by unique promotion code, the status of promotion, the status of Px_cdpromo and the status of Px_cdusage.
|
static PhysicalDataContainer | getPromotionCodePool(java.lang.String code)
This method is used to return a PhysicalDataContainer which contains the Px_cdpool physical objects.
|
static PhysicalDataContainer | getPromotionCodes(java.lang.String promoId)
Get the promotion related promotion code.
|
static PhysicalDataContainer | getPromotionCodesByOrderId(java.lang.Long orderId)
Get physical data object of unique promotion by unique code
|
static PhysicalDataContainer | getPromotionCodesByReferenceID(java.util.List referenceIDs)
Get the promotion codes with the passed list of referenceIDs.
|
static PhysicalDataContainer | getPromotionCodeSpec(java.lang.String promoId)
Get Physical Data Container of code specification
|
static com.ibm.commerce.promotion.facade.server.entity.datatypes.Px_cdspec | getPromotionCodeSpecPhysicalObject(int promoId)
Get the promotion code specification physical object by promotion Id
|
static com.ibm.commerce.promotion.facade.server.entity.datatypes.Px_cdspec | getPromotionCodeSpecPhysicalObject(PhysicalDataContainer promoPDC)
Get the promotion physical object by the Physical data container
|
static Px_promotion | getPromotionPhysicalObject(PhysicalDataContainer promoPDC)
The promotion physical data object of the promotion
|
static PhysicalDataContainer | getPxCdPromoByPoolIDAndPromotionID(java.lang.String aPx_promotionID, java.lang.String aPx_poolID)
Get all Px_cdpromo physical data objects by PX_PROMOTION_ID and PX_CDPOOL_ID.
|
static PhysicalDataContainer | getPxCdPromoByPromotionID(java.lang.String aPx_promotionID)
Get all Px_cdpromo physical data objects by PX_PROMOTION_ID.
|
static org.w3c.dom.Document | getXMLDocument(java.lang.String xmlString)
Generator the XML Document object based on the XML String input.
|
static boolean | isAppliedToOrderCodeUsageStatus(int status)
This method validates if a unique promotion code status is applied to an order status.
|
static boolean | isCodeAvailableToUse(java.lang.Long cdPoolId)
Validates the code to see if the code is still available to use.
|
static boolean | isPromoCodePerformanceEnhancementEnabled()
This method checks if the schema change from APAR#JR45153 has been applied to the database.
|
static boolean | isRedeemedToOrderCodeUsageStatus(int status)
This method validates if a unique promotion code status is redeemed to an order status.
|
static int | updateProcessFileEndTime(java.lang.String processFileId)
This method is used to update process file end time
|
static int | updateProcessFileProcessInfo(java.lang.String processFileId, java.lang.String processInfo)
This method is used to update process file process info.
|
static int | updateProcessFileStatus(java.lang.String processFileId, int newStatus)
This method is used to update process file status.
|
static boolean | validateUniqueCodeUsageStatus(int status)
This method validates if a unique promotion code can adds to an order by its usage status.
|
public static PhysicalDataContainer getPromotionCodeSpec(java.lang.String promoId) throws DataMediatorException
public static PhysicalDataContainer getPromotionCodePool(java.lang.String code) throws DataMediatorException
public static com.ibm.commerce.promotion.facade.server.entity.datatypes.Px_cdspec getPromotionCodeSpecPhysicalObject(int promoId)
public static com.ibm.commerce.promotion.facade.server.entity.datatypes.Px_cdspec getPromotionCodeSpecPhysicalObject(PhysicalDataContainer promoPDC)
public static Px_promotion getPromotionPhysicalObject(PhysicalDataContainer promoPDC)
public static PhysicalDataContainer getPromotionById(java.lang.String promoId) throws DataMediatorException
public static PhysicalDataContainer getPromotionCodes(java.lang.String promoId) throws DataMediatorException
public static PhysicalDataContainer getPromotionCodesByReferenceID(java.util.List referenceIDs) throws DataMediatorException
public static PhysicalDataContainer getPromotionCodesByOrderId(java.lang.Long orderId) throws DataMediatorException
public static PhysicalDataContainer getEmptyPhysicalDataContainer()
public static KeyManager getKeyManager()
public static java.lang.String getConfigProperties(java.lang.String configKey)
public static boolean isAppliedToOrderCodeUsageStatus(int status)
public static boolean isRedeemedToOrderCodeUsageStatus(int status)
public static java.lang.String createNewProcessFile(java.lang.String fileUploadId) throws QueryServiceApplicationException, java.sql.SQLException
public static int updateProcessFileStatus(java.lang.String processFileId, int newStatus) throws QueryServiceApplicationException, java.sql.SQLException
public static int updateProcessFileProcessInfo(java.lang.String processFileId, java.lang.String processInfo) throws QueryServiceApplicationException, java.sql.SQLException
public static int updateProcessFileEndTime(java.lang.String processFileId) throws QueryServiceApplicationException, java.sql.SQLException
public static PhysicalDataContainer getCDUsageByOrderId(java.lang.Long orderId) throws DataMediatorException
public static PhysicalDataContainer getCDUsageByOrderIdAndPoolId(java.lang.Long orderId, java.lang.Long cdPoolId) throws DataMediatorException
public static PhysicalDataContainer getPromotionByUniqueCodeAndStatus(java.lang.String uniqueCode, java.util.List listPromotionStatus, java.util.List listPxCdPromoStatus, java.util.List listPxCdPoolStatus) throws DataMediatorException
public static PhysicalDataContainer getPromotionByOrderId(java.lang.String orderId) throws DataMediatorException
public static PhysicalDataContainer getPxCdPromoByPoolIDAndPromotionID(java.lang.String aPx_promotionID, java.lang.String aPx_poolID) throws DataMediatorException
public static PhysicalDataContainer getPxCdPromoByPromotionID(java.lang.String aPx_promotionID) throws DataMediatorException
public static PhysicalDataContainer getActivePxCdPromoByPoolID(java.lang.String aPx_poolID) throws DataMediatorException
public static org.w3c.dom.Document getXMLDocument(java.lang.String xmlString)
public static boolean isCodeAvailableToUse(java.lang.Long cdPoolId)
public static boolean validateUniqueCodeUsageStatus(int status)
public static java.util.List getExistingCodesByCodeStoreIDAndInternalID(java.util.List allPromotionCodes, java.lang.String storeID, java.lang.String codeMin, java.lang.String codeMax, java.lang.String internalID)
public static java.util.List getExistingCodesByCodeAndStoreID(java.util.List allPromotionCodes, java.lang.String storeID, java.lang.String codeMin, java.lang.String codeMax)
public static void deleteCodesByPromotionIdAndUsagetype(java.lang.String promotionId, java.lang.String usageType)
public static java.util.List getExistingCodesByCodeStoreIDInternalIDAndReferenceIDUsingOracleDMLErrorLog(java.lang.String storeID, java.lang.String internalID, java.lang.String referenceID)
public static void deletePromotionCodesFromOracleDMLErrorLogByStoreIDInternalIDAndReferenceID(java.lang.String storeID, java.lang.String internalID, java.lang.String referenceID)
public static boolean isPromoCodePerformanceEnhancementEnabled()