Interface CodeGenerationService
-
- All Known Implementing Classes:
DefaultCodeGenerationService
public interface CodeGenerationServicePerforms operations on aCodeGenerator, such as validation and code generation.- Author:
- Chad Harchar (charchar)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CodeGenerationResultgenerateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationReq, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Returns theCodeGenerationResultcontaining generated and/or existingCampaignCodesfor voucher offers based on the givenVoucherCodeGenerationRequest.CodeGenerationResultmarkInProgressAndGenerateAndGetCodes(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest)Updates theCodeGeneratorto have a status ofCodeGenerationStatusType.IN_PROCESS, then performs the code generation.default voidmarkInProgressAndGenerateCodes(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest)Updates theCodeGeneratorto have a status ofCodeGenerationStatusType.IN_PROCESS, then performs the code generation.
-
-
-
Method Detail
-
markInProgressAndGenerateCodes
default void markInProgressAndGenerateCodes(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest)
Updates theCodeGeneratorto have a status ofCodeGenerationStatusType.IN_PROCESS, then performs the code generation.- Parameters:
info- The CodeGenerator that holds the information needed in order to generate the expected number of codes with the expected formatcontextRequest- The context of the request with which to generate codes
-
markInProgressAndGenerateAndGetCodes
CodeGenerationResult markInProgressAndGenerateAndGetCodes(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest)
Updates theCodeGeneratorto have a status ofCodeGenerationStatusType.IN_PROCESS, then performs the code generation.- Parameters:
info- The CodeGenerator that holds the information needed in order to generate the expected number of codes with the expected formatcontextRequest- The context of the request with which to generate codes- Returns:
- the
CodeGenerationResultcontaining the generatedCampaignCodesand error message based on the givenCodeGenerator
-
generateCodesForVouchers
CodeGenerationResult generateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationReq, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Returns theCodeGenerationResultcontaining generated and/or existingCampaignCodesfor voucher offers based on the givenVoucherCodeGenerationRequest.This will use the existing
CodeGeneratorfor the voucher campaign if exists, otherwise it will create a new one.This method will generate the
CampaignCodesand waits for its completion in the same request, therefore it's meant for small batch of code generation only.- Parameters:
voucherCodeGenerationReq- theVoucherCodeGenerationRequestto generate the voucherCampaignCodeswithcontextInfo- The context of the request with which to generate codes- Returns:
- the
CodeGenerationResultcontaining generated and/or existingCampaignCodesfor voucher offers based on the givenVoucherCodeGenerationRequest.
-
-