Class CustomerEventListener
java.lang.Object
com.broadleafcommerce.recommendationengine.service.messaging.CustomerEventListener
-
Constructor Summary
ConstructorsConstructorDescriptionCustomerEventListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentMessageService, CustomerService<Customer> customerService, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildContextInfo
(@NonNull CustomerModifiedEvent event, @NonNull List<Customer> customers) Builds aContextInfo
for the persistence event related to the entity.protected CustomerService<Customer>
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
protected com.broadleafcommerce.common.extension.TypeFactory
void
listen
(org.springframework.messaging.Message<CustomerModifiedEvent> message) protected void
logBulkResponseFailures
(com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<Customer> bulkResponse, boolean isCreate, @NotNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
processCustomerModification
(@NonNull List<Customer> customers, @NonNull String operationType, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
processCustomerUpdates
(@NotNull List<Customer> customers, @NotNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
processEvent
(@NonNull org.springframework.messaging.Message<CustomerModifiedEvent> message)
-
Constructor Details
-
CustomerEventListener
public CustomerEventListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentMessageService, CustomerService<Customer> customerService, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
listen
@StreamListener("recommendationEngineCustomerEventInput") public void listen(org.springframework.messaging.Message<CustomerModifiedEvent> message) -
processEvent
public void processEvent(@NonNull @NonNull org.springframework.messaging.Message<CustomerModifiedEvent> message) -
processCustomerModification
-
processCustomerUpdates
-
logBulkResponseFailures
protected void logBulkResponseFailures(com.broadleafcommerce.data.tracking.core.service.BulkPersistenceResponse<Customer> bulkResponse, boolean isCreate, @NotNull @NotNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
buildContextInfo
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo(@NonNull @NonNull CustomerModifiedEvent event, @NonNull @NonNull List<Customer> customers) Builds aContextInfo
for the persistence event related to the entity. Uses the one on the event if present.- Parameters:
event
- The deserialized event.- Returns:
- A
ContextInfo
for the persistence event related to the entity.
-
getIdempotentMessageService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentMessageService() -
getCustomerService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-