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.BulkUpdateRequest
buildBulkUpdateRequest(@NonNull CustomerSegment segment, String bulkUpdateType, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Builds a request to perform a bulk update operationprotected 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 segmentprotected com.broadleafcommerce.bulk.service.BulkUpdateManager
getBulkUpdateManager()
protected CustomerSegmentService<? extends CustomerSegment>
getCustomerSegmentService()
protected CustomerService<? extends Customer>
getCustomerService()
protected com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
protected SegmentProcessHistoryService<SegmentProcessHistory>
getSegmentProcessHistoryService()
protected com.broadleafcommerce.common.extension.TypeFactory
getTypeFactory()
SegmentProcessHistory
processRuleBasedSegment(String segmentId, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Initiates a bulk process operation on a customer rule based customer segmentprotected String
throwIfNull(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:SegmentProcessingService
Initiates a bulk process operation on a customer rule based customer segment- Specified by:
processRuleBasedSegment
in 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.JsonProcessingException
Builds 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
SegmentProcessHistory
connecting 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()
-
-