Class CatalogEntityCreateEventHandler
java.lang.Object
com.broadleafcommerce.recommendationengine.service.messaging.handlers.CatalogEntityCreateEventHandler
- All Implemented Interfaces:
CatalogEntityEventHandler
-
Constructor Summary
ConstructorsConstructorDescriptionCatalogEntityCreateEventHandler
(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 String
getCreatedEntityClassFromEvent
(org.springframework.context.ApplicationEvent event) com.broadleafcommerce.data.tracking.core.Trackable
getCreatedEntityFromEvent
(@NonNull org.springframework.context.ApplicationEvent event) Gets the created entity from the given event.protected CatalogEntityEventHandlerUtility
protected com.jayway.jsonpath.Configuration
protected com.fasterxml.jackson.databind.ObjectMapper
protected com.broadleafcommerce.common.extension.TypeFactory
void
handle
(org.springframework.context.ApplicationEvent event)
-
Constructor Details
-
CatalogEntityCreateEventHandler
public CatalogEntityCreateEventHandler(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
-
getSupportedCreatedEntityClasses
-
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) -
getCreatedEntityClassFromEvent
@Nullable protected String getCreatedEntityClassFromEvent(org.springframework.context.ApplicationEvent event) -
getCreatedEntityFromEvent
public com.broadleafcommerce.data.tracking.core.Trackable getCreatedEntityFromEvent(@NonNull @NonNull org.springframework.context.ApplicationEvent event) Gets the created entity from the given event.- Parameters:
event
- theApplicationEvent
that was emitted for the created entity- Returns:
- the created 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()
-