Class DefaultSegmentProcessingService
- java.lang.Object
-
- com.broadleafcommerce.customer.service.bulk.DefaultSegmentProcessingService
-
- All Implemented Interfaces:
SegmentProcessingService
public class DefaultSegmentProcessingService extends Object implements SegmentProcessingService
-
-
Constructor Summary
Constructors Constructor Description DefaultSegmentProcessingService(com.broadleafcommerce.bulk.service.BulkUpdateManager bulkUpdateManager, CustomerSegmentService<? extends CustomerSegment> customerSegmentService, CustomerService<? extends Customer> customerService, SegmentProcessHistoryService<SegmentProcessHistory> segmentProcessHistoryService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.broadleafcommerce.bulk.domain.BulkUpdateRequestbuildBulkUpdateRequest(@NonNull CustomerSegment segment, String bulkUpdateType, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context)Builds a request to perform a bulk update operationprotected SegmentProcessHistorycreateSegmentBulkUpdateRelationship(CustomerSegment segment, com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)Creates the relationship between the bulk update process and the customer segmentprotected com.broadleafcommerce.bulk.service.BulkUpdateManagergetBulkUpdateManager()protected CustomerSegmentService<? extends CustomerSegment>getCustomerSegmentService()protected CustomerService<? extends Customer>getCustomerService()protected com.fasterxml.jackson.databind.ObjectMappergetObjectMapper()protected SegmentProcessHistoryService<SegmentProcessHistory>getSegmentProcessHistoryService()protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()SegmentProcessHistoryprocessRuleBasedSegment(String segmentId, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Initiates a bulk process operation on a customer rule based customer segmentprotected StringthrowIfNull(String property, String propertyName)
-
-
-
Constructor Detail
-
DefaultSegmentProcessingService
public DefaultSegmentProcessingService(com.broadleafcommerce.bulk.service.BulkUpdateManager bulkUpdateManager, CustomerSegmentService<? extends CustomerSegment> customerSegmentService, CustomerService<? extends Customer> customerService, SegmentProcessHistoryService<SegmentProcessHistory> segmentProcessHistoryService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Detail
-
processRuleBasedSegment
@NonNull public SegmentProcessHistory processRuleBasedSegment(@NonNull String segmentId, @NonNull @NonNull @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:SegmentProcessingServiceInitiates a bulk process operation on a customer rule based customer segment- Specified by:
processRuleBasedSegmentin interfaceSegmentProcessingService- Parameters:
segmentId- The ID of the segment to processcontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- The created
SegmentProcessHistory - See Also:
DefaultRuleBasedSegmentBulkProcessor
-
buildBulkUpdateRequest
protected com.broadleafcommerce.bulk.domain.BulkUpdateRequest buildBulkUpdateRequest(@NonNull @NonNull @NonNull CustomerSegment segment, @NonNull String bulkUpdateType, @NonNull @NonNull @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context) throws com.fasterxml.jackson.core.JsonProcessingExceptionBuilds a request to perform a bulk update operation- Parameters:
segment- The segment to processbulkUpdateType- The bulk update typecontext- The context- Returns:
- A BulkUpdateRequest instance
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- See Also:
BulkUpdateType
-
createSegmentBulkUpdateRelationship
protected SegmentProcessHistory createSegmentBulkUpdateRelationship(CustomerSegment segment, com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Creates the relationship between the bulk update process and the customer segment- Parameters:
segment- The customer segment being processedbulkUpdate- The bulk updatecontext- context information surrounding sandboxing and multitenant state- Returns:
- The
SegmentProcessHistoryconnecting the bulk update to the segment
-
getBulkUpdateManager
protected com.broadleafcommerce.bulk.service.BulkUpdateManager getBulkUpdateManager()
-
getCustomerSegmentService
protected CustomerSegmentService<? extends CustomerSegment> getCustomerSegmentService()
-
getCustomerService
protected CustomerService<? extends Customer> getCustomerService()
-
getSegmentProcessHistoryService
protected SegmentProcessHistoryService<SegmentProcessHistory> getSegmentProcessHistoryService()
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
-