Class DefaultSegmentProcessingService
java.lang.Object
com.broadleafcommerce.customer.service.bulk.DefaultSegmentProcessingService
- All Implemented Interfaces:
SegmentProcessingService
-
Constructor Summary
ConstructorDescriptionDefaultSegmentProcessingService
(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
Modifier and TypeMethodDescriptionprotected 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
protected CustomerSegmentService<? extends CustomerSegment>
protected CustomerService<? extends Customer>
protected com.fasterxml.jackson.databind.ObjectMapper
protected com.broadleafcommerce.common.extension.TypeFactory
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 Details
-
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 Details
-
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:
-
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:
-
throwIfNull
-
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
-
getCustomerService
-
getSegmentProcessHistoryService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-