Class CatalogEntityUpdateEventHandler
java.lang.Object
com.broadleafcommerce.recommendationengine.service.messaging.handlers.CatalogEntityUpdateEventHandler
- All Implemented Interfaces:
CatalogEntityEventHandler
-
Constructor Summary
ConstructorsConstructorDescriptionCatalogEntityUpdateEventHandler
(CatalogItemService<CatalogItem> catalogItemService, CatalogEntityEventHandlerUtility eventHandlerUtility, com.jayway.jsonpath.Configuration jsonPathConfiguration, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<CatalogItem>
buildCatalogItemFromEntity
(com.broadleafcommerce.data.tracking.core.Trackable entity, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) boolean
canHandle
(org.springframework.context.ApplicationEvent event) protected CatalogItemService<CatalogItem>
protected CatalogEntityEventHandlerUtility
protected com.jayway.jsonpath.Configuration
protected com.fasterxml.jackson.databind.ObjectMapper
protected com.broadleafcommerce.common.extension.TypeFactory
protected String
getUpdatedEntityClassFromEvent
(org.springframework.context.ApplicationEvent event) com.broadleafcommerce.data.tracking.core.Trackable
getUpdatedEntityFromEvent
(@NonNull org.springframework.context.ApplicationEvent event) Gets the updated entity from the given event.void
handle
(org.springframework.context.ApplicationEvent event)
-
Constructor Details
-
CatalogEntityUpdateEventHandler
public CatalogEntityUpdateEventHandler(CatalogItemService<CatalogItem> catalogItemService, CatalogEntityEventHandlerUtility eventHandlerUtility, @Nullable com.jayway.jsonpath.Configuration jsonPathConfiguration, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
getSupportedUpdatedEntityClasses
-
canHandle
public boolean canHandle(org.springframework.context.ApplicationEvent event) - Specified by:
canHandle
in interfaceCatalogEntityEventHandler
-
handle
public void handle(org.springframework.context.ApplicationEvent event) - Specified by:
handle
in interfaceCatalogEntityEventHandler
-
buildCatalogItemFromEntity
protected Optional<CatalogItem> buildCatalogItemFromEntity(com.broadleafcommerce.data.tracking.core.Trackable entity, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getUpdatedEntityClassFromEvent
@Nullable protected String getUpdatedEntityClassFromEvent(org.springframework.context.ApplicationEvent event) -
getUpdatedEntityFromEvent
public com.broadleafcommerce.data.tracking.core.Trackable getUpdatedEntityFromEvent(@NonNull @NonNull org.springframework.context.ApplicationEvent event) Gets the updated entity from the given event.- Parameters:
event
- theApplicationEvent
that was emitted for the updated entity- Returns:
- the updated entity from the given event
-
getCatalogItemService
-
getEventHandlerUtility
-
getJsonPathConfiguration
protected com.jayway.jsonpath.Configuration getJsonPathConfiguration() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-